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: 38
Joined: Thu Mar 17, 2011 3:46 am

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
Akatsukami
 
Posts: 916
Joined: Sat Oct 16, 2010 2:31 am
Location: Tottering-on-the-Brink

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: 2185
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm

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: 38
Joined: Thu Mar 17, 2011 3:46 am

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: 6324
Joined: Sat Jun 09, 2007 8:58 am

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
Code: Select all
//*%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
regards
Enrico
enrico-sorichetti
 
Posts: 2150
Joined: Fri Apr 18, 2008 11:25 pm

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.
Code: Select all
//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
Global moderator
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm

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: 38
Joined: Thu Mar 17, 2011 3:46 am

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: 38
Joined: Thu Mar 17, 2011 3:46 am

Re: Day check

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

Are you looking for something like this?

Code: Select all
//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:

Code: Select all
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: 1082
Joined: Sat Jun 09, 2007 8:44 pm

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post
cron