I have a input file which has LRECL=80, RECFM = FB .Out of 80 bytes it has only 35 bytes of data . I need to sort and get sum by date field and amount field which occupies at 10th position and 21st position. Amount is of packed decimal which occupies 10 bytes of length.
I am not getting the expected edited format .
Code:
SORT FIELDS=(10,10,CH,A)
INREC OVERLAY =(40:21,10,PD,TO=ZD,LENGTH=15)
SUM FIELDS=(40,15,ZD)
Hi Sergeyken,
I am sorry. I almost done in editing the sum value to my expectation but still i am working on get rid of the values after decimal which i don't need .
Code:
SORT FIELDS=(10,10,CH,A)
INREC OVERLAY =(40:21,10,PD,TO=ZD,LENGTH=15)
SUM FIELDS=(40,15,ZD)
Hi Sergeyken,
I am sorry. I almost done in editing the sum value to my expectation but still i am working on get rid of the values after decimal which i don't need .
Code:
SORT FIELDS=(10,10,CH,A)
INREC OVERLAY =(40:21,10,PD,TO=ZD,LENGTH=15)
SUM FIELDS=(40,15,ZD)
You've ignored the suggestion to trace intermediate results....
For ZD format, you can use only the first positions from the result of DIV, and ignore the rest of it.
For instance, use another BUILD=(...truncated field(s) …) in OUTFIL.
Other ways are also possible.