5 Replies Latest reply: Aug 4, 2012 6:12 PM by Gerrit Zanen RSS

    Change value of field during AutoGenerate

      Hello,

       

      As part of a script I have the following lines:

       

      WeekLink2011:

      LOAD

           '2011'&rowno() as WEEKLINK2011

      AutoGenerate(53);

      WeekLink2012:

      LOAD

           '2012'&rowno() as WEEKLINK2012

      AutoGenerate(53);

      WeekLink:

      LOAD

          WEEKLINK2011 as WEEKLINK

      Resident WeekLink2011;

      LOAD

          WEEKLINK2012 as WEEKLINK

      Resident WeekLink2012;

      DROP Tables

            WeekLink2011,

            WeekLink2012;

       

      This is working fine and generates a file that gives me 1 field that contains the value 20111, 20112, ..201153, 20121. 20122, ..201253.

      So far so good.

       

      But I try to learn the syntax and I am looking for the shorter way of doing this.

       

      So I try something like:

      for a = 2011 to 2012

      Weeklink:

      lOAD

         $(a) & RowNo()

      AutoGenerate(53);

      NEXT;

       

      But the function row() counts above 53 till 106, so this doesn't work fo me.

      So the question is, how to reset RowNo() to one again in the 2nd loop.

      Or, and this is what I tried to achieve, what is the syntax for something like this: $(a) & (b=b+1) and reset b at the end of the loop.

       

      Any help is welcome.

       

      Regards,

       

      Gerrit