step3 wants to run only once in a month



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

step3 wants to run only once in a month

Postby mallikarjun9549 » Tue May 22, 2012 12:16 pm

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?
mallikarjun9549
 
Posts: 1
Joined: Thu May 03, 2012 7:42 pm
Location: hyderabad
Has thanked: 2 times
Been thanked: 0 time

Re: step3 wants to run only once in a month

 

Re: jcl

Postby BillyBoyo » Tue May 22, 2012 12:23 pm

Presumably your site has a Schduler? Split into two jobs. Talk to your Scheduler people explaining what you want.

These users thanked the author BillyBoyo for the post:
mallikarjun9549 (Wed May 23, 2012 1:35 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: jcl

Postby enrico-sorichetti » Tue May 22, 2012 1:02 pm

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:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2706
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 139 times

Re: jcl

Postby steve-myers » Tue May 22, 2012 5:54 pm

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
steve-myers
Global moderator
 
Posts: 1919
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 206 times

Re: jcl

Postby Monitor » Tue May 22, 2012 9:13 pm

What about a simple COBOL-program !?
Identification Division.                         
Program-Id. DAYPGM.                               
Procedure Division.                               
    Move Function Current-date(7:2) to Return-Code
    GoBack                                       
    .   

These users thanked the author Monitor for the post:
mallikarjun9549 (Wed May 23, 2012 1:33 pm)
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times

Re: step3 wants to run only once in a month

Postby Ed Goodman » Wed May 23, 2012 7:03 pm

I hate to be t"that guy" but what about midnight? When is this going to run?
Ed Goodman
 
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times


Return to JCL