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
 

 

Issue with a date variable For a month end job

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IBM Tools
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    Post subject: Issue with a date variable For a month end job
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    Post subject:
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Fri Mar 21, 2008 8:55 pm    Post subject: Reply to: date variables
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

Moderator Team Head


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

PostPosted: Fri Mar 21, 2008 8:56 pm    Post subject: Reply to: date variables
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Fri Mar 21, 2008 8:57 pm    Post subject: Reply to: date variables
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> IBM Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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