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

counting number of records in file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kalpeshgala

New User


Joined: 08 Jul 2005
Posts: 4

PostPosted: Thu Sep 08, 2005 9:52 am
Reply with quote

Hi,

Is there anyway in JCL by which :-
in step 1) I can count number of records in the file (not just whether file is empty or not but actual count of records)
and in step 2) pass that count to program through parm in next step.

thanks.
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Thu Sep 08, 2005 10:02 am
Reply with quote

Hi Kalpesh,

Quote:
1) I can count number of records in the file (not just whether file is empty or not but actual count of records)
and in step


Yes you can count the number of records in File.Try this JCL

Code:
//SORTTST JOB (ACCT#),'SORT  ',NOTIFY=&SYSUID,CLASS=T,MSGCLASS=X       
//STEP01  EXEC PGM=SORT                                                 
//SYSOUT   DD   SYSOUT=*                                               
//SORTIN  DD DSN=Input file name,DISP=SHR                       
//SORTOUT DD DSN=outputfile.name,DISP=SHR                       
//SYSIN   DD *                                                         
  OPTION COPY                                                           
  OUTFIL REMOVECC,NODETAIL,                                             
   TRAILER1=(COUNT=(M10,LENGTH=02))                                     
/*                                                                     
//SYSUDUMP   DD SYSOUT=* 


Regards
Rupesh
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Thu Sep 08, 2005 10:37 am
Reply with quote

Try this:

Code:

//*                                                 
//COUNT EXEC PGM=ICETOOL                         
//*
//TOOLMSG    DD   SYSOUT=*                           
//DFSMSG     DD   SYSOUT=*                           
//*
//COUNT      DD   DSN=dataset name,
//               DISP=SHR
//*
//TOOLIN     DD   DATA                               
  COUNT FROM(COUNT)                                   
/*                                                 
//*


hope this helps.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
Search our Forums:

Back to Top