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
 

 

Logic of geting no of days by two given date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
shelu280

New User


Joined: 12 Jan 2009
Posts: 9
Location: chennai

PostPosted: Fri Feb 06, 2009 4:42 pm    Post subject: Logic of geting no of days by two given date
Reply with quote

what will be a logic
If i have one date given ,other date is from system how to no days between it
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7996
Location: Bellevue, IA

PostPosted: Fri Feb 06, 2009 4:44 pm    Post subject:
Reply with quote

Depending on the language, there frequently is a function to generate this difference. If not, you have to write a routine to calculate it.
Back to top
View user's profile Send private message
shelu280

New User


Joined: 12 Jan 2009
Posts: 9
Location: chennai

PostPosted: Mon Feb 09, 2009 12:01 pm    Post subject: Logic of geting no of days by two given date
Reply with quote

IN COBOL
I TRIED THE FUNCTION INTEGER OF DATE BUT I DOES'NT WORK SO WHAT WILL BE THE LOGIC
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: Mon Feb 09, 2009 12:08 pm    Post subject:
Reply with quote

Hello,

TURN YOUR CAPS OFF. . .

Do not post "it didn't work" - that provides nothing for anyone to use to help you.

What happened? An abend? An unexpected result? A syntax error.

You need to provide all of the meaningful diagnostic info. Then someone may have a suggestion.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Feb 09, 2009 4:10 pm    Post subject:
Reply with quote

Hi,

Something like this should have worked
Code:
COMPUTE WS-DAYS = FUNCTION INTEGER-OF-DATE (WS-DATE-1) - 
                FUNCTION INTEGER-OF-DATE (WS-DATE-2)
Back to top
View user's profile Send private message
shelu280

New User


Joined: 12 Jan 2009
Posts: 9
Location: chennai

PostPosted: Fri Feb 13, 2009 3:11 pm    Post subject:
Reply with quote

Hi,

when i tried above code it give an error

1.FUNCTION WAS NOT DEFINED AS A DATA-NAME
2. INTEGER-OF-DATE WAS INVALID
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: Fri Feb 13, 2009 9:58 pm    Post subject:
Reply with quote

Hello,

When you post error messages, you neet to post the message-id also.

If you copy/paste the actual code with the error(s) following it will help (use the "Code" tag to preserve slignment and improve readability).

Also, post the version of the compiler you are using (this will be at the top of compiler output).
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
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 Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm


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