IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Release quantity that was allocated via LIKE= subparm


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Auryn

New User


Joined: 11 Jan 2006
Posts: 84
Location: Lower Saxony (DE)

PostPosted: Thu May 18, 2017 6:02 pm
Reply with quote

Hi there,

the LIKE= subparm is quite comfortable to allocate the result dataset similar to its source.
But i.e. when sorting the source using an include condition to filter most of the source rows there is lots of allocated space remaining that at the end is unused. And so I'ld like to release the space like I do when using i.e. SPACE=(TRK,(999,111),RLSE).
I tried some variants of SPACE=(,,RLSE) but was not successful.
Has anybody got a solution for my queston?

Thank you very much
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu May 18, 2017 6:24 pm
Reply with quote

I suspect what you want to do is not possible unless you explicitly code the SPACE parameter in the job creating the new data set. From the JCL Reference manual (emphasis added by me):
Quote:
Use the LIKE parameter to specify the allocation attributes of a new data set by copying the attributes of a model data set, which must be an existing cataloged data set and reside on a direct access volume.
The following attributes are copied from the model data set to the new data set:

Data set organization
Record organization (RECORG) or
Record format (RECFM)
Record length (LRECL)
Key length (KEYLEN)
Key offset (KEYOFF)
Type, PDS, PDSE, basic format, extended format, large format, or HFS (DSNTYPE)
Space allocation (AVGREC and SPACE)

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. Note that regardless of the units in which the model data set was allocated, the new data set will be allocated in tracks. This assumes that space was not specified on the JCL and is being picked up from the model data set.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Thu May 18, 2017 6:28 pm
Reply with quote

In stead of LIKE, try using DCB=*.existing-dd-name, with SPACE=(TRK,(999,111),RLSE).
Code:
//SYSUT1   DD DSN=TEST.DATASET.OLD,DISP=SHR
//SYSUT2   DD DSN=TEST.DATASET.NEW,DISP=(,CATLG,DELETE),
//            UNIT=TSO,SPACE=(0,(50,60),RLSE),
//            DCB=*.SYSUT1
Back to top
View user's profile Send private message
Auryn

New User


Joined: 11 Jan 2006
Posts: 84
Location: Lower Saxony (DE)

PostPosted: Fri May 19, 2017 1:39 pm
Reply with quote

Sorry, maybe my question was a bit ambiguous:

I know I can 'overwrite' the space quantities taken from the referred source dataset by specifying i.e. SPACE=(TRK,(999,111),RLSE).
But I don't want to think about probable quantities of the results. The only thing I know is that the maximum quantity works.
This is why I'm asking for a someting like SPACE=(,,RLSE):
"Dear system, please start allocating the output dataset using the quantities given from the referred dataset and when finished successfully release the unused space..."
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Fri May 19, 2017 8:55 pm
Reply with quote

You could open a PMR with IBM to verify, but I don't think you can release the unused space when allocating with LIKE. The JCL Reference manual is clear about how LIKE allocates space, but says nothing about LIKE releasing unused space.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Sat May 20, 2017 2:20 pm
Reply with quote

RLSE as specified in the DD statement SPACE parameter is not a data set attribute.

In order for space release to occur through JCL two things must happen.
  • You must specify RLSE on the DD statement AND
  • the program that uses the DD statement MUST open the data set for output

In this JCL --
Code:
//CREATE  EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  -- Input data --
//SYSUT2   DD  DISP=(NEW,CATLG),...,SPACE=(CYL,(50,20)),DSN=---
//SYSIN    DD  DUMMY
//RLSE    EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DUMMY,DCB=---
//SYSUT2   DD  DISP=MOD,SPACE=(CYL,(0,0),RLSE),DSN=---
//SYSIN    DD  DUMMY

The CREATE step builds a data set, but it does not free unused space at the end of the data set. The RLSE step frees the unused space. It can be run as a step in a different job run after the job that created the data set.
  • In the SYSUT1 DD statement the DCB parameter specifies a data set that has the same DCB attributes as the data set you are freeing space. This ensures IEBGENER will not accidentally alter the DCB attributes of the data set specified by the SYSUT2 DD statement. The data set can be the same data set specified by the SYSUT2 DD statement.
  • In the SYSUT2 DD statement, DISP=MOD directs data management to add additional data to the end of the data set.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 592
Location: London

PostPosted: Mon Sep 18, 2017 4:40 pm
Reply with quote

You may be able to code an appropriate Management Class (MGMTCLAS) in your JCL that will force release of the unused space. You'll need to ask your Storage Admin people if there is such a Mgmtclas available and if it will be accepted and not overridden by the SMS ACS routines. You want one that provide YES_IMMED or COND_IMMED.

Mgmtclas Release can occur in different ways:

YES Release unused space automatically during the
Space Management cycle.

CONDITIONAL Unused space can be released automatically only
if a secondary allocation exists for the data set.

YES IMMED Release unused space when a data set is closed or during
the Space Management cycle, whichever comes first.

COND IMMED Unused space for data sets with secondary allocation is
released either when a data set is closed or during the
Space Management cycle, whichever comes first.

NO Do not release unused space.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts Allocated cylinders of a dataset DB2 12
No new posts Mass JCL release via IDZ tool(eclipse... CA Products 1
No new posts Allocated space calculation from DCOL... PL/I & Assembler 3
No new posts REXX allocated datasets in JCL CLIST & REXX 9
Search our Forums:

Back to Top