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

extract job name or day number using jcl


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

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Thu Nov 03, 2011 11:53 am
Reply with quote

hi all,

i have a job JLXXDN0 where N is day number.N=(1-7).

i have 5 steps inside the job. s1,s2,s3,s4,s5,

from day 1-6 i need to execute all the 5 steps.

but in the day 7 (on sunday)i need to bypass first 3 and execute
last 2 steps only.

i think if i can extract the jobnumber or day number then put
this into sequential file .then i can achieve this.

is there any way i can extract day number or job number ?

i searched forum but didnt get much info.saw few rexx code but i never worked on REXX.

plzz help me regardig the same..

Regds,
useit
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Nov 03, 2011 12:04 pm
Reply with quote

Have you tried talking to the team who operate your scheduler?
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Thu Nov 03, 2011 12:10 pm
Reply with quote

yes i spoke to him. he said this can be done through jcl.but he is not sure how:(. i simply dont want to go for another new job. i want to achieve this in the same job.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Nov 03, 2011 12:20 pm
Reply with quote

I was thinking more that the Scheduler knows what day of the week it is, rather than your man would have the particular skills to help out with some fudge...

Presumably something is generating your job names (I wonder what) so knows about Sunday's. So something there...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Nov 03, 2011 1:03 pm
Reply with quote

Or the people in schedular central can't be bothered to do some work icon_lol.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Nov 03, 2011 1:08 pm
Reply with quote

Or the question was "can I do it in a (piece of) JCL?" rather than "please can you suggest a method whereby it can be done in the scheduler?"

In which case, "yes, I'm sure you can do it somehow in a JCL" can be a good answer whilst preparing the solution anyway. Too much to hope, I suppose :-)
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Thu Nov 03, 2011 1:56 pm
Reply with quote

hi,
can I include one more step in the existing jcl ?if i can extract the job/day number in sequential file later we can check for that file empty/noempty conditions and bypass the required steps.

Regds,
useit
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Thu Nov 03, 2011 2:00 pm
Reply with quote

By the look of jobnames, terminologies referring to systems in your previous posts, i strongly doubt that your client was my ex-employer & can relate to the scheduler team responses & lengthy approval processes :-)

For the problem at hand, if you want a non-scheduler approach,

You can have a sort step in the JCL that returns a return code based on the current day.
Customise the COND parameter in each step and make them run as needed.

On Sunday the below step will return RC of 0. Other days RC=16

Code:
//STEP010 EXEC PGM=SORT           
//SYSOUT   DD SYSOUT=*           
//SYMNAMES DD *                   
CUR_DAY,S'&WDAY'                 
/*                               
//SORTIN   DD *                   
SUNDAY                           
/*                               
//SORTOUT  DD SYSOUT=*           
//SYSIN     DD *                 
  OPTION COPY,NULLOUT=RC16       
  INCLUDE COND=(1,3,CH,EQ,CUR_DAY)
/*                               
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Nov 03, 2011 2:01 pm
Reply with quote

Or the REXX code is available on the forum if you search
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Thu Nov 03, 2011 2:07 pm
Reply with quote

SuperK's collections:
ibmmainframes.com/about6737.html
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Thu Nov 03, 2011 2:20 pm
Reply with quote

vasanth,
thanx a ton.your code is working fine:) .

thanx again..

Regds,
useit
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Nov 03, 2011 2:33 pm
Reply with quote

To put another broken record on the turntable...

Now, make sure your JOB always runs before midnight (at least the date-getting step). Make sure it never abends and has to be re-submitted after midnight. Make sure you never need to re-run the job for any reason except on a Sunday (before midnight).

Else, remember you have to change the JOB in those situations, just so it runs correctly.
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 Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top