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
 

 

How should write the JCL Steps?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Amolondhe007
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Thu Jul 23, 2009 2:30 pm    Post subject: How should write the JCL Steps?
Reply with quote

Hi All,

I had one question asked in inteview.

If i have 10 to 12 steps in my JOB and my target is that i have execute each step on one day...like 1st step on 1 day,2nd step on 2nd Day....

So how should i write the JCL steps?

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: Thu Jul 23, 2009 2:40 pm    Post subject:
Reply with quote

Fortunately a situation I have never encountered, nor hope to.

I believe this may be yet another example of an interviewer talking out of his/her a**e

Are we to understand that the execution cycle in days is equal to the number of steps involved.
Back to top
View user's profile Send private message
Amolondhe007
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Thu Jul 23, 2009 3:15 pm    Post subject:
Reply with quote

Hi

Interviewer was expecting this answer for Production support cases.

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: Thu Jul 23, 2009 3:21 pm    Post subject:
Reply with quote

Using scheduling software it is possible to include differing parts of a job given different days/schids/situations.

That is the only way that I can think of get around this, unless you write a small REXX or program to issue different return codes for whatever day of the week it is.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jul 23, 2009 3:46 pm    Post subject: Reply to: How should write the JCL Steps?
Reply with quote

since it' s raining here is a rexx snippet to compute an offset or an index into a cycle

Code:
cystar cycle starting date
cydays number of days in the cycle
cyoffs 0 to retur an offset 1 to return an index


I' ll let somebody else explain the logic

Code:
cystar = date("S")
cystar = 20090720

cydays = 10
cydays = 7

cyoffs = 0
cyoffs = 1

say cycle(date("S"), cystar, cydays, cyoffs)

exit

cycle: procedure
   parse arg cycurr, cystar, cydays, cyoffs
   return ( date("B",cycurr,"S") - date("B",cystar,"S") ) // cydays + cyoffs

Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Jul 23, 2009 3:48 pm    Post subject: Reply to: How should write the JCL Steps?
Reply with quote

Expat,

Can SLEEP be coded in all the steps to make it wait?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jul 23, 2009 3:50 pm    Post subject: Reply to: How should write the JCL Steps?
Reply with quote

why would You want to keep an initiator busy ??
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jul 23, 2009 3:52 pm    Post subject: Reply to: How should write the JCL Steps?
Reply with quote

anyway that' what schedulers are built for ...
manage execution cycles ...

write a job for each step and create the appropriate schedule definition
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Jul 23, 2009 3:52 pm    Post subject: Reply to: How should write the JCL Steps?
Reply with quote

Did not think from that angle ! icon_sad.gif

Thanks Enrico.
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: Thu Jul 23, 2009 3:54 pm    Post subject:
Reply with quote

Aaru - have you not ever seen any of my responses to people who want to use SLEEP icon_neutral.gif

Although, it would work. Just imagine hogging an initiator for a whole week to process just one job icon_lol.gif The type of response it needs really.

I'd just love to interview the a***hole that asked that one in an interview.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jul 23, 2009 3:55 pm    Post subject: Reply to: How should write the JCL Steps?
Reply with quote

but for a weekly cycle, based on the day of the week a simple

date("B") // 7 will return 0 for monday ... 6 for sunday

see the rexx manual for the date function
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Thu Jul 23, 2009 4:04 pm    Post subject: Re: How should write the JCL Steps?
Reply with quote

Amolondhe007 wrote:
If i have 10 to 12 steps in my JOB and my target is that i have execute each step on one day...like 1st step on 1 day,2nd step on 2nd Day....
You should have asked the interviewer -- Should the step repeat after one week? 1st and 8th step should be executed on 8th day or just the 8th step? and for a year should I code "365 steps".. icon_biggrin.gif
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jul 23, 2009 4:25 pm    Post subject:
Reply with quote

Hi,

you can always create a number of jobs, then schedule each job on the designated day or as already mentioned, most scheduling tools will allow you to place code around each step of the job and schedule it according to it's criteria.


Gerry
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Jul 23, 2009 4:52 pm    Post subject: Reply to: How should write the JCL Steps?
Reply with quote

Expat,

Quote:
Aaru - have you not ever seen any of my responses to people who want to use SLEEP


Nope, I did not icon_biggrin.gif

Quote:
Although, it would work. Just imagine hogging an initiator for a whole week to process just one job


very true.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts Compare 2 files & write Indicator... nagendrapgupta SYNCSORT 5 Sun May 15, 2016 10:42 am
No new posts DFSORT to match two files and write John F Dutcher DFSORT/ICETOOL 6 Thu May 12, 2016 5:17 pm
This topic is locked: you cannot edit posts or make replies. Executing JCL specific steps at speci... Shruti Takkar JCL & VSAM 6 Mon Feb 22, 2016 12:39 pm


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