Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Day of week in Cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rarvins

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

PostPosted: Fri Jan 11, 2008 4:15 pm    Post subject: Day of week in Cobol
Reply with quote

Hi,

Is there a fucntion/way by which I can find the day of week in cobol. In DB2 there is a day of week function which takes a date as input and returns the day of week i.e. 01 - Sunday, 02 - Monday... I need to imitate the same functionality in cobol. Is there a function / way ?

Cheers,
Rarvins
Back to top
View user's profile Send private message

Itanium

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Fri Jan 11, 2008 7:54 pm    Post subject:
Reply with quote

check the link:
http://publib.boulder.ibm.com/infocenter/comphelp/v7v91/index.jsp?topic=/com.ibm.aix.cbl.doc/rlpsacce.htm

Try Google before posting.
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 Jan 11, 2008 8:57 pm    Post subject:
Reply with quote

You might to check the reference manual for the version of COBOL you are using.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jan 12, 2008 1:04 am    Post subject:
Reply with quote

Use the INTEGER OF DATE function, divide the value returned by 7 - the remainder is the DOW.

I don't recall what their numeric values are (and they may also change with the INTDATE compiler option you use), so just pick a date whose DOW you know (e.g. today's date) and build your DOW table from that.

I would also code the INTDATE option in a CBL stmt immediately prior to the IDENTIFICATION DIVISION stmt of your pgm. This will assure that the same "start" is used for every execution of your pgm.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Sat Jan 12, 2008 8:17 am    Post subject:
Reply with quote

Accept pic-9 from day-of-week.
pic-9 1 = monday 7 = sunday

The rest is up to you.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jan 12, 2008 11:03 am    Post subject:
Reply with quote

That only works for the current date.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us