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

Count the number of records in a file using SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 5:31 am
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: 1208
Location: Bangalore,India

PostPosted: Mon Mar 19, 2007 10:10 am
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
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

Moderator Emeritus


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

PostPosted: Wed Mar 21, 2007 2:44 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts To get the count of rows for every 1 ... DB2 3
Search our Forums:

Back to Top