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
 

 

extract job name or day number using jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Nov 03, 2011 11:53 am    Post subject: extract job name or day number using jcl
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Nov 03, 2011 12:04 pm    Post subject: Reply to: extract job name or day number using jcl
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: 141

PostPosted: Thu Nov 03, 2011 12:10 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Nov 03, 2011 12:20 pm    Post subject: Reply to: extract job name or day number using jcl
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: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 03, 2011 1:03 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Nov 03, 2011 1:08 pm    Post subject: Reply to: extract job name or day number using jcl
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: 141

PostPosted: Thu Nov 03, 2011 1:56 pm    Post subject:
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: 1445
Location: Azeroth

PostPosted: Thu Nov 03, 2011 2:00 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 03, 2011 2:01 pm    Post subject:
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: 1445
Location: Azeroth

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

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

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Nov 03, 2011 2:20 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Nov 03, 2011 2:33 pm    Post subject:
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    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 Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm
No new posts CPU time Vs Number of records Nileshkul JCL & VSAM 5 Mon May 09, 2016 4:05 pm
No new posts Syntax to check the first 4 digits of... kshirabdhi DFSORT/ICETOOL 10 Tue May 03, 2016 12:21 pm


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