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

Need to get record count from a JCL step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Fri Jun 05, 2009 4:42 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Jun 05, 2009 4:52 pm
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Jun 05, 2009 4:56 pm
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
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: 2481
Location: @my desk

PostPosted: Fri Jun 05, 2009 5:13 pm
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
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Jun 06, 2009 12:32 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top