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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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