suppose one sequential flat file:
0001 1 +100.70
0002 1 +120.13
0001 2 +600.80
0001 1 +100.20
0002 2 +500.10
I need sort with unique result, if the 6th byte is 1, then change the amount sign as "+", else if 6th byte is 2, then change as "-"
here is my JCL
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(8:8,7,SFF,TO=ZD)),
IFTHEN=(WHEN=(6,1,CH,EQ,C'1'),
OVERLAY=(8:7,2,ZD,MUL,-1)),
IFTHEN=(WHEN=(6,1,CH,EQ,C'2'),
OVERLAY=(8:7,2,ZD,MUL,1))
SORT FIELDS=(1,6,CH,A)
SUM FIELDS=(8,7,ZD)
OUTREC OVERLAY=(8:8,7,ZD,EDIT=(SIIT.TT),SIGNS=(+,-))
/*
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(8:8,7,SFF,TO=ZD)),
IFTHEN=(WHEN=(6,1,CH,EQ,C'1'),
OVERLAY=(8:7,2,ZD,MUL,-1)),
IFTHEN=(WHEN=(6,1,CH,EQ,C'2'),
OVERLAY=(8:7,2,ZD,MUL,1))
SORT FIELDS=(1,6,CH,A)
SUM FIELDS=(8,7,ZD)
OUTREC OVERLAY=(8:8,7,ZD,EDIT=(SIIT.TT),SIGNS=(+,-))
/*
But got abend, how to use OVERLAY to override amount sign?
Thanks,
Ricky