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
 

 

Pass the count of records to the next step of Jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
gekalpana

New User


Joined: 11 Apr 2007
Posts: 12
Location: Chennai

PostPosted: Thu Apr 26, 2007 12:29 pm    Post subject: Pass the count of records to the next step of Jcl
Reply with quote

Hi
I want to get the count of records present in a sequential file and pass it to the next step in the jcl .. is that possible ..?? If yes , please let me know how to achieve that ??

Thanks !!
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 26, 2007 12:32 pm    Post subject:
Reply with quote

You can use SORT, ICETOOL, IEBGENER to get a count of records, then you need to read the output to get the record count, and write it out.
Back to top
View user's profile Send private message
gekalpana

New User


Joined: 11 Apr 2007
Posts: 12
Location: Chennai

PostPosted: Thu Apr 26, 2007 12:54 pm    Post subject: Re: Pass the count of records to the next step of Jcl
Reply with quote

Without reading the output file is there any other way ??
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Apr 26, 2007 12:58 pm    Post subject:
Reply with quote

kalpana,
Quote:
Without reading the output file is there any other way ??

No
Back to top
View user's profile Send private message
gekalpana

New User


Joined: 11 Apr 2007
Posts: 12
Location: Chennai

PostPosted: Thu Apr 26, 2007 1:00 pm    Post subject: Re: Pass the count of records to the next step of Jcl
Reply with quote

Ok .. Thanks !!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 26, 2007 1:11 pm    Post subject:
Reply with quote

By output I meant the SYSOUT DD statement from DFSORT, or SYSPRINT from IEBGENER.

There is no need to actually copy the data with SORT / IEBGENER, you can use DD DUMMY for the SORTOUT / SYSUT2 statement.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Apr 26, 2007 1:31 pm    Post subject:
Reply with quote

Expat,

Actually you can get the record count only (not the data) into a file flat (not sysout) using DFSORT Trailer option. As Kalpana wanted to pass the record count to next step I guess this option is best (as sysout contains other data also and needs to be filtered for the count).
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 26, 2007 1:39 pm    Post subject:
Reply with quote

Yes, good point.
Will the count be in PD or character format ?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Apr 26, 2007 2:11 pm    Post subject:
Reply with quote

Quote:
Will the count be in PD or character format ?

Character.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Apr 26, 2007 9:26 pm    Post subject:
Reply with quote

The "Display the number of input or output records" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

shows how to use TRAILER1 to get one record with the count. The example gets the count as a ZD/CH value, but it can easily be changed to get the count as a PD value by using:

Code:

   ...
   TRAILER1=(COUNT=(TO=PD,LENGTH=8))
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 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
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm


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