Day check



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Day check

Postby Kitz » Mon Jun 13, 2011 9:11 pm

Hello there,

An application(AD) is scheduled to run everyday from Monday to Friday in the scheduler(OPC/TWS). I need to run a step in a job if its Monday else I need to just dummy out the complete step using IEFBR14.

So, is it possible to check for the day in the week?

Thanks & Regards,
Kitz
Kitz
 
Posts: 47
Joined: Thu Mar 17, 2011 3:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: Day check

Postby Akatsukami » Mon Jun 13, 2011 11:07 pm

Kitz wrote:An application(AD) is scheduled to run everyday from Monday to Friday in the scheduler(OPC/TWS). I need to run a step in a job if its Monday else I need to just dummy out the complete step using IEFBR14.

Although the item is not related to DFSORT, you are aware that merely changing (through some mechanism) the program to IEFBR14 will not affect data set disposition, yes?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Day check

Postby NicC » Mon Jun 13, 2011 11:16 pm

Stop trying to complicate things - split the job into 3 parts. Parts 1 and 3 run daily, part 2 runs on monday after part1 and before part3.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Day check

Postby Kitz » Mon Jun 13, 2011 11:50 pm

Thanks Akatsukami, Nic for your quick response.

My Application(AD) in the TWS/OPC schedular has got nearly 200 jobs inter-dependent on each other which produce reports, updates database, vsam files, daily MIS reports etc in a single application. Its a critical application and runs from a quite long years(more than 10-15 years now). To separete out a single step to another application(AD) is something not part of the standard we have here.
Is there any option in DFSORT or OPC (SETVAR or SETFORM) or any other easy approach to identify the DAY of the week.
If its monday then I want to execute that step else not.

I am more interested to use the some sort of check to find if its monday or not in the week. Help on this is much appreciated.

Thanks & Regards,
Kitz
Kitz
 
Posts: 47
Joined: Thu Mar 17, 2011 3:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: Day check

Postby dick scherrer » Tue Jun 14, 2011 12:24 am

Hello,

What you want to do is not a JCL task. . .

One easy to do what you want is to add a new step that determines "if this is Monday" and sets the Return Code accordingly.
The step that should be skipped, can be skipped by checking the return code (COND. . .).

I would not be surprised if the day could be gotten from the scheduler. Have you looked in the documentation or talked with the scheduling people?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Day check

Postby enrico-sorichetti » Tue Jun 14, 2011 12:31 am

see here on how to use OPC variables to include / exclude pieces of jcl
http://publibz.boulder.ibm.com/cgi-bin/ ... 0125170123

along the lines of
//*%OPC  BEGIN ACTION=INCLUDE
//*%OPC       COMP=(expression to check for monday )
... jcl statements for monday
//*%OPC  END ACTION=INCLUDE
//*%OPC  BEGIN ACTION=EXCLUDE
//*%OPC       COMP=(expression to check for monday )
... jcl statements for NON Monday
//*%OPC  END ACTION=EXCLUDE
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Day check

Postby skolusu » Tue Jun 14, 2011 1:33 am

Kitz,

You can use the following DFSORT JCL which will set the return code of 4 when the day of the week is NOT monday.
//STEP0100 EXEC PGM=SORT                       
//SYMNAMES DD *                                 
WKDAY,S'&LWDAY'                                 
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD *                                 
A                                               
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                                 
  SORT FIELDS=COPY                             
  INREC BUILD=(WKDAY)                           
  OUTFIL NULLOFL=RC4,INCLUDE=(1,3,CH,EQ,C'MON')
//*                                             
//STEP0200 EXEC PGM=????,COND=(4,EQ,STEP0100)   
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Day check

Postby Kitz » Tue Jun 14, 2011 1:55 am

Thanks Dick, Enrico

Sorry for the confusion. I am interested to know how can we identify the current DAY (Mon, Tue etc) of the current date.

For instance, I can directly use OPC date variables like '&CDD.&&CMM.&CYY' in my JCL and it gives current date.
//*%OPC SCAN
.
.
//SYSIN DD *
&CDD.&&CMM.&CYY'
/*

Probasbly, similarly we can get the current date using system date etc in the JCL (though I didn't work on this).

However, to my knowledge, there is no such variable available which directly gives current DAY(Mon, Tue etc). I am interested to know how can we know the current DAY.

I believe there are some SYMNAMES DD statment of SORT can be used to determine the DAY. But, I am not so sure how to use it.

Any sort of help how to determine the DAY in a JCL is more appreciated.

Thanks & Regards,
Kitz
Kitz
 
Posts: 47
Joined: Thu Mar 17, 2011 3:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: Day check

Postby Kitz » Tue Jun 14, 2011 1:58 am

Thanks a lot Skolusu. I am looking for this kind of SYMNAMES DD statement approach. I will try this tomorrow and let you know.

Thanks again.

Thanks & Regards,
Kitz
Kitz
 
Posts: 47
Joined: Thu Mar 17, 2011 3:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: Day check

Postby Frank Yaeger » Tue Jun 14, 2011 2:42 am

Are you looking for something like this?

//S1 EXEC PGM=SORT           
//SYSOUT DD SYSOUT=*         
//SYMNAMES DD *               
CURDAY,S'&LWDAY'             
//SORTIN DD *                 
RECORD                       
//SORTOUT DD SYSOUT=*         
//SYSIN DD *                 
  OPTION COPY                 
  INREC BUILD=(CURDAY)       


SORTOUT would have the following today:

MON   
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post