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
 

 

Need to get record count from a JCL step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Shaile

New User


Joined: 28 May 2009
Posts: 4
Location: Chennai

PostPosted: Fri Jun 05, 2009 4:39 pm    Post subject: Need to get record count from a JCL step
Reply with quote

Hi,
I have a COBOL program in JCL, let say STEP01. In this program I do not have logic to count the number of records. Now, is there a way I can get the count anywere from the Job in Spool e.g. Can I get the count from SYSOUT, SYSMSG or any where else from the JCL. I wonder if the record count is stored anywhere by defalut by MVS or OS (just a guess).

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

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2275
Location: @my desk

PostPosted: Fri Jun 05, 2009 4:42 pm    Post subject:
Reply with quote

Quote:
In this program I do not have logic to count the number of records
Include the logic to count the number of records.
Back to top
View user's profile Send private message
Shaile

New User


Joined: 28 May 2009
Posts: 4
Location: Chennai

PostPosted: Fri Jun 05, 2009 4:48 pm    Post subject:
Reply with quote

Hi Arun,

Thanks for quick reply.
I can not change the program now. Nor I can add any SORT or File-Aid step to get the count. All I have is Job in spool. I have to get the count which is used as input/output in that cobol program. Can you suggest something else?

Thanks,
Shailendra
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: Fri Jun 05, 2009 4:52 pm    Post subject:
Reply with quote

OK, so you are not allowed to change anything. Therefor you can not achieve the requirement.

Who on earth makes up these darn stupid requirements icon_evil.gif
Back to top
View user's profile Send private message
Shaile

New User


Joined: 28 May 2009
Posts: 4
Location: Chennai

PostPosted: Fri Jun 05, 2009 4:55 pm    Post subject:
Reply with quote

Hi Expat,
The program was made long time and we do not have source module with us. We are using only the load module. The file is so big we can not add another step like SORT or File-Aid as it will increase CPU time.
I wanted to know would the record count would be strored anywhere in MVS or OS like it keep in case of SORT and File-Aid.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8055
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jun 05, 2009 4:56 pm    Post subject:
Reply with quote

Are you talking about record count of an input file, or count of spooled lines -- I assume you're talking about an input file but you keep mentioning the job is spooled.

z/OS does not maintain a record count for a file anywhere that I'm aware of. If the file is sequential, you can approximate the record count by finding the number of blocks (assuming that's the allocation unit) and multiplying by the records per block. That is approximate because the last block may not be a full block, so your count could differ from the actual number of records in the file by almost a full block's worth of records. If the file is not sequential, you may be able to approximate the record count depending upon the type of file it is.
Back to top
View user's profile Send private message
Shaile

New User


Joined: 28 May 2009
Posts: 4
Location: Chennai

PostPosted: Fri Jun 05, 2009 5:02 pm    Post subject:
Reply with quote

Thanks Robert, it helps.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2275
Location: @my desk

PostPosted: Fri Jun 05, 2009 5:13 pm    Post subject:
Reply with quote

Quote:
The file is so big we can not add another step like SORT or File-Aid as it will increase CPU time
Shaile,

Did you try this already? If you're looking for an exact count, may be you'll have to add a sort step to do this. How big is your file? What's the RECFM/LRECL?
Back to top
View user's profile Send private message
Itanium

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Fri Jun 05, 2009 6:00 pm    Post subject:
Reply with quote

Shaile wrote:
Hi Expat,
The program was made long time and we do not have source module with us. We are using only the load module. The file is so big we can not add another step like SORT or File-Aid as it will increase CPU time.
I wanted to know would the record count would be strored anywhere in MVS or OS like it keep in case of SORT and File-Aid.


no gain without any pain. you might have to add a step to identify the exact record count.

Else check if any other jobs using the same dataset and see the possibility of getting the record count there. Make sure the dataset is not altered midway.
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: Sat Jun 06, 2009 12:32 am    Post subject:
Reply with quote

Hello,

Why is there a requirement at this late date to have a record count of this input file? What decisions might be made knowing this?

Is this file on dasd or "tape". If it is on dasd you can get close using the dcb info and the space allocated. If it is on tape, the tape management system will probably know the data volume.
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 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
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
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 Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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