2 Replies Latest reply: Dec 10, 2014 10:41 AM by Koen Bal RSS

    Can I reuse mapping tables

    Erik Anderson

      I have a for loop in my script that loads data for each month.  I would like to reuse my mapping tables for each month, loading them with the next months lookup values.  In my test, the second time I assign values to the mapping table it doesn't take.  So far I don't see a way to drop the table, or to use a dynamic name. 

       

      Any help on this would be appreciated. 

      Thanks

        • Re: Can I reuse mapping tables
          Srikanth P

          Hi Erik , Firstly, there is no concatenation between two mapping tables. So please use global Mapping table or create Mapping table every time in the Loop like below:

           

          Method1:

          MAP_TAB:

          MAPPING LOAD A, B FROM SOURCE ;

           

          FOR i=1 to 10

               LOAD * , ApplyMap('MAP_TAB',A) AS FIELD;

          Next i

           

          Method2:

           

          FOR i=1 to 10

               vMapName = 'MAP_TAB'&$(i);

               $(vMAPName):

               MAPPING LOAD A, B FROM SOURCE;

               LOAD * , ApplyMap('$(vMapName)', A) AS FIELD ;

           

          NEXT i

           

          Please post your script if you encounter any problems.