View previous topic :: View next topic
|
Author |
Message |
i_mishra
New User
Joined: 25 Aug 2006 Posts: 1
|
|
|
|
Is there any syntax in COBOL to find the record count of a PS file without reading it? |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
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 |
|
|
annujp
New User
Joined: 31 Aug 2005 Posts: 39 Location: St Paul,MN
|
|
|
|
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... |
|
Back to top |
|
|
kondakonda
New User
Joined: 20 Mar 2006 Posts: 34
|
|
|
|
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 |
|
|
pretty Currently Banned New User
Joined: 13 Mar 2006 Posts: 6
|
|
|
|
can anyone send me quick reply i am waiting for your reply
yours
siva |
|
Back to top |
|
|
annujp
New User
Joined: 31 Aug 2005 Posts: 39 Location: St Paul,MN
|
|
|
|
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 |
|
|
|