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
 

 

Is there any syntax in COBOL to find the record count of a P

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
i_mishra

New User


Joined: 25 Aug 2006
Posts: 1

PostPosted: Fri Aug 25, 2006 11:15 am    Post subject: Is there any syntax in COBOL to find the record count of a P
Reply with quote

Is there any syntax in COBOL to find the record count of a PS file without reading it?
Back to top
View user's profile Send private message

shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Fri Aug 25, 2006 12:18 pm    Post subject:
Reply with quote

hi,

There is no way to read the record count in cobol unless you go thru the entire file.

But there should be a way to calculate the number of records in the file by its size divided by the record lenght.
Guys any idea??

~Vamsi
Back to top
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Fri Aug 25, 2006 12:37 pm    Post subject: Calculating the number of records
Reply with quote

The number of records of a file in DASD is calculated by the following formula
(no: of tracks * 56664)/LRECL of the file = number of records.
No: of tracks allocated to the file can be found out by giving an S next to the dataset in the selection panel
56664 is the number of bytes in a Track
LRECL is the record length of the file.

If the file is in TAPE, then
number of records = (block size * block count)/LRECL
This is an approximate number because the last block mite not be full.

Hope this is helpful... icon_wink.gif
Back to top
View user's profile Send private message
kondakonda

New User


Joined: 20 Mar 2006
Posts: 34

PostPosted: Fri Aug 25, 2006 2:40 pm    Post subject: Re: Is there any syntax in COBOL to find the record count of
Reply with quote

This formula will give only how many records the ps file can accomodate, not the actual number of records in the file.

The number of records of a file in DASD is calculated by the following formula
(no: of tracks * 56664)/LRECL of the file = number of records.
Back to top
View user's profile Send private message
pretty
Currently Banned

New User


Joined: 13 Mar 2006
Posts: 6

PostPosted: Fri Aug 25, 2006 3:15 pm    Post subject: i want to know focus in mainframes or cobol
Reply with quote

can anyone send me quick reply i am waiting for your reply

yours
siva
Back to top
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Fri Aug 25, 2006 5:05 pm    Post subject:
Reply with quote

Another method is to write a sort and sort the file by one of the fields in the file. The number of records input and output from the sort step will be mentioned in the sort message.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
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
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm


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