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
 

 

Giving the logic for finding the day of the given year

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Giving the logic for finding the day of the given year
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: Chennai

PostPosted: Thu May 24, 2007 7:04 pm    Post subject: Re: to find day of the given year
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: Chennai

PostPosted: Thu May 24, 2007 7:06 pm    Post subject: Re: to find day of the given year
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: 3158
Location: Tucson AZ

PostPosted: Thu May 24, 2007 7:18 pm    Post subject: Re: to find day of the given year
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

Site Director


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

PostPosted: Thu May 24, 2007 9:02 pm    Post subject:
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    Post subject: the day of given year is
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: 3158
Location: Tucson AZ

PostPosted: Fri May 25, 2007 7:40 pm    Post subject: Re: the day of given year is
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: 686
Location: Earth

PostPosted: Fri May 25, 2007 9:07 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Fri May 25, 2007 11:33 pm    Post subject: Re: Giving the logic for finding the day of the given year
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    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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Need help in building a logic Benchwarmer All Other Mainframe Topics 4 Wed Feb 22, 2017 2:49 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Wishing everyone a very Happy Diwali ... Rohit Umarjikar General Talk & Fun Stuff 1 Sat Oct 29, 2016 1:54 am


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