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

Issue with a date variable For a month end job


IBM Mainframe Forums -> IBM Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Susan Beatty

New User


Joined: 28 Feb 2008
Posts: 3
Location: florida

PostPosted: Fri Mar 21, 2008 8:31 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Mar 21, 2008 8:46 pm
Reply with quote

What language are you using?
Back to top
View user's profile Send private message
Susan Beatty

New User


Joined: 28 Feb 2008
Posts: 3
Location: florida

PostPosted: Fri Mar 21, 2008 8:47 pm
Reply with quote

JCL
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Fri Mar 21, 2008 8:55 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Mar 21, 2008 8:56 pm
Reply with quote

I think this is meant to be a Tivoli Workflow Scheduler question. icon_confused.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Fri Mar 21, 2008 8:57 pm
Reply with quote

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
View user's profile Send private message
Susan Beatty

New User


Joined: 28 Feb 2008
Posts: 3
Location: florida

PostPosted: Fri Mar 21, 2008 9:05 pm
Reply with quote

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
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Mar 21, 2008 10:06 pm
Reply with quote

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
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 -> IBM Tools

 


Similar Topics
Topic Forum Replies
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 5
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts XML Generate issue COBOL Programming 0
No new posts How to Login in to cics region and is... CICS 9
Search our Forums:

Back to Top