Forum Discussion
Iteration condition: IF @ITERATION=1 THEN ($TYP : $A : $B : ‘A’ : $C : SPACE(6) : $$CD : SPACE(17) )ELSE IF @ITERATION=2 THEN ($TYP : $A : $B : ‘B’ : $NO : $G : SPACE(31) )ELSE IF @ITERATION=3 THEN ($TYP : $A : $B : ‘$C’ : $NO : SPACE(16) : $F : $DT : $GH : SPACE(23) )ELSE ($TYP : $A : $B : ‘D’ : $NO : SPACE(61) : $D )
According to this iteration condition, we have to generate the values till to the last iteration i.e., iteration4 ($TYP: $A: $B : ‘D’ : $NO : SPACE(61) : $D ).
In mapper I’m getting the $A,$B,$C,$D FIELDS along with those columns need to add spaces ….
In a mapper I have spitted the expression into 4 parts like
ITERATION=1 $TYP : $A : $B : ‘A’ : $C : SPACE(6) : $CD : SPACE(17)) ---$LVRECORD1
ITERATION=2 ($TYP : $A : $B : ‘B’ : $NO : $G : SPACE(31) ) ---$LVRECORD2
ITERATION=3 ($TYP : $A : $B : ‘$C’ : $NO : SPACE(16) : $F : $DT : $GH : SPACE(23) )--- $LVRECORD3
ITERATION=4 ($TYP: $A: $B : ‘D’ : $NO : SPACE(61) : $D ). ) ---$LVRECORD4
In the next mapper
Next mapper
Same for all the 4 source columns I have taken the target as $LVRECORD
Output:
ABCD CD A iteration1
ABCD NO G A iteration2
ABCD CD F DTGH A iteration3
TYP ADNO CD A iteration4
- SriramGopal7 years agoNew Contributor II
For any clarifications regarding this pattern please reach out to, snaplogic@agilisium.com