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
 
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: 10327
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 Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Finding IMS resource blocker after se... Hooman24 IMS DB/DC 1 Wed Aug 16, 2017 9:17 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts finding delayed job/s in OPC jzhardy IBM Tools 0 Mon May 29, 2017 9:04 am

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