View previous topic :: View next topic
Author
Message
arvind.m Active User Joined: 28 Aug 2008Posts: 205 Location: Hyderabad
Hi
i am having a sort step as below
Code:
//STEP022 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=XXXX.SORT.DIFF
//SORTOUT DD DISP=(,CATLG,DELETE),DSN=XXXX.SORT.GOOD,
// UNIT=3390,SPACE=(TRK,(3500,1500),RLSE),
// LRECL=80,RECFM=FB
//SORTXSUM DD DISP=(,CATLG,DELETE),DSN=XXXX.DUP.GOOD,
// UNIT=3390,SPACE=(TRK,(3500,1500),RLSE),
// LRECL=80,RECFM=FB
//SYSIN DD *
SORT FIELDS=(1,5,ZD,A,7,7,ZD,A,15,7,ZD,A,23,14,ZD,A)
SUM FIELDS=NONE,XSUM
//*
can anyone tell me if we get the record counts of the file SORTOUT within the same step(STEP022) and i need to have that record count in a seperate file (different output file).
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
this topic should be moved to JCL.
DFSORT does NOT support XSUM.
Gerry
Back to top
arvind.m Active User Joined: 28 Aug 2008Posts: 205 Location: Hyderabad
Can anyone help me. I know that the count will be in SYSOUT but is it possible to write/capture the record count of file "SORTOUT" into another file.
Thanks,
Back to top
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
Please use below example and alter it to your need.....
Code:
//STEP0001 EXEC PGM=SORT
//SORTIN DD *
DDDD
BBBB
CCCC
AAAA
DDDD
CCCC
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTXSUM DD SYSOUT=*
//SORTOF01 DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,4,CH,A)
SUM FIELDS=NONE,XSUM
OUTFIL FILES=01,TRAILER1=('COUNT: ',COUNT=(M10)),NODETAIL,REMOVECC
HTH.
Back to top
arvind.m Active User Joined: 28 Aug 2008Posts: 205 Location: Hyderabad
Thank you Ramsri, let me give a try.
Back to top
viveksurya New User Joined: 08 Jun 2009Posts: 36 Location: Bangalore
Hi Arvind,
In case you are using SYNCSORT, here is the code:
Code:
000006 //S010 EXEC PGM=SORT
000007 //SYSOUT DD SYSOUT=*
000008 //SYSPRINT DD SYSOUT=*
000009 //SORTIN DD DSN=NBKOWJN.INSIGHT.FILE1,DISP=SHR
000010 //SORTOUT DD DSN=NBKOWJN.INSIGHT.COUN1,DISP=(NEW,CATLG,DELETE),
000011 // SPACE=(TRK,(2,16)),
000012 // DCB=(RECFM=FB,LRECL=80)
000013 //SORTXSUM DD DSN=NBKOWJN.INSIGHT.COUN2,DISP=(NEW,CATLG,DELETE),
000014 // SPACE=(TRK,(2,16)),
000015 // DCB=(RECFM=FB,LRECL=80)
000016 //SORTOF1 DD DSN=NBKOWJN.INSIGHT.COUN3,DISP=(NEW,CATLG,DELETE),
000017 // SPACE=(TRK,(2,16)),
000018 // DCB=(RECFM=FB,LRECL=8)
000019 //SYSIN DD *
000020 SORT FIELDS=(1,8,ZD,A)
000021 SUM FIELDS=NONE,XSUM
000022 OUTFIL FILES=1,OUTREC(1:SEQNUM,8,ZD)
000023 /*
000024 //
The outfil file contains the record counts in the SORTOUT file. But if the count is n, it will have n records...each record having its SEQNUM.
Back to top
arvind.m Active User Joined: 28 Aug 2008Posts: 205 Location: Hyderabad
Hi Vivek,
the above code will not give the record count. I just need the record count in the OUTFILE01 (only one record which is record count).
thanks,
Back to top
arvind.m Active User Joined: 28 Aug 2008Posts: 205 Location: Hyderabad
Hi Ramsri,
i have modified you sort card to have only the record count in the OUTFIL
Code:
OUTFIL FILES=01,TRAILER1=(1:COUNT),NODETAIL,REMOVECC
but i'm getting the output as
Code:
---+----1--
***********
16079
***********
can we use JFY=(SHIFT=LEFT) to left justify the record count (should start from col1)?
are the blank spaces are inserted in the beginning...if yes, then it is ok to have zeros insted of blannk spaces.
thanks,
Back to top
arvind.m Active User Joined: 28 Aug 2008Posts: 205 Location: Hyderabad
i got it .
Thank you all,
Back to top
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
You would want to modify the sort card as given below instead:
Code:
OUTFIL FILES=01,TRAILER1=(1,COUNT=(M11)),NODETAIL,REMOVECC
HTH.
Back to top
arvind.m Active User Joined: 28 Aug 2008Posts: 205 Location: Hyderabad
Yes. first i used M11 later i modified it as
Code:
OUTFIL FILES=01,TRAILER1=(COUNT=(EDIT=(TTTTTT))),NODETAIL,REMOVECC
Back to top
Please enable JavaScript!