MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Releasing space in an empty dataset

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
HP_Steve
Beginner


Joined: 09 Jul 2008
Posts: 6
Topics: 3

PostPosted: Fri Oct 30, 2009 2:11 pm    Post subject: Releasing space in an empty dataset Reply with quote

Hi,

I am using the partial release RLSE sub-parameter in my space allocation for sequential datasets. I have two datasets I am creating. I allocate both with these parms:-
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=32756,BLKSIZE=32760,
// RECFM=VB,DSORG=PS),
// SPACE=(CYL,(5,1),RLSE),AVGREC=U

File 1 is written to, and if I don't use 5 cylinders, the space is de-allocated as expected.
File 2 is empty, but at the end of the job, the space allocation remains at 5 cylinders. I guess maybe this is because the program, (which I don't control), did not open it for writing. Is there any other JCL parm I can use that will de-allocate the space, when the file is empty?
I don't know in advance of the job submission if the dataset will remain empty or not.
Thanks,
Steve.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Oct 30, 2009 2:33 pm    Post subject: Reply with quote

HP_Steve,

You can add a IEFBR14 step to release the unused space

Code:

//LASTSTEP EXEC PGM=IEFBR14           
//OUT1     DD DSN=your output file1, 
//            DISP=(MOD,CATLG,CATLG),
//            SPACE=(TRK,(1,0),RLSE) 
//*
//OUT2     DD DSN=your output file2, 
//            DISP=(MOD,CATLG,CATLG),
//            SPACE=(TRK,(1,0),RLSE) 

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Oct 30, 2009 3:06 pm    Post subject: Reply with quote

Why would running a BR14 step release the space? Isn't the freeing of the space done when the data set is closed? (I haven't tried this, so I'm not saying it doesn't work)
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Fri Oct 30, 2009 4:20 pm    Post subject: Reply with quote

The IEFBR14 method didn't work for me.

I have used SPACE=(TRK,(1,90),RLSE) so the unopened file is only 1 track.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Fri Oct 30, 2009 6:23 pm    Post subject: Reply with quote

If the file does not need to exist if empty, you could check for an empty file and delete it if empty as the last step of the job.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Fri Oct 30, 2009 8:17 pm    Post subject: Reply with quote

I'm not sure that any test for "emtpy" would actually "work" for a dataset that was never opened/closed, since there is no way to guarantee that the dataset could be successfully 'opened" and/or "read" in order to determine whether any records exist in the dataset or not.
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Oct 30, 2009 9:41 pm    Post subject: Reply with quote

You can also allocate it as SPACE=(TRK,(0,1)) (with RLSE optional) and if it never gets opened, no space will be allocated.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Sat Oct 31, 2009 9:37 am    Post subject: Reply with quote

If the SMS ACS routines are set up correctly, then HSM will release any unused space during the secondary space management cycle.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sat Oct 31, 2009 12:04 pm    Post subject: Reply with quote

semigeezer,

I remember that If the shop is SMS managed then IEFBR14 will set the EOF marker which would release the space

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sat Oct 31, 2009 5:26 pm    Post subject: Reply with quote

I *think* DADSM would only write an EOF mark on the initial allocation but since the data set already exists, it won't do that. But then again, if writing the initial EOF would release space upon allocation, then I'd think space would get released before the program ever got control since the allocations (and EOF mark) happen before the program gets called. DS1LSTAR could get updated in the DSCB but the space allocation should not change. I don't really know much about it though so it is all speculation on my part.

Just for completeness (Kolusu, I know you know this- I mention it only for passing readers), I'll mention that IEFBR14 doesn't do anything at all, and that all of the allocations done for steps that run IEFBR14 or any other program are done by the system while starting or terminating a job step. It is misleading to say that IEFBR14 does <whatever> but it is a common practice and should be understood to mean JES or the JCL interpreter does <whatever>.

Someone please correct me here -- which component does the actual allocations? JES? JES2 at runtime, JES3 at interpret time? something like that.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sun Nov 01, 2009 11:31 am    Post subject: Reply with quote

Of course, the correct solution is to make the program open and close the dataset even if it is not going to be written to. Solves a number of other little nasties, ONCODE 41 (or is it 42?); allocating over an old dataset, or part thereof, of the same characteristics which could then be read (this happened to us so it became compulsory to open/close files); etc.

The other option is to not use IEFBR14 but write a little program that does nothing but open and close all files in the jobstep. I had 2 of those which worked slightly differently from each other.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
HP_Steve
Beginner


Joined: 09 Jul 2008
Posts: 6
Topics: 3

PostPosted: Tue Nov 03, 2009 12:57 pm    Post subject: Reply with quote

Thanks for the responses. Seems like there are a number of things I can try here.
Long term it seems I need the application fixed to always open and close the dataset - short term I can try some of the opther suggestions.
Thanks,
Steve.
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Wed Nov 04, 2009 2:55 am    Post subject: Reply with quote

Something that has not been mentioned yet is that RLSE will release any secondary extents, not the primary extent. Actually, I am wondering why this is even an issue for 5 cylinders???
Back to top
View user's profile Send private message Visit poster's website
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Wed Nov 04, 2009 11:29 am    Post subject: Reply with quote

Actually, the RLSE parameter WILL release unused space in the primary extent. If the space was allocated in tracks/blocks/recs/bytes, unused tracks will be released; if the space was allocated in cylinders, unused cylinders will be released.

It should be noted, however, that RLSE will only release unused space on the FIRST volume of a multi-volume dataset.
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Thu Nov 05, 2009 2:28 am    Post subject: Reply with quote

Thanks for the correction Ron.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group