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 Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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