Problems to allocate a dataset using LIKE



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Problems to allocate a dataset using LIKE

Postby tivrfoa » Sat Oct 24, 2015 1:20 am

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!
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: Problems to allocate a dataset using LIKE

Postby NicC » Sat Oct 24, 2015 3:11 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
tivrfoa (Sat Oct 24, 2015 3:13 am)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Problems to allocate a dataset using LIKE

Postby tivrfoa » Sat Oct 24, 2015 3:30 am

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.
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: Problems to allocate a dataset using LIKE

Postby BillyBoyo » Sat Oct 24, 2015 4:23 am

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).

These users thanked the author BillyBoyo for the post:
tivrfoa (Sat Oct 24, 2015 4:57 am)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Problems to allocate a dataset using LIKE

Postby tivrfoa » Wed Oct 28, 2015 3:16 am

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:
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: Problems to allocate a dataset using LIKE

Postby BillyBoyo » Thu Oct 29, 2015 12:20 am

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.

These users thanked the author BillyBoyo for the post:
tivrfoa (Thu Oct 29, 2015 12:24 am)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post