All,
I have a requirement which I googled and tried my best to solve. still I am in mid-way.
I have a input file with date field and two more packed decimal fields. Then I have to separate out records with date field GE to 01/01/2016.
In the output file I want all matching records and one more trailer record below with 4 fields.
1. Count of records matching date criteria
2. Sum of 1st packed decimal field
3. Sum of 2nd packed decimal field
4. (Sum of 1st field ×100)/sum of 2nd field.
What I have done as of now:
I have successfully created an output file with all matching records and one trailer record with first 3 fields.I am not able to calculate and populate 4th field in my output file using sort.
Can anyone please advise on this?
it would be a great help. Thanks for your assistance in advance.
Regards,
Manas
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(69,10,CH,GE,C'2016/01/01',AND,
79,10,CH,EQ,C' '),
REMOVECC,
TRAILER1=(1:'T',7:'XXXXXXXXX',
32:TOT=(100,10,PD,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(,-,,)),
64:TOT=(110,10,PD,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(,-,,)),
86:'RECORD COUNT=',100:COUNT=(M10,LENGTH=10))
OUTFIL FILES=02,
OMIT=(69,10,CH,GE,C'2016/01/01',AND,
79,10,CH,EQ,C' ')