View previous topic :: View next topic
|
Author |
Message |
Anu Narayanan
New User
Joined: 12 Sep 2005 Posts: 20 Location: USA
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
|
|
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 |
|
|
Anu Narayanan
New User
Joined: 12 Sep 2005 Posts: 20 Location: USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
Anu Narayanan
New User
Joined: 12 Sep 2005 Posts: 20 Location: USA
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Thanks for the info, I was just curious.... |
|
Back to top |
|
|
jinal_mca
New User
Joined: 05 Jan 2007 Posts: 22 Location: Pune, India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|