Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Count the number of records in a file using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nitinkhobragade1

New User


Joined: 07 Mar 2006
Posts: 16

PostPosted: Mon Mar 19, 2007 4:59 am    Post subject: Count the number of records in a file using SYNCSORT
Reply with quote

Hi,

I want to count the number of records in a file and put that count in an output file.The output file should have only one record mentioning the record count.

The records format should be:

'The total number of records in the input file is:' count.

How can i do this using Syncsort?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 5:31 am    Post subject:
Reply with quote

I think yes.
Infil a constant of one.
Sum on that constant.
Outfil reformatting the summed total into your phrase.
Have you checked your manual for the specifics?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Mon Mar 19, 2007 10:10 am    Post subject:
Reply with quote

Hi there,

You can use following sort card to find number of records
Code:
//SYSIN    DD  *                             
   INREC FIELDS=(1,80,SEQNUM,8,ZD)           
   SORT FIELDS=(81,8,ZD,D)                   
   OUTFIL FILES=1,ENDREC=1,OUTREC(81,8,80:X)
/*   


Its not the optimized one but u will get result
Back to top
View user's profile Send private message
nitinkhobragade1

New User


Joined: 07 Mar 2006
Posts: 16

PostPosted: Wed Mar 21, 2007 2:21 am    Post subject:
Reply with quote

Hi Ekta,

I have used your control card in the below jcl but the job is abending with maxcc=16

Code:

//STEP0110  EXEC PGM=SYNCSORT                   
//SORTIN    DD DSN=TEST.RPT.FILE22,     
//             DISP=SHR                         
//SORTOUT   DD DSN=TEST.RPT.FILE24,     
//             DISP=(NEW,CATLG,DELETE),         
//             UNIT=SYSALLDA,                   
//             DATACLAS=MEDIUM1,                 
//             DCB=(LRECL=90,RECFM=FB,BUFNO=25) 
//SYSIN    DD  *                                 
     INREC FIELDS=(1,80,SEQNUM,8,ZD)             
     SORT FIELDS=(81,8,ZD,D)                     
     OUTFIL FILES=1,ENDREC=1,OUTREC(81,8,80:X)   
/*                                               
//SYSPRINT DD SYSOUT=*                           
//SYSOUT   DD SYSOUT=*                           
//SYSUDUMP DD SYSOUT=*                           
//*


it is erroring "ALTERNATE PARM USED" "SORTOF1 NOT DEFINED"

could you please suggest me what need to be done?

Regards,
Nitin
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 21, 2007 2:44 am    Post subject:
Reply with quote

Hello,

This
Code:
OUTFIL FILES=1,ENDREC=1,OUTREC(81,8,80:X)
tells the sort to use SORTOF1.

If you change your SORTOUT DD to SORTOF1 DD or if you change the OUTFIL to FILES=OUT, i believe you will fix your problem. They need to be in sync.
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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us