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

Pass the count of records to the next step of Jcl


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Apr 26, 2007 12:32 pm
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
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: 1436
Location: Bangalore,India

PostPosted: Thu Apr 26, 2007 12:58 pm
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
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Apr 26, 2007 1:11 pm
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: 1436
Location: Bangalore,India

PostPosted: Thu Apr 26, 2007 1:31 pm
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: 8797
Location: Welsh Wales

PostPosted: Thu Apr 26, 2007 1:39 pm
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: 1436
Location: Bangalore,India

PostPosted: Thu Apr 26, 2007 2:11 pm
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 Developer


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

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

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

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


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 To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top