Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

For each loop and apply map

Hi

So I have two set of for each loop from different folders and diferent names, but with common number for each:

First loop is like "withfilenameA*"  ;  *= 1,2,3 ...

Second Loop is like "withfilenameB*" ; * =1,2,3 ...

So from withfieldnameA I want to do a mapping load, so I can do applymap into withfieldnameB. So I guess I will need 3 loop in all.

My plan is in some way to put the mapping load with the second loop, but how can I be sure that they loop the corresponding files in the same order for both loops so the mapping will be correct?        

1 Solution

Accepted Solutions
Gysbert_Wassenaar

maybe like this:

for i =1 to ...

     map$(i):

     mapping load FieldA, FieldB from withfilenameA$(i).xxx (....);

     Table$(i):

     load FieldC, FieldD, ..., applymap('map$(i)',FieldQ) as FieldZ from withfilenameB$(i).xxx (....);    

next


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

maybe like this:

for i =1 to ...

     map$(i):

     mapping load FieldA, FieldB from withfilenameA$(i).xxx (....);

     Table$(i):

     load FieldC, FieldD, ..., applymap('map$(i)',FieldQ) as FieldZ from withfilenameB$(i).xxx (....);    

next


talk is cheap, supply exceeds demand
Not applicable
Author

Thx, actually pretty simple when it is setup like this ☺ I have have a little more in my script, but I can see that I need to fix something else before I move on and then I will try again and probably  mark your answer as correct.