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
 
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: 10327
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: 2504
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: 2504
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm

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