minimum primary and secondary quantity of storage required

Other Mainframe related questions which attracts you and there is no suitable Forum you find for it and related FAQs.
Post Reply
pinball
Registered Member
Posts: 32
Joined: Sun Jul 07, 2013 1:28 am
India

minimum primary and secondary quantity of storage required

Post by pinball »

It may be a very basic question. But I would like to know the answer of the following question:

I want to create a PS file which will contain 100000 lines of records. What is the minimum primary and secondary quantity I should use for that...?
User avatar
zum13
Registered Member
Posts: 97
Joined: Thu May 04, 2023 12:58 am

Re: minimum primary and secondary quantity of storage required

Post by zum13 »

Hello.

It would depend on your record length and whether the records were fixed length or variable.

A DASD volume is laid out in tracks and cylinders. For example, a 3390 model 3 has 3339 cylinders with each cylinder consisting of 15 tracks. Each track, for a 3390, is 56664 bytes long. The tracks are then broken up into records, but the records do not have a fixed size and do not necessarily correspond to the records in your file.

Under z/OS, the records on a DASD are usually "blocks". Each block will contain a number of what the user and programs will see as records. This is where the BLKSIZE parameter you see in JCL comes from. The block size will be divisible by the record length you specify when you create your dataset (the LRECL). For example, if we were talking 80-byte records with a block size of 6160, then each block would contain 77 records. You could get 9 of these blocks onto one track (56664 divided by 6160) which means a track would hold 693 records (9 times 77) and a cylinder would hold 10395 records (693 times 15). Change the record length or the block size, and you get different results. Change the device to a 3380, and the track size and track counts are different, so you'd get a different result again.

A good rule of thumb is to take your record length, divide 56664 by it and take the integer as the maximum number of records per track. You can then divide your record count by that value to give an approximate number of tracks to allocate, or you can divide that track count by 15 to give cylinders. An alternative method is to go to ISPF option 3.2, and allocate the dataset in megabytes or gigabytes and see what it actually allocates as the panel will take values specified that way.

As for primary and secondary, when you allocate a dataset, the primary quantity is the only part allocated on the disk. If, as a result of writing to that dataset, you attempt to exceed the amount of space allocated to the primary extent, the system will automatically allocate a secondary extent. Fill that, and it will add another secondary. For each volume, a dataset can have a maximum of 15 secondary extents, however, a dataset can span multiple volumes which means it's 15 times the number of volumes you specify it can extend over.

Usually, you allocate the primary to be based on the amount of data you expect to be handling with the secondary being how much to add if you exceed that. In most cases, you basically treat the secondary as an overflow to be used when you're processing a larger than usual volume of data.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1898
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: minimum primary and secondary quantity of storage required

Post by Robert Sample »

You could get 9 of these blocks onto one track (56664 divided by 6160)
This is not accurate as there is system overhead as well.  Manual GX26-4577 has the details for 3390 devices and it shows only 8 blocks of size 6160 will fit on a track.
User avatar
zum13
Registered Member
Posts: 97
Joined: Thu May 04, 2023 12:58 am

Re: minimum primary and secondary quantity of storage required

Post by zum13 »

Oops! Yes, forgot about the overheads. My copy of GX26-4577 is buried in a box somewhere!
pinball
Registered Member
Posts: 32
Joined: Sun Jul 07, 2013 1:28 am
India

Re: minimum primary and secondary quantity of storage required

Post by pinball »

zum13Hello.

It would depend on your record length and whether the records were fixed length or variable.

A DASD volume is laid out in tracks and cylinders. For example, a 3390 model 3 has 3339 cylinders with each cylinder consisting of 15 tracks. Each track, for a 3390, is 56664 bytes long. The tracks are then broken up into records, but the records do not have a fixed size and do not necessarily correspond to the records in your file.

Under z/OS, the records on a DASD are usually "blocks". Each block will contain a number of what the user and programs will see as records. This is where the BLKSIZE parameter you see in JCL comes from. The block size will be divisible by the record length you specify when you create your dataset (the LRECL). For example, if we were talking 80-byte records with a block size of 6160, then each block would contain 77 records. You could get 9 of these blocks onto one track (56664 divided by 6160) which means a track would hold 693 records (9 times 77) and a cylinder would hold 10395 records (693 times 15). Change the record length or the block size, and you get different results. Change the device to a 3380, and the track size and track counts are different, so you'd get a different result again.

A good rule of thumb is to take your record length, divide 56664 by it and take the integer as the maximum number of records per track. You can then divide your record count by that value to give an approximate number of tracks to allocate, or you can divide that track count by 15 to give cylinders. An alternative method is to go to ISPF option 3.2, and allocate the dataset in megabytes or gigabytes and see what it actually allocates as the panel will take values specified that way.

As for primary and secondary, when you allocate a dataset, the primary quantity is the only part allocated on the disk. If, as a result of writing to that dataset, you attempt to exceed the amount of space allocated to the primary extent, the system will automatically allocate a secondary extent. Fill that, and it will add another secondary. For each volume, a dataset can have a maximum of 15 secondary extents, however, a dataset can span multiple volumes which means it's 15 times the number of volumes you specify it can extend over.

Usually, you allocate the primary to be based on the amount of data you expect to be handling with the secondary being how much to add if you exceed that. In most cases, you basically treat the secondary as an overflow to be used when you're processing a larger than usual volume of data.
Hi zum13 - Thanks for this explanation, this is really helpful. One of my senior told me that we can do these calculations but our company is using SMS, so we don't really need to get into these calculations? What is correct way of doing it then?
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 832
Joined: Wed Sep 11, 2013 3:57 pm

Re: minimum primary and secondary quantity of storage required

Post by enrico-sorichetti »

What is correct way of doing it then?

there are a few ways of doing it, all of them technically correct,

since we do not know anything about your organizations standards 
any answer we might give could be wrong

keep talking to your senior to find out your organization recommended way
 
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 8-)
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Other Mainframe Topics, Off-Topics, FAQs.”