IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to use accept day of week??


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Young zhang

New User


Joined: 13 Jun 2008
Posts: 15
Location: china

PostPosted: Fri Aug 15, 2008 10:32 am
Reply with quote

How to use accept day of week??
Back to top
View user's profile Send private message
ulfnsc

New User


Joined: 15 Jan 2004
Posts: 19
Location: Stockholm, SWEDEN

PostPosted: Fri Aug 15, 2008 12:39 pm
Reply with quote

in your cobol-DB2 program?

/ulf
Back to top
View user's profile Send private message
Young zhang

New User


Joined: 13 Jun 2008
Posts: 15
Location: china

PostPosted: Fri Aug 15, 2008 12:51 pm
Reply with quote

Hi ulfnsc, only cobol program.
Back to top
View user's profile Send private message
ulfnsc

New User


Joined: 15 Jan 2004
Posts: 19
Location: Stockholm, SWEDEN

PostPosted: Fri Aug 15, 2008 1:05 pm
Reply with quote

OK
DAY-OF-WEEK
Has the implicit PICTURE 9(1).
The single data element represents the day of the week according to the following values:

1 represents Monday 5 represents Friday
2 represents Tuesday 6 represents Saturday
3 represents Wednesday 7 represents Sunday
4 represents Thursday
Code:
ACCEPT ws-nr-day-of-week FROM DAY-OF-WEEK
....

evaluate ws-nr-day-of-week
   when 1
      move "monday" to ws-day-of-week
   when 1
      move "tuesday" to ws-day-of-week
   .
   .
end-evaluate


/ulf
Back to top
View user's profile Send private message
GrantP

New User


Joined: 12 Aug 2008
Posts: 8
Location: Johannesburg

PostPosted: Fri Aug 15, 2008 3:26 pm
Reply with quote

Small correction necessary

Code:
evaluate ws-nr-day-of-week
   when 1
      move "monday" to ws-day-of-week
   when  2
      move "tuesday" to ws-day-of-week
   .
   .
end-evaluate
Back to top
View user's profile Send private message
ulfnsc

New User


Joined: 15 Jan 2004
Posts: 19
Location: Stockholm, SWEDEN

PostPosted: Fri Aug 15, 2008 4:44 pm
Reply with quote

... copy and paste, oops
icon_redface.gif

/ulf
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Aug 18, 2008 12:42 pm
Reply with quote

Code by ulf looks fine to me too icon_confused.gif icon_confused.gif
Back to top
View user's profile Send private message
Young zhang

New User


Joined: 13 Jun 2008
Posts: 15
Location: china

PostPosted: Mon Aug 18, 2008 1:34 pm
Reply with quote

Dear all,

Thank you for your help. I can solve this problem now.

/Young
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 18, 2008 7:23 pm
Reply with quote

Hello,

Good to hear you have a solution icon_smile.gif

If you post your solution, it will probably help someone with a similar question later icon_wink.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Add week number to a file name or rep... JCL & VSAM 2
No new posts How to find the first monday of the w... COBOL Programming 10
No new posts A good week so far General Talk & Fun Stuff 2
No new posts Cobol Accept date VS Db2 Current time... DB2 7
No new posts Display DAY of Week using SYNCSORT SYNCSORT 1
Search our Forums:

Back to Top