Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Get the record count of SORTOUT file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Get the record count of SORTOUT file
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: 1703
Location: Australia

PostPosted: Thu Sep 03, 2009 9:07 am    Post subject:
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    Post subject:
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    Post subject: Reply to: record count.
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Get the record count of SORTOUT file
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts More than 1 Include criteria for sing... Roy Ware SYNCSORT 6 Wed Sep 13, 2017 11:45 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us