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
 
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

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