|
View previous topic :: View next topic
|
| Author |
Message |
Ranjanmainframe
New User
Joined: 16 Apr 2010 Posts: 3 Location: Chennai
|
|
|
|
Hi,
In a monthly Job I need to include a new JCL step which will delete all the GDG versions created in that particular year. So this new step should run only in December month. How I can trigger this step in december?
Thanks |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
First of all, let's get it straight, you mean GENERATIONS and not VERSIONS of a GDS
Have you spoken to your scheduling people to see if it is possible to do this via your schedule software. I think that you will find that it certainly is using some products. |
|
| Back to top |
|
 |
Ranjanmainframe
New User
Joined: 16 Apr 2010 Posts: 3 Location: Chennai
|
|
|
|
Hi expat,
Yes. I meant Generations (and not the versions) of GDS.
I did not discuss with scheduling peoples/operators.
It would be helpful if it is possible to do it inside JCL itself. |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| Why re-invent the wheel when the scheduling product almost certainly has that capability built in already. |
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I agree with expat about letting your scheduling system deal with this.
Outside of that, I don't see enough details about how YOU want to do this to really offer much of a recommendation. Obviously, you'll need a program to determine when the current month is equal to 12. Once that's been determined, what is it that you want to happen? Anyway, can't you just handle all of this programatically? Is the extra job step really necessary? |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
I agree with expat - why not schedule a Job, that's the correct way of doing it.
"in JCL itself", as has been stated many times, is a mis-leading term. JCL is a control language which is used to identify a job to an operating system and to describe the job's requirement and that's it.
On the other hand, if you insist - in the first step of a job, you can check for month-of-the-current-system-date (sort) and based upon that set a RC using which, in next step, execute IDCAMS to delete the GDS in question. |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
| Would you want to run it on the Dec 1 or Dec 31? Perhaps there are some process for the year that don't run until Jan? I think there are lot of question that need to be answered and most of them haven't even been asked yet. What about audit requirements? |
|
| Back to top |
|
 |
Kjeld
Active User

Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
Relating to your question on executing a jobstep at a specific time of year, I will join the choir telling you to schedule the step in a separate job, or if you insist on having the step inline with other steps in a job then create two versions of the job: One without the delete step and one executed yearly with the delete step. But do let your scheduling software control the execution!
This said, one of the useful things with GDGs is that they can be specified to hold a maximum number of generations. When this number is reached, the lowest generation number is automatically rolled of the GDG, which usually means that the dataset is deleted.
If you want to hold exactly 1 year of monthly datasets, just specify max. generations as 12. |
|
| Back to top |
|
 |
radhakrishnan82
Active User

Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
Does your shop accepts #JI card ?
Based on the month and date or the scheduling day, #JI card will be coded before the step and #JEND at the end of the particular step which you wanted to run on particular date/month.
I remember I was using this in my old shops. |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
| Quote: |
Does your shop accepts #JI card ?
|
This would depend on which scheduling product is used.
Gerry |
|
| Back to top |
|
 |
Bhargav_1058
New User
.jpg)
Joined: 13 Dec 2008 Posts: 53 Location: New York
|
|
|
|
If I am not wrong the below steps can be used to run a step in a particular month.
| Code: |
//STEP0000 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DSN=&&DATE,
// DISP=(,PASS,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1)),
// DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
OPTION COPY
* YYYYMMDD
INREC OVERLAY=(01:DATE1)
OUTREC IFTHEN=(WHEN=(7,2,CH,EQ,C'N'), --> Nth day
BUILD=(01:C' SET MAXCC=',5,2,80:X)), --> set the retun code for the respectively if the day is Nth day of the month.
IFTHEN=(WHEN=NONE,
BUILD=(01:C' SET MAXCC=00',80:X)) --> set the return code as 00 for the rest of the days.
/*
//***********************************************
//SETMAXCC EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=&&DATE,DISP=SHR
//***********************************************
//*
//JAN EXEC PGM=IEFBR14,COND=(1,NE,SETMAXCC) --> Runs on Nth day of Jan
//*
//FEB EXEC PGM=IEFBR14,COND=(2,NE,SETMAXCC) --> Runs on Nth day of Feb
//*
//MAR EXEC PGM=IEFBR14,COND=(3,NE,SETMAXCC)
//*
//APR EXEC PGM=IEFBR14,COND=(4,NE,SETMAXCC)
//*
//MAY EXEC PGM=IEFBR14,COND=(5,NE,SETMAXCC)
//*
//JUN EXEC PGM=IEFBR14,COND=(6,NE,SETMAXCC)
//*
//JUL EXEC PGM=IEFBR14,COND=(7,NE,SETMAXCC)
//*
//AUG EXEC PGM=IEFBR14,COND=(8,NE,SETMAXCC)
//*
//SEP EXEC PGM=IEFBR14,COND=(9,NE,SETMAXCC)
//*
//OCT EXEC PGM=IEFBR14,COND=(10,NE,SETMAXCC)
//*
//NOV EXEC PGM=IEFBR14,COND=(11,NE,SETMAXCC)
//*
//DEC EXEC PGM=IEFBR14,COND=(12,NE,SETMAXCC)
//*
//NOTNTH EXEC PGM=IEFBR14,COND=(0,NE,SETMAXCC) --> This step will get executed on other days. |
You can include the steps you want to execute in the corresponding months. |
|
| Back to top |
|
 |
Pons
New User
Joined: 25 May 2007 Posts: 61 Location: Coimbatore
|
|
|
|
Hi,
My suggestion is to separate that particular step in to separate job and schedule when ever you want. That could be very straight forward and simple method. You can use IEFBR14 to delete all the generations except GDG Base. |
|
| Back to top |
|
 |
Dsingh29
Active User

Joined: 16 Dec 2008 Posts: 132 Location: IBM
|
|
|
|
| I think Kjeld's advise is the best. Why bother about deleting when this can be done by parameters used while defining a GDG. |
|
| Back to top |
|
 |
Ranjanmainframe
New User
Joined: 16 Apr 2010 Posts: 3 Location: Chennai
|
|
|
|
Bhargav_1058,
Your code is working fine for me after doing some changes.
here I'm running STEP2 only when month is March (MM=03)
| Code: |
//STEP1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY RECORD
/*
//SORTOUT DD DSN=&&DATE,
// DISP=(,PASS,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1)),
// DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(01:DATE1)
OUTREC IFTHEN=(WHEN=(5,2,CH,EQ,C'03'),
BUILD=(01:C' SET MAXCC=',5,2,80:X)),
IFTHEN=(WHEN=NONE,
BUILD=(01:C' SET MAXCC=00',80:X))
/*
//**********************************************************************
//SETMAXCC EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=&&DATE,DISP=SHR
//**********************************************************************
//STEP2 EXEC PGM=SORT,COND=(3,NE,SETMAXCC)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TEST.INPUT.SORT.IN1,DISP=SHR
//SORTOUT DD DSN=TEST.OUTPUT.SORT.OUT1,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(10,5)),
// DCB=(LRECL=133,RECFM=FB,BLKSIZE=9044)
//SYSIN DD *
SORT FIELDS=(1,6,CH,A,35,8,ZD,A)
SUM FIELDS=NONE
/* |
Thanks to all for your response.
@Dsingh29: I' need to retain the Each months file till december, so the retention period will vary for each file. and also I cannot set LIMIT because I dont want none of previous years data when I'm entering january (new year). |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|