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

Logic of geting no of days by two given date


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Feb 06, 2009 4:44 pm
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
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

Moderator Emeritus


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

PostPosted: Mon Feb 09, 2009 12:08 pm
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

Superior Member


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

PostPosted: Mon Feb 09, 2009 4:10 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Feb 13, 2009 9:58 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top