View previous topic :: View next topic
|
Author |
Message |
Susan Beatty
New User
Joined: 28 Feb 2008 Posts: 3 Location: florida
|
|
|
|
I am having an issue with a date variable For a month end job.
I want to code a date for the job so that if the 1st of the month falls on a saturday or sunday the job will use the last business day of the month
for its date but if the first falls during the week the job will use the first for its date. Would I have to use an arithmatic calculation? How would I code it.
Thanks,
Sue |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What language are you using? |
|
Back to top |
|
|
Susan Beatty
New User
Joined: 28 Feb 2008 Posts: 3 Location: florida
|
|
|
|
JCL |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
check the ceedate callable service for the integer_of_date function
which has the chatacteristic that modulo 7 will give the day of the week
today = integer_of_date(....)
if today // 7 = 0 then workday = today - 2 its sunday
else
if today // 7 = 6 then workday = today - 1 its sunday
else workday = today
date = date_of_integer(workdate)
ok... ok... that' s just pseudocode but with a little reserarch onn the manulas and a couple of tests You should be ok... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I think this is meant to be a Tivoli Workflow Scheduler question. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
I hit enter too quickly,
if You need to pass the date as an external parameter via JCL
then any decent scheduler shoud have a calendar facility to do what You are looking for thru the use of internal variables
( at least TIVOLI OPC has it ) |
|
Back to top |
|
|
Susan Beatty
New User
Joined: 28 Feb 2008 Posts: 3 Location: florida
|
|
|
|
Thanks. Actually yes I should have been a little clearer on my question.
I am using Tivoli and wanted to code the date in the jcl to be resolved by Tivoli. Maybe I am in the rong forum but any help would be appreciated.
Something along the lines of
//*%OPC SETFORM OCDATE=(CCYYMMDD)
//*%OPC SETVAR TNBD=(OCDATE + 1WD)
//*%OPC SETFORM OCDATE=(CCYYMM)
//*%OPC SETVAR TMF1=(OCDATE + 1MO)
//*%OPC SETFORM OCDATE=(CCYYMM)
//*%OPC SETVAR TDAT=(OCFRSTC + 1MO)
//*
//*%OPC BEGIN ACTION=INCLUDE,
//*%OPC COMP=(&OCFRSTC..EQ.(&OCFRSTW)),
//FORMAT EXEC PGM=IEFBR14
//* PDATE='&TNBD',
//* VTD='&TMF1.01'
//*%OPC END ACTION=INCLUDE
//*%OPC BEGIN ACTION=INCLUDE,
//*%OPC COMP=(&OCFRSTC..NE.(&OCFRSTW)),
//FORMAT EXEC PGM=IEFBR14
//* PDATE='&TNBD',
//* VTD='&OCDATE'
//*%OPC END ACTION=INCLUDE |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
I would think you'd have better luck with standard OPC variables if you always used the first business day rather than backing up into the prior month.
We use the Variable Substitution exit for some of our own variables. You could handle your special logic with the exit and a custom symbolic. |
|
Back to top |
|
|
|