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

Giving the logic for finding the day of the given year


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

New User


Joined: 26 Mar 2007
Posts: 4
Location: bangalore

PostPosted: Thu May 24, 2007 6:18 pm
Reply with quote

hi all,

can any one help me by giving the logic for finding the day of the given year.
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Thu May 24, 2007 7:04 pm
Reply with quote

System information will be present in the DATE field.You can use that
System information contained in the specified conceptual data items DATE,
DAY, DAY-OF-WEEK, or TIME, can be transferred into the identifier.

Syntax:

Code:
ACCEPT WS-VAR1 TO DATE


The format is YYMMDD
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Thu May 24, 2007 7:06 pm
Reply with quote

The above will give the current day's information.
For any day calculation in any year you can use the common date calculation used in your firm.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu May 24, 2007 7:18 pm
Reply with quote

damu wrote:
can any one help me by giving the logic for finding the day of the given year.
Like in the Julian day of the year - YYDDD - from 1 to 366?
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: Thu May 24, 2007 9:02 pm
Reply with quote

Hello,

Please clarify this
Quote:
finding the day of the given year.

with a couple of examples.

I believe i understand what the "given year" is, but i am not clear on "the day".
Back to top
View user's profile Send private message
damu

New User


Joined: 26 Mar 2007
Posts: 4
Location: bangalore

PostPosted: Fri May 25, 2007 6:22 pm
Reply with quote

the given year means,suppose the year is 1981/05/06.what is the day of that date.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri May 25, 2007 7:40 pm
Reply with quote

damu wrote:
the given year means,suppose the year is 1981/05/06.what is the day of that date.
To give us clarity, try answering this: 2007/05/25, what is the day of that date?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri May 25, 2007 9:07 pm
Reply with quote

It is my guess,he wants 'day' means 'sunday monday tuesday..etc.
I am not sure but 'May be' SQL can help in this case..
Or we have to implement what is called as Doomsday algorithm-
Please see the link-
http://everything2.com/index.pl?node_id=1023392
It should be fairly easy to implement in COBOL as C/C++ code is already given there.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 25, 2007 11:33 pm
Reply with quote

check Zeller's congruence algorithm
here is the wikipedia url
http://en.wikipedia.org/wiki/Zeller's_congruence
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 VB to FB - Finding LRECL SYNCSORT 4
No new posts Finding Assembler programs PL/I & Assembler 5
No new posts How to extract the data for current y... DFSORT/ICETOOL 8
No new posts Finding faulty logic Subscript out of... COBOL Programming 5
No new posts CSQBGET - Call giving completion code... COBOL Programming 3
Search our Forums:

Back to Top