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
 

 

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. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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