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
 

 

Program for Day of Week

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

New User


Joined: 19 Dec 2005
Posts: 77

PostPosted: Wed May 20, 2009 12:40 pm    Post subject: Program for Day of Week
Reply with quote

Hi Buddies,

Could anyone get me a program in Cobol to find the Day of the Week?


Thanks in advance.

Regards,
Srinath.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Wed May 20, 2009 12:52 pm    Post subject: Reply to: Program for Day of Week
Reply with quote

this is a help forum, not a do it for me or search for me

if You search the forums You will find lots of suggestions
Back to top
View user's profile Send private message
arun.masilamani

New User


Joined: 26 Jun 2008
Posts: 4
Location: Chennai

PostPosted: Wed May 20, 2009 4:42 pm    Post subject: Reply to: Program for Day of Week
Reply with quote

Why dont you try the following code for your requirement ??

Code:
WORKING-STORAGE SECTION.                           
                                                   
  01  WS-CURRENT-DT.                               
      05  WS-CURR-YY                 PIC X(2).     
      05  WS-CURR-MM                 PIC X(2).     
      05  WS-CURR-DD                 PIC X(2).     
                                                   
PROCEDURE DIVISION.                                 
                                                   
    PERFORM 1000-INITILIZATION-PARA THRU 1000-EXIT.
    STOP RUN.                                       
                                                   
1000-INITILIZATION-PARA.                           
    ACCEPT WS-CURR-DD          FROM DAY-OF-WEEK.   
    DISPLAY WS-CURRENT-DT.                         
                                                   
1000-EXIT.                                         
    EXIT.                                           
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed May 20, 2009 4:51 pm    Post subject: Reply to: Program for Day of Week
Reply with quote

It's been suggested that you search the forums as this question has been asked numerous times.

Have you searched for "day-of-week"?

I believe you'll get many hits....

Regards,
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Fri May 22, 2009 3:44 pm    Post subject:
Reply with quote

check the below code

Code:

COMPUTE DAY-OF-WEEK = FUNCTION MOD (FUNCTION INTEGER-OF-DATE (Input date)7).
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri May 22, 2009 10:07 pm    Post subject: Reply to: Program for Day of Week
Reply with quote

Click on the following link -

http://ibmmainframes.com/viewtopic.php?p=125110&highlight=#125110

The code in the above link doesn't rely upon the date being today's date when determining the day of the week.

You will need to define an OCCURS 7 array, which contains the alphabetic days of the week.

Your COBOL version/release must be (at a minimum), COBOL/370 (early 1990's) as this code uses INTRINSIC FUNCTIONS.

Otherwise, for OS/VS COBOL or VS/COBOL II, you'd have to use the LE Callable Date routines counterparts of these INTRINSIC FUNCTIONS, providing that LE is installed in your LPAR.

Regards,
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
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


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