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

Need to run a particular step when current month =12


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

New User


Joined: 16 Apr 2010
Posts: 3
Location: Chennai

PostPosted: Wed Mar 09, 2011 2:37 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Mar 09, 2011 2:40 pm
Reply with quote

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
View user's profile Send private message
Ranjanmainframe

New User


Joined: 16 Apr 2010
Posts: 3
Location: Chennai

PostPosted: Wed Mar 09, 2011 2:57 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Mar 09, 2011 3:07 pm
Reply with quote

Why re-invent the wheel when the scheduling product almost certainly has that capability built in already.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Mar 09, 2011 3:13 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 09, 2011 3:14 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Mar 09, 2011 6:38 pm
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Mar 10, 2011 3:08 am
Reply with quote

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
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Thu Mar 10, 2011 11:14 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Mar 10, 2011 11:32 am
Reply with quote

Hi,

Quote:
Does your shop accepts #JI card ?
This would depend on which scheduling product is used.


Gerry
Back to top
View user's profile Send private message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Thu Mar 10, 2011 2:16 pm
Reply with quote

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
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Fri Mar 11, 2011 8:15 am
Reply with quote

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
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Fri Mar 11, 2011 12:47 pm
Reply with quote

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
View user's profile Send private message
Ranjanmainframe

New User


Joined: 16 Apr 2010
Posts: 3
Location: Chennai

PostPosted: Fri Mar 11, 2011 4:30 pm
Reply with quote

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
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Changeman - how can we know the curr... Compuware & Other Tools 2
Search our Forums:

Back to Top