How to find number of records can be present in PS file?



How to find number of records can be present in PS file?

Postby Praveen5526 » Wed Apr 25, 2012 12:40 pm

My requirement as below.
Space =( cyl , ( 10,10)) Disp= (Lrecl=80)

So how many records (maximum records) can be present in the ps file?
Praveen5526
 
Posts: 10
Joined: Sat Apr 21, 2012 6:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to find number of records can be present in PS file?

Postby enrico-sorichetti » Wed Apr 25, 2012 12:49 pm

depends on the blocksize...
and you want to know only for the primary or for the count for the max alloc primary+all secondary ?

for SDB the blksize in this case will be 27920, which means two records per track 15 tracks per cylinders,
up to You the rest of the math


here is an ISPF/REXX macro that will do the dirty for You
http://ibmmainframes.com/about55037.html
and here is another link with the theory behind
and the same REXX script for the PC Rexx implementation
http://ibmmainframes.com/about35906.html
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: How to find number of records can be present in PS file?

Postby Praveen5526 » Wed Apr 25, 2012 1:18 pm

Thanks enrico. I do not have blk size and have only LRECL. I want max alloc primary+sec. here it goes.

10+15*10 = 160
1 cyl = 15 tracks = 160* 15= 2400 tracks
1 track = 2 records = 2400* 2 = 4800 records

The max recoreds 4800 . Correct me if i m wrong.
Praveen5526
 
Posts: 10
Joined: Sat Apr 21, 2012 6:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to find number of records can be present in PS file?

Postby BillyBoyo » Wed Apr 25, 2012 1:50 pm

No, the two records enrico is talking about are the "blocks" he assumed, at optimal size, that you would be using.

If you use "unblocked" data, you can have many more records than "2" on the track, but you will be doing yourself a big disservice with IO. With enrico's value, a track can be read with two physical reads (deblocking being done in memory). With your unblocked records, that will take... lots longer, you work it out.

Unblocked 80 is a horrible thing to do to DASD....
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to find number of records can be present in PS file?

Postby Robert Sample » Wed Apr 25, 2012 4:34 pm

10+15*10 = 160
1 cyl = 15 tracks = 160* 15= 2400 tracks
1 track = 2 records = 2400* 2 = 4800 records

The max recoreds 4800 . Correct me if i m wrong.
You are wrong.

First, as BillyBoyo indicated, the mainframe only writes BLOCKS of data, so your count is off by a factor of over 300. (27920 / 80)
Second, a data set may take up to 5 extents to allocate the primary space and each extent counts against the 16 limit on a volume, so the secondary allocation could be as small as 11 extents.
Third, if the data set is on multiple volumes, you have to calculate the space for EACH volume. And data sets can be allocated on up to 59 volumes, so your calculation could be off by a factor of 59 in addition to being off by another factor of over 300.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: How to find number of records can be present in PS file?

Postby dick scherrer » Wed Apr 25, 2012 9:19 pm

Hello,

So how many records (maximum records) can be present in the ps file?
Why does this matter?

Usually the need is to know how much space some number of records will require. Rarely (if ever) is there a need to determine how many records some amount of space will hold. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to find number of records can be present in PS file?

Postby Praveen5526 » Thu Apr 26, 2012 11:41 am

Okay.Thanks for all ur suggestions. Actually It was asked in the inerview. just want to know it.
Praveen5526
 
Posts: 10
Joined: Sat Apr 21, 2012 6:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to find number of records can be present in PS file?

Postby dick scherrer » Thu Apr 26, 2012 9:04 pm

Hello,

When posting an interview question, you should post in the Interview Questions part of the forum. This topic has been moved.

This topic also had nothing to do with COBOL, so why post in the COBOL part of the forum?

As many of us believed this was a "real" question, time was wasted answering the "wrong thing". If we knew from the beginning this was an interview question, i suspect you would have gotten more useful answers more quickly. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to Interview Questions

 


  • Related topics
    Replies
    Views
    Last post