Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to run a particular step when current month =12

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Need to run a particular step when current month =12
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: 8593
Location: Back in jolly old England

PostPosted: Wed Mar 09, 2011 2:40 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Mar 09, 2011 3:07 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Mar 09, 2011 3:13 pm    Post subject: Reply to: Need to run a particular step when current month =
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

Senior Member


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

PostPosted: Wed Mar 09, 2011 3:14 pm    Post subject: Reply to: Need to run a particular step when current month =
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    Post subject:
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    Post subject:
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: 436
Location: chennai, India

PostPosted: Thu Mar 10, 2011 11:14 am    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Mar 10, 2011 11:32 am    Post subject:
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    Post subject:
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    Post subject: Reply to: Need to run a particular step when current month =
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to get previous month in SYMNAMES Suganya87 SYNCSORT 9 Fri Oct 28, 2016 1:37 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us