IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Get the record count of SORTOUT file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Sep 03, 2009 8:33 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Sep 03, 2009 9:07 am
Reply with quote

Hi,

this topic should be moved to JCL.

DFSORT does NOT support XSUM.


Gerry
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Sep 03, 2009 6:35 pm
Reply with quote

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
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Sep 03, 2009 6:55 pm
Reply with quote

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. icon_cool.gif
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Sep 03, 2009 7:21 pm
Reply with quote

Thank you Ramsri, let me give a try. icon_smile.gif
Back to top
View user's profile Send private message
viveksurya

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Fri Sep 04, 2009 12:58 pm
Reply with quote

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
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Mon Sep 07, 2009 3:23 pm
Reply with quote

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
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Mon Sep 07, 2009 3:42 pm
Reply with quote

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
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Mon Sep 07, 2009 3:49 pm
Reply with quote

i got it icon_lol.gif icon_biggrin.gif .

Thank you all,
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Sep 08, 2009 8:27 pm
Reply with quote

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
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Tue Sep 08, 2009 9:08 pm
Reply with quote

Yes. first i used M11 later i modified it as

Code:

OUTFIL FILES=01,TRAILER1=(COUNT=(EDIT=(TTTTTT))),NODETAIL,REMOVECC
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts WER247A SORTOUT HAS INCOMPATIBLE LRECL SYNCSORT 7
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top