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

How should write the JCL Steps?


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

New User


Joined: 16 Apr 2007
Posts: 49
Location: Pune

PostPosted: Thu Jul 23, 2009 2:30 pm
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: 8797
Location: Welsh Wales

PostPosted: Thu Jul 23, 2009 2:40 pm
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: 49
Location: Pune

PostPosted: Thu Jul 23, 2009 3:15 pm
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: 8797
Location: Welsh Wales

PostPosted: Thu Jul 23, 2009 3:21 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 23, 2009 3:46 pm
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: 1287
Location: Chennai, India

PostPosted: Thu Jul 23, 2009 3:48 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 23, 2009 3:50 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 23, 2009 3:52 pm
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: 1287
Location: Chennai, India

PostPosted: Thu Jul 23, 2009 3:52 pm
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: 8797
Location: Welsh Wales

PostPosted: Thu Jul 23, 2009 3:54 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 23, 2009 3:55 pm
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

Superior Member


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

PostPosted: Thu Jul 23, 2009 4:04 pm
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: 1702
Location: Australia

PostPosted: Thu Jul 23, 2009 4:25 pm
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: 1287
Location: Chennai, India

PostPosted: Thu Jul 23, 2009 4:52 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
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 Compare two files with a key and writ... SYNCSORT 3
Search our Forums:

Back to Top