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

Creating an Empty version of GDG


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

New User


Joined: 12 Sep 2005
Posts: 20
Location: USA

PostPosted: Tue Jan 16, 2007 3:41 am
Reply with quote

Hi,

I have the following Requirement.

One version of GDG would be created every month and at the end of the year, there would be 12 generations. The next year beginning I would need to delete all the versions created for the previous year and create a dummy version of the GDG on january 1st.

For deleting all the version I can use Idcams and specify
DEL (PLI0.DZC120WK.EXTRACT.*) which will delete all the existing versions of GDG without affecting the base.

How do I create a Dummy version of gdg after the above step is accomplished ?

Thanks for your replies.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jan 16, 2007 4:09 am
Reply with quote

Anu, this is all you need to do to delete all gens and create a dummy gen (empty)

Code:

//JS00100 EXEC PGM=IEFBR14
//DELDSN  DD  DSN=PLI0.DZC120WK.EXTRACT,    GDG BASE, delete all gens
//            DISP=(OLD,DELETE,KEEP)
//DMMYDSN DD  DSN=PLI0.DZC120WK.EXTRACT(+1),
//            DISP=(,CATLG,DELETE),
//            SPACE=...
//            DCB=(...
Back to top
View user's profile Send private message
balajiofcrrcoe

New User


Joined: 07 Jul 2005
Posts: 41
Location: chennai

PostPosted: Tue Jan 16, 2007 3:05 pm
Reply with quote

Hi

Try using Fastdel which will delete all the versions of the file

//FASTDEL EXEC PGM=FASTDEL
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
filename
/*

and then create empty version of the file using IEFBR14 based on conditional execution of the above step


Naga.
Back to top
View user's profile Send private message
Anu Narayanan

New User


Joined: 12 Sep 2005
Posts: 20
Location: USA

PostPosted: Wed Jan 17, 2007 3:07 am
Reply with quote

Hi David,

Thanks for your reply. Can IEFBR14 be still used to create the GDG generations in tape? because when i used UNIT=C instead of UNIT=D, my job completes successfully, but i am not able to see any versions created. Whereas if i use UNIT=D for creating on disk, my job completes successfully as well as a new version of GDG is created.

Thanks for your reply
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 17, 2007 3:24 am
Reply with quote

Hello,

When IEFBR14 is used to "create" an empty dataset, it does not "really" create an empty dataset. It does allocate space on dasd and make a catalog entry.

A likely reason that the tape did not work was because there was no open/close issued against the new file - most tape management systems get their info from SMF open/close info and with IEFBR14 there is no open/close - just allocatoin and de-allocation.

If you "create" a new empty file with IEFBR14 you may have an open error in the program that tries to read it because there may be a dcb conflict.

Are you sure that you want an "empty" tape? If you create an empty file on dasd and the "real" files on tape, you should still be able to read them all with the gdg base name in your jcl.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jan 17, 2007 3:26 am
Reply with quote

Tapes are a different sort of animal....instead of IEFBR14 it looks like you'll have to use a utility that actually opens the output dataset. Try sort, idcams or gener, with zero input and see which one works (brighter people here would probably know but sometimes the chase is the adventure).

Bill
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jan 17, 2007 3:53 am
Reply with quote

dick scherrer wrote:
If you create an empty file on dasd and the "real" files on tape, you should still be able to read them all with the gdg base name in your jcl.
Good point Dick, I hadn't thought of that.
Another thing Anu, why is that first GDG necessary, do you have a job running before the first real one gets created that needs an empty one to go against?
Back to top
View user's profile Send private message
Anu Narayanan

New User


Joined: 12 Sep 2005
Posts: 20
Location: USA

PostPosted: Thu Jan 18, 2007 1:11 am
Reply with quote

Hi,

Thanks for your replies.

I need an Empty version becuase of the following reason.

My job A runs every month beginning creating one version. so at the end of December we would have 12 versions. every version would contain Year to date DATA.
Another job B uses the lastest version created by job A every month in addition to another file created in the same job B.
So when running Job B on January first, I do not want to use the version created by Job A which would contain previous year DATA.
So I need to empty all the versions of the GDg created by JOB A every year begininng and create an empty version so that my job B when looking for the latest version would still be able to find an empty GDG version.
Hope I am clear.
I am thinking of the DASD empty dataset creation as an option like David said.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 1:49 am
Reply with quote

Thanks for the info, I was just curious....
Back to top
View user's profile Send private message
jinal_mca

New User


Joined: 05 Jan 2007
Posts: 22
Location: Pune, India

PostPosted: Wed Jan 24, 2007 12:41 pm
Reply with quote

First of all while defining index of GDF specify ur limit to 12. Which wl store 12 versions.

When limit wl reach to delete all version specify EMPTY property in ur model.

c ya
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 24, 2007 7:12 pm
Reply with quote

Hello Jinal,

If i understood the original request, an "empty" version is needed - one file that IS cataloged and when read will immediately be at end of file.

I do not believe your post will accomplish that. It will cause the catalog entries to change but will NOT create an EOF dataset.
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 isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts Creating Unix Directory using COBOL i... COBOL Programming 2
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
Search our Forums:

Back to Top