Page 1 of 1

step3 wants to run only once in a month

PostPosted: Tue May 22, 2012 12:16 pm
by mallikarjun9549
If i have 3 steps in a job and i want to run step1, step2 daily and step3 wants to run only once in a month how?

Re: jcl

PostPosted: Tue May 22, 2012 12:23 pm
by BillyBoyo
Presumably your site has a Schduler? Split into two jobs. Talk to your Scheduler people explaining what you want.

Re: jcl

PostPosted: Tue May 22, 2012 1:02 pm
by enrico-sorichetti
good posting habits suggest the use "descriptive" titles.
using a stupid title ( same as the forum section ) will lower the chances of getting good answers

if You do not want spend time on thinking and writing a proper title
there is no reason for us to waste our time helping You :evil:

Re: jcl

PostPosted: Tue May 22, 2012 5:54 pm
by steve-myers
As BillyBoyo suggests, this is an issue better resolved by using your shop's production scheduler. If you are going to run your JCL once a day, you need to determine the day of month using a utility like the program that follows, which returns the day of the month as a return code. Then it is a simple matter to arrange your JCL to run a step on the first day of the month.
MDAY     CSECT
         USING *,4
         SAVE  (14,4),,*
         LR    4,15
         TIME  DEC
* TRANSLATE PL4'0CYYDDD' TO BINARY
         XC    64(4,13),64(13)
         ST    1,68(,13)
         CVB   3,64(,13)
* ISOLATE CYY AND DDD
         SR    2,2
         D     2,=F'1000'
* CONVERT CYY TO A TRUE YEAR
         LA    3,1900(,3)
* DETERMINE IF LEAP YEAR.  THIS IS THE
* FULL GREGORIAN CALENDAR LEAP YEAR TEST
         LR    14,3
         LR    15,3
         N     14,=A(B'11')
         JNZ   MD0100
* YEAR IS DIVISIBLE BY 4, TEST IF CENTURY YEAR
         D     14,=F'100'
         LTR   14,14
         JNZ   MD0200
* TEST IF CENTURY YEAR DIVISIBLE BY 400
         N     15,=A(B'11')
         JZ    MD0200
* IT'S NOT A LEAP YEAR, TEST IF DAY OF YEAR
* IS IN JANUARY OR FEBRUARY
MD0100   C     2,=A(31+28)
         JNH   MD0200
* CHANGE NON-LEAP YEAR DAY OF YEAR TO
* LEAP YEAR DAY OF YEAR
         LA    2,1(,2)
* LOAD DAY OF MONTH INTO REG 15
MD0200   SR    15,15
         IC    15,T1(2)
         RETURN (14,4),T,RC=(15)
* TABLE TO TRANSLATE DAY OF YEAR IN A LEAP
* YEAR TO DAY OF MONTH
T1       DC    32AL1(*-T1)
T2       DC    29AL1(*-T2+1)
T3       DC    31AL1(*-T3+1)
T4       DC    30AL1(*-T4+1)
T5       DC    31AL1(*-T5+1)
T6       DC    30AL1(*-T6+1)
T7       DC    31AL1(*-T7+1)
T8       DC    31AL1(*-T8+1)
T9       DC    30AL1(*-T9+1)
T10      DC    30AL1(*-T10+1)
T11      DC    30AL1(*-T11+1)
T12      DC    30AL1(*-T12+1),0D'0'
         LTORG ,
         DC    0D'0'
         END   MDAY

Re: jcl

PostPosted: Tue May 22, 2012 9:13 pm
by Monitor
What about a simple COBOL-program !?
Identification Division.                         
Program-Id. DAYPGM.                               
Procedure Division.                               
    Move Function Current-date(7:2) to Return-Code
    GoBack                                       
    .   

Re: step3 wants to run only once in a month

PostPosted: Wed May 23, 2012 7:03 pm
by Ed Goodman
I hate to be t"that guy" but what about midnight? When is this going to run?