View previous topic :: View next topic
Author
Message
Vigneshwaran S Warnings : 1 New User Joined: 10 Dec 2008Posts: 60 Location: Chennai
Hi all,
I have Input dataset as shown below,
Code:
A 10
B 20
C 30
D 40
B 40
C 20
A 10
C 25
I would like to display my output report like this,
Code:
TOTAL COUNT FOR A : 20
TOTAL COUNT FOR B : 60
TOTAL COUNT FOR C : 75
TOTAL COUNT FOR D : 40
Can anyone suggest me a solution for this?
Back to top
Vigneshwaran S Warnings : 1 New User Joined: 10 Dec 2008Posts: 60 Location: Chennai
HI all,
LRECL = 80, RECFM = FB
First column starts in Position 1.
Second column starts in Position 3.
Back to top
hikaps14 Active User Joined: 02 Sep 2005Posts: 189 Location: Noida
Try using the below code:
Code:
//SYSIN DD *
OPTION ZDPRINT
SORT FIELDS=(1,1,CH,A)
SUM FIELDS=(3,2,ZD)
/*
Thanks,
-Kapil.
Back to top
hikaps14 Active User Joined: 02 Sep 2005Posts: 189 Location: Noida
use outrec to get the result in desired format.
Code:
OUTREC FIELDS=(C'TOTAL COUNT FOR ',1,1,X,C':',X,3,2,80:X)
Back to top
Vigneshwaran S Warnings : 1 New User Joined: 10 Dec 2008Posts: 60 Location: Chennai
Hi,
Im getting S0C7 abend for my below input,
Code:
HEADER1
HEADER2
HEADER3
A 100
B 30
C 3
A 217
B 3
C 100
A 1,234
B 9
C 24
I have never encountered S0C7 abend in DFSORT step.
After making 1,234 as 1234 and removing the header lines the code is working fine.
Can anyone explain why im getting S0C7 abend?and also solution to counter this.
This is my sort step,
Code:
OPTION ZDPRINT,SKIPREC=3
INCLUDE COND=(53,7,CH,NE,C' ')
SORT FIELDS=(53,47,CH,A)
SUM FIELDS=(124,8,ZD)
OUTREC FIELDS=(C'TOTAL EXCEPTIONS FOR ',53,47,X,C':',X,124,8,160:X)
My input LRECL = 160 and RECFM=FB
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
You're getting a S0C7 because 1,234 is not a valid ZD value. You could fix the suggested control statements by adding:
Code:
INREC OVERLAY=(124:124,8,UFF,TO=ZD,LENGTH=8)
Alternatively, you could use these DFSORT control statements:
Code:
OPTION ZDPRINT,SKIPREC=3
INCLUDE COND=(53,7,CH,NE,C' ')
SORT FIELDS=(53,47,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(53,47,
TRAILER3=(C'TOTAL EXCEPTIONS FOR ',53,47,' : ',
TOT=(124,8,UFF,M10,LENGTH=8)))
Back to top
Vigneshwaran S Warnings : 1 New User Joined: 10 Dec 2008Posts: 60 Location: Chennai
Hi all,
Thanks for Posting. Could you please suggest me how to include << END OF REPORT >> at the end of my output.
This is the sort step im using,
Code:
OPTION ZDPRINT,SKIPREC=5
INCLUDE COND=(53,7,CH,NE,C' ')
SORT FIELDS=(53,47,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(53,47,
TRAILER3=(C'TOTAL EXCEPTIONS FOR ',53,47,' : ',
TOT=(124,8,UFF,M10,LENGTH=8)))
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
Vigneshwaran S,
Just add the trailer1 parm at the end
Use the following control cards
Code:
//SYSIN DD *
OPTION ZDPRINT,SKIPREC=5
INCLUDE COND=(53,7,CH,NE,C' ')
SORT FIELDS=(53,47,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(53,47,
TRAILER3=(C'TOTAL EXCEPTIONS FOR ',53,47,' : ',
TOT=(124,8,UFF,M10,LENGTH=8))),
TRAILER1=(C'<< END OF REPORT >>')
//*
Back to top
Vigneshwaran S Warnings : 1 New User Joined: 10 Dec 2008Posts: 60 Location: Chennai
Hi,
Thanks!!! I was trying with Trailer1 parm but i forgot to include comma at the end of Trailer3
Back to top
Please enable JavaScript!