|
View previous topic :: View next topic
|
| Author |
Message |
Manu Dhawan
New User
Joined: 01 Jun 2009 Posts: 9 Location: India
|
|
|
|
Hi,
I am trying a simple thing, just moving some fields from input file to output file, the only logic to apply is to check if one field in input is 'M' or 'F' then concatenate two input fields to last output field. Following is the sort card that I am trying to use but getting different errors mostly syntax error.
| Code: |
SORT FIELDS=COPY
OUTREC BUILD=(27,3,C'!',1,10,SQZ=(SHIFT=LEFT),C'!',
30,10,SQZ=(SHIFT=LEFT),C'!',
590,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
604,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
620,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
626,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
632,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
127,15,C'!',142,20,C'!',537,40,C'!',
498,1,C'!',584,6,SQZ=(SHIFT=LEFT),C'!',
170,30,C'!',200,30,C'!',230,30,C'!',260,30,C'!',
320,3,C'!',323,9,C'!',1358,1,C'!',
1359,1,C'!',1360,1,C'!',1361,9,C'!',
1370,16,C'!',113,1,C'!',96,1,C'!',
40,8,C'!',64,8,C'!',56,8,C'!',371:X
IFTHEN=(WHEN=(498,1,CH,EQ,C'M',OR,498,1,CH,EQ,C'F'),
OVERLAY=(371:142,20,391:127,15)))
|
I think this can be achieve if I use IFTHEN with BUILD twice, but just want to know if it is possible the way I am trying as above, or is there any other efficient way.
Thanks,
Manu |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Manu Dhawan,
With OUTREC build you have already moved the contents of 498 to pos 160. You also moved the contents of 127 and 142 to 82 and 98 respectively. So you cannot really use the same position as your input on the IFTHEN statement. Try these updated control cards.
| Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=INIT,
BUILD=(0027,3,C'!',1,10,SQZ=(SHIFT=LEFT),C'!',
0030,10,SQZ=(SHIFT=LEFT),C'!',
0590,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
0604,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
0620,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
0626,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
0632,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',
0127,15,C'!',142,20,C'!',537,40,C'!',
0498,1,C'!',584,6,SQZ=(SHIFT=LEFT),C'!',
0170,30,C'!',200,30,C'!',230,30,C'!',260,30,C'!',
0320,3,C'!',323,9,C'!',1358,1,C'!',
1359,1,C'!',1360,1,C'!',1361,9,C'!',
1370,16,C'!',113,1,C'!',96,1,C'!',
0040,8,C'!',64,8,C'!',56,8,C'!',371:X)),
IFTHEN=(WHEN=(160,1,CH,EQ,C'M',OR,160,1,CH,EQ,C'F'),
OVERLAY=(371:98,20,391:82,15))
//* |
|
|
| Back to top |
|
 |
Manu Dhawan
New User
Joined: 01 Jun 2009 Posts: 9 Location: India
|
|
|
|
Hi Skolusu,
It worked.
Thank you,
Manu |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|