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

Execute certain steps of the JCL based on certain condition.


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

New User


Joined: 21 Feb 2007
Posts: 4
Location: Chennai

PostPosted: Mon Apr 30, 2007 2:34 pm
Reply with quote

Hi,

I have a requirement in the jcl as such. The jcl has steps1..... to step 10

Currently all the steps are running weekly. My requirement is such that

Steps 7...to Steps 10 needs to execute only in the fourth week and steps

1 to 6 needs to run weekly. Kindly give your suggestions.


Thanks .
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 30, 2007 2:51 pm
Reply with quote

Thameem,

Why dont you create two jobs and schedule them accordingly? This is lots easier the one which you had asked for (Im not sure it could be done).
Back to top
View user's profile Send private message
Thameem

New User


Joined: 21 Feb 2007
Posts: 4
Location: Chennai

PostPosted: Mon Apr 30, 2007 3:36 pm
Reply with quote

Yes, it could be done. But is there any possibility of doing it through condition code/return code....?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Apr 30, 2007 4:30 pm
Reply with quote

Hi!

it could be done... but,

STRONG ADVICE
there are legal/business standards on the week numbering so,
as far as the week of the year/month calculation it is better
to let the scheduler with its solar/legal/business calendar facilities to take care of it.
for this kind of requirements relying on RYO ( roll your own / do it yourself )
code is DANGEROUS unless You have a clear view of the standards

regards

e.s


P.S.

RYO ( roll Your own ) it' s an old way of showing trust,
when cigarettes were not ready made and You had to roll then from cigarette paper and tobacco,
instead of offering like nowadays a cigarette You would have offered the
oher guy your tobacco pouch, saying something like
>>... roll your own ....
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Apr 30, 2007 6:06 pm
Reply with quote

Use a program to set the RETURN-CODE to a non-zero value value if the week is the fourth week of the month. If not, then set it to zero

//STEP00 EXEC PGM=PGMXXX PGM TO SET RETURN-CODE
//*
// IF (STEP00.RC = 0) THEN
//STEP01 EXEC PGM1
//STEP02 EXEC PGM2
//STEP03 EXEC PGM3
//STEP04 EXEC PGM4
//STEP05 EXEC PGM5
//STEP06 EXEC PGM6
// ELSE
//STEP07 EXEC PGM=PGM7
//STEP08 EXEC PGM=PGM8
//STEP09 EXEC PGM=PGM9
//STEP10 EXEC PGM=PGM10
// ENDIF
Back to top
View user's profile Send private message
SHAILESH OZA

New User


Joined: 10 Jun 2005
Posts: 21
Location: Mumbai

PostPosted: Wed May 09, 2007 12:26 pm
Reply with quote

if you are using any scheduler for executing the jobs. then i think all the options are available in the scheduler to execute the job on weekly. monthly,daily. also you can specify the time when should the job will execute. We are using the Control-M schduler in which all the options are available
Back to top
View user's profile Send private message
timburkart

New User


Joined: 17 Mar 2007
Posts: 29
Location: USA

PostPosted: Thu May 17, 2007 12:16 am
Reply with quote

I am definitely in favor of SHAILESH OZA to use a job scheduler. Sure a programmatic solution will work but all of the schedulers that I have been exposed to include this as routine functionality.

regards,

tim
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Sat May 26, 2007 5:33 am
Reply with quote

I think your task is simple to implement but you need to co ordinate with the scheduler to have this job to be submitted in the following way.
Quote:
//Myjob JOB......
//STEP01 EXEC PGM1
//STEP02 EXEC PGM2
//STEP03 EXEC PGM3
//STEP04 EXEC PGM4
//STEP05 EXEC PGM5
//STEP06 EXEC PGM6
#JI,ID=31(say for the fourth week running steps)
//STEP07 EXEC PGM=PGM7
//STEP08 EXEC PGM=PGM8
//STEP09 EXEC PGM=PGM9
//STEP10 EXEC PGM=PGM10
#JEND


Here all you need to do is instruct the scheduler in such a way that the JOB should be running ever week with its regular SCHID except the fourth week. In fourth week it MUST run with SCHID=31 to include the steps 7,8,9,10.

I tink you understoos. I feel your issues is resolved.

Please check and let me know if you have any problems.

Regards
Amar
Back to top
View user's profile Send private message
Thameem

New User


Joined: 21 Feb 2007
Posts: 4
Location: Chennai

PostPosted: Mon May 28, 2007 7:10 pm
Reply with quote

Thanks everyone for all your suggestions. The issue was solved by splitting the job into two. One is scheduled as weekly and the other job is scheduled as monthly......
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 28, 2007 9:43 pm
Reply with quote

Thank you for posting your resolution icon_smile.gif
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 Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Fetch data from programs execute (dat... DB2 3
No new posts CA7 deleting files in steps after job... CA Products 4
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top