My job has 2 datasets (random number have taken) as input, it has total of document and total of sheet. I have to print below:
1. jobs name in which these datasets are processed
2. Total of document count
3. Total of sheet count
4. Total of document and sheet
5. Total number of job
Above will be confusing so giving below for reference:
Dataset1:
JOBNAME1_07052017_20170705234939.txt |0023301|Y|00098702|
Dataset2:
JOBNAME_07052017_20170705234939.txt |0023301|Y|00098702|
Output dataset should have:
JOBNAME DOCUMENT COUNT SHEET COUNT
------- -------------- -----------
JOBNAME1 23,301 98,702
JOBNAME 1 1
TOTALS 23,302 98,703
TOTAL NUMBER OF JOBS = 2
------- -------------- -----------
JOBNAME1 23,301 98,702
JOBNAME 1 1
TOTALS 23,302 98,703
TOTAL NUMBER OF JOBS = 2
I am getting proper result in 3 step:
Step1:
OPTION COPY
OUTFIL REMOVECC,
HEADER1=(1:' CCC930',21:'xxxxxxxxxxxxxxxxxxxxxxxxxxx ',
49:10X,59:'DATE : ',66:&DATE,1/,1/,
1:' JOBNAME',20:'DOCUMENT COUNT',45:'SHEET COUNT',1/,
1:' -------',20:'--------------',45:'-----------')
OUTREC FIELDS=(2:18,8,10:14X,25:61,7,ZD,EDIT=(I,III,IIT),
34:12X,46:71,8,ZD,EDIT=(II,III,IIT),56:25X)
INREC FINDREP=(IN=C'_',OUT=C' ')
OUTFIL REMOVECC,
HEADER1=(1:' CCC930',21:'xxxxxxxxxxxxxxxxxxxxxxxxxxx ',
49:10X,59:'DATE : ',66:&DATE,1/,1/,
1:' JOBNAME',20:'DOCUMENT COUNT',45:'SHEET COUNT',1/,
1:' -------',20:'--------------',45:'-----------')
OUTREC FIELDS=(2:18,8,10:14X,25:61,7,ZD,EDIT=(I,III,IIT),
34:12X,46:71,8,ZD,EDIT=(II,III,IIT),56:25X)
INREC FINDREP=(IN=C'_',OUT=C' ')
Step2:
OUTFIL REMOVECC,NODETAIL,
TRAILER2=(2:'TOTALS ',10:14X,25:TOT=(61,7,ZD,EDIT(I,III,IIT)),
34:12X,46:TOT=(71,8,ZD,EDIT(II,III,IIT)),56:25X),
TRAILER1=(1/,1:' TOTAL NUMBER OF JOBS = ',25:COUNT)
TRAILER2=(2:'TOTALS ',10:14X,25:TOT=(61,7,ZD,EDIT(I,III,IIT)),
34:12X,46:TOT=(71,8,ZD,EDIT(II,III,IIT)),56:25X),
TRAILER1=(1/,1:' TOTAL NUMBER OF JOBS = ',25:COUNT)
Step3:
SORT FIELDS=COPY
END
END
When I am trying to keep both header and trailer in same sort card I am getting incorrect value in TRAILER2.
OPTION COPY
OUTFIL REMOVECC,
HEADER1=(1:' CCC930',21:'XXXXXXXXXXXXXXXXXXXXXXXXXXX ',
49:10X,59:'DATE : ',66:&DATE,1/,1/,
1:' JOBNAME',20:'DOCUMENT COUNT',45:'SHEET COUNT',1/,
1:' -------',20:'--------------',45:'-----------'),
TRAILER2=(2:'TOTALS ',10:14X,25:TOT=(61,7,ZD,EDIT(I,III,IIT)),
34:12X,46:TOT=(71,8,ZD,EDIT(II,III,IIT)),56:25X),
TRAILER1=(1/,1:' TOTAL NUMBER OF JOBS = ',25:COUNT)
OUTREC FIELDS=(2:18,8,10:14X,25:61,7,ZD,EDIT=(I,III,IIT),
34:12X,46:71,8,ZD,EDIT=(II,III,IIT),56:25X)
INREC FINDREP=(IN=C'_',OUT=C' ')
OUTFIL REMOVECC,
HEADER1=(1:' CCC930',21:'XXXXXXXXXXXXXXXXXXXXXXXXXXX ',
49:10X,59:'DATE : ',66:&DATE,1/,1/,
1:' JOBNAME',20:'DOCUMENT COUNT',45:'SHEET COUNT',1/,
1:' -------',20:'--------------',45:'-----------'),
TRAILER2=(2:'TOTALS ',10:14X,25:TOT=(61,7,ZD,EDIT(I,III,IIT)),
34:12X,46:TOT=(71,8,ZD,EDIT(II,III,IIT)),56:25X),
TRAILER1=(1/,1:' TOTAL NUMBER OF JOBS = ',25:COUNT)
OUTREC FIELDS=(2:18,8,10:14X,25:61,7,ZD,EDIT=(I,III,IIT),
34:12X,46:71,8,ZD,EDIT=(II,III,IIT),56:25X)
INREC FINDREP=(IN=C'_',OUT=C' ')
please help to get this done in single step.
Thanks,
aakumari