Page 1 of 1

Problems to allocate a dataset using LIKE

PostPosted: Sat Oct 24, 2015 1:20 am
by tivrfoa
Hi,

There's a policy where I work that they don't allow to use LIKE to allocate a dataset.
eg:
//SYSUT2    DD DSN=dataset2,
//          DISP=(,CATLG),                                           
//          LIKE=dataset1


Have you experienced some problems with this?
What bad can happen?
I read this page https://www-01.ibm.com/support/knowledg ... ddlike.htm, and I think it's related to this:
"Unless you explicitly code the SPACE parameter for the new data set, the system determines the space to be allocated for the new data set by adding up the space allocated in the first three extents of the model data set. Therefore, the space allocated for the new data set will generally not match the space that was specified for the model data set."
but I didn't understand what it means. :oops:

Thank you!

Re: Problems to allocate a dataset using LIKE

PostPosted: Sat Oct 24, 2015 3:11 am
by NicC
What don't you understand in that quote? It seems very straight-forward.

What could go wrong if you use LIKE is that the dataset that you are modelling the attributes on may change its attributes which could mean that the attributes for the dataset2 could now be wrong.

Re: Problems to allocate a dataset using LIKE

PostPosted: Sat Oct 24, 2015 3:30 am
by tivrfoa
NicC wrote:What could go wrong if you use LIKE is that the dataset that you are modelling the attributes on may change its attributes which could mean that the attributes for the dataset2 could now be wrong.

In my case that's exactly what I want: if the attributes of the model change (lrecl for instance), I want the new data set to also have the new attributes.
I'm just copying a data set.

NicC wrote:What don't you understand in that quote? It seems very straight-forward.

Reading more carefully I think I understood:
If the model has space = 5 with 3 extents (each = 1), the new data set would have a space = 8?

Here they told me that using LIKE can cause X37 abend...

Thank you.

Re: Problems to allocate a dataset using LIKE

PostPosted: Sat Oct 24, 2015 4:23 am
by BillyBoyo
Your calculation is not quite correct. You are a little confused about the word "extents".

Any extent is any individual space allocation the system has made to satisfy your request for space.

Primary space can take up to five extents. Say you allocate 100 cylinders, but contiguous space is only available in three extents: 50, 30 and 20. That's your primary space, using three extents.

Then there's secondary space. Say that is 20. Allocated as 15 and five. That's now five extents gone, and only 11 left for further secondary allocation.

In the example you quote, if the five cylinders was allocated as one extent, then the first three extents would add up to seven, not eight.

In my example, with sufficient contiguous space on the volume, the first three extents would total 140 cylinders. The minimum, for a successful allocation originally, would be 60 cylinders. (Primary space divided by five, maximum number of extents for primary).

Re: Problems to allocate a dataset using LIKE

PostPosted: Wed Oct 28, 2015 3:16 am
by tivrfoa
Thanks a lot BillyBoyo

BillyBoyo wrote:Your calculation is not quite correct. You are a little confused about the word "extents".

I thought extent meant the number of secondary space being used. :cry:

BillyBoyo wrote:In my example, with sufficient contiguous space on the volume, the first three extents would total 140 cylinders. The minimum, for a successful allocation originally, would be 60 cylinders. (Primary space divided by five, maximum number of extents for primary).

I didn't understand how you got 140 and 60. :roll:

Re: Problems to allocate a dataset using LIKE

PostPosted: Thu Oct 29, 2015 12:20 am
by BillyBoyo
An extent is just a lump of allocation. The primary space can take up to five extents. A single secondary allocation can take multiple extents. If your disk pack is short of contiguous space, you don't get as much space as you'd expect (because it is not available in large enough extents).

100 primary plus two secondary of 20 is 140 cylinders, in three extents.

If all the primary were allocated in 20 cylinder extents (100 cylinders, 20 cylinders per extent, five extents) the minimum space for the first three extents (largest free space is chosen first) is 60 cylinders - there would be a further two extents of 20 cylinders each.

So you have a range of space for the first three extents, which depends on contiguous space available on the pack.