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
 

 

Execute certain steps of the JCL based on certain condition.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Execute certain steps of the JCL based on certain condition.
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: 1439
Location: Bangalore,India

PostPosted: Mon Apr 30, 2007 2:51 pm    Post subject:
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    Post subject: Re: Execute certain steps of the JCL based on certain condit
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10279
Location: italy

PostPosted: Mon Apr 30, 2007 4:30 pm    Post subject: Re: Execute certain steps of the JCL based on certain condit
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

Moderator Team Head


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

PostPosted: Mon Apr 30, 2007 6:06 pm    Post subject: Re: Execute certain steps of the JCL based on certain condit
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    Post subject: Re: Execute certain steps of the JCL based on certain condit
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: 30
Location: USA

PostPosted: Thu May 17, 2007 12:16 am    Post subject: Re: Execute certain steps of the JCL based on certain condit
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: 200
Location: USA

PostPosted: Sat May 26, 2007 5:33 am    Post subject: Re: Execute certain steps of the JCL based on certain condit
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    Post subject: Re: Execute certain steps of the JCL based on certain condit
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

Site Director


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

PostPosted: Mon May 28, 2007 9:43 pm    Post subject:
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    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
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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