Temp var issue in xlate when upgrading from 5.3 to 5.8

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Temp var issue in xlate when upgrading from 5.3 to 5.8

  • Creator
    Topic
  • #52945
    Graham Hartley
    Participant

      Hi,

      We are in the process of upgrading from 5.3 to 5.8 and have run into a bit of a problem with some of our Xlates.  We run Cloverleaf on Windows Server 2003 R2 SP2.

      We have a number of Xlates which uses temp variables as part of the outbound path name.  The Xlates work fine in version 5.3 however in version 5.8 we get the following error:

      Quote:


      ERROR: Invalid address reference.

      “@gg1” temporary variable was not defined but used

      Below is a snippet of one of the Xlates:

      Code:


             { { OP COPY }
                 { ERR 0 }
                 { IN {=RY =3 =01} }
                 { OUT {{SEG3(@gg1).Transaction_Type.[0]} {SEG3(@gg1).Record_Layout_Number.[0]} {SEG3(@gg1).Case_Number.[0]}} }
             }
             { { OP COPY }
                 { ERR 0 }
                 { IN {=TEXT =1} }
                 { OUT {{SEG3(@gg1).Result_Code.[0]} {SEG3(@gg1).Last_Record_Type_3.[0]}} }
             }

      Any help would be much appreciated.

      Regards,

      Graham

    Viewing 5 reply threads
    • Author
      Replies
      • #76021
        Alice Kazin
        Participant

          Did you try to initialize the variable.  Notice $ in front of variable name.

          OP COPY

           IN =0

           OUT $@gg1

        • #76022
          Jim Kosloskey
          Participant

            Should not need a $ in front of Xlate temp variables.

            However, I was not aware the use of a temp variable or any other item other than a %xn variable would resolve to anything but zero in an address reference path. Are you sure you weren’t always addressing the zeroth repetition?

            It looks like 5.8 now lets you know you are using something other than a %sn, %gn, %fn, or %ln.

            I would try using %g99 instread of your temp variable (here you would need to prefix with a $ when using inside an action as the source or destination or in an IF). That will probably rid you of that error and liley you might see different (more correct results)

            email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

          • #76023
            Russ Ross
            Participant

              I don’t remeber the specifics but do recall I had to clean up some xlate things that had not been strictly enforced in older version 5.2 and when we upgraded to 5.6 it started letting me know it wasn’t going to be as forgiving.

              I think what you are discribing would fall into this category of stricter checking being done by higher versions of cloverleaf to help keep us out of trouble a bit more.

              Russ Ross
              RussRoss318@gmail.com

            • #76024
              Alice Kazin
              Participant

                Two things we had to change for 5.8:

                1) EVN.1 doesn’t get automatically filled-in based on Reconfigure

                2) Pathcopy requires left and right side to have values in paretheses

                   0(0).PID(0) ==> 0(0).PID   doesn’t work

                   0(0).PID(0) ==> 0(0).PID(0)  does work

              • #76025
                Graham Hartley
                Participant

                  Thank you all for your help on this.

                  Jim – I have checked the Xlate and in 5.3 @gg1 was being used to address other repetitions apart from zero.

                  I have thankfully now managed to get it to work.  In the end I replaced @gg1 with $%g99 in all places apart from in the address path where I replaced it with %g99.  If anyone knows why I have to reference it differently then please let me know.

                  For example:

                  Code:


                  { { OP ADD }
                                                     { ERR 0 }
                                                     { IN {$%g99 =1} }
                                                     { OUT $%g99 }
                                                     { FUNCTION ADD }
                                                 }

                  but in the address path I have to use %g99

                  Code:


                  { { OP COPY }
                                             { ERR 0 }
                                             { IN =| }
                                             { OUT {{SEG3(%g99).Record_Seperator.[0]}} }
                                         }

                  Regards,

                  Graham

                • #76026
                  Jim Kosloskey
                  Participant

                    Graham,

                    That is the way I have always known this to work (I have been working with Xlates for 15+ years).

                    As a matter of fact a request for enhancement was made about 13 years ago to allow any data element (iteration counter, temp variable, an inbound or outbound data item) to be used in address pathing.

                    As far as I know that enhancement has never been made (or formally rejected).

                    So I have to say if you have proof you were able to address repetitions other than the first by using the tempvariable then I think the 5.3 release was an anamoly – unless they developed the enhancement for one release and then reversed it. I know 5.4 did not allow the use of temp variables the way you describe.

                    email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                Viewing 5 reply threads
                • The forum ‘Cloverleaf’ is closed to new topics and replies.