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
 

 

FUNCTION INTEGER-OF-DATE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Thu May 18, 2006 5:22 pm    Post subject: FUNCTION INTEGER-OF-DATE
Reply with quote

Hi,

I used following code in my program:

01 WS01-INTEGER-LAUPE PIC 9(8) VALUE ZEROES.
01 WS00-UDATE.
05 WS00-CCYY PIC 9(4) VALUE ZEROES.
05 WS00-MM PIC 9(2) VALUE ZEROES.
05 WS00-DD PIC 9(2) VALUE ZEROES.

----
----
------ *DXTMS2 is timestamp & i need to take only date out of that.
MOVE IN00-DXTMS2(1:4) TO WS00-CCYY
MOVE IN00-DXTMS2(6:2) TO WS00-MM
MOVE IN00-DXTMS2(9:2) TO WS00-DD

COMPUTE WS01-INTEGER-LAUPE =
FUNCTION INTEGER-OF-DATE
(WS-UDATE)

This gave me error while comiling saying type of WS-UDATE miss match with what needs to be for Function INTEGER-OF-DATE.

Then i just made one change in working storage as below:

01 WS01-INTEGER-LAUPE PIC 9(8) VALUE ZEROES.
01 WS00-UDATE.
05 WS00-CCYY PIC 9(4) VALUE ZEROES.
05 WS00-MM PIC 9(2) VALUE ZEROES.
05 WS00-DD PIC 9(2) VALUE ZEROES.
01 WS-TEST PIC X(26) VALUE SPACES.


MOVE IN00-DXTMS2(1:4) TO WS00-CCYY
MOVE IN00-DXTMS2(6:2) TO WS00-MM
MOVE IN00-DXTMS2(9:2) TO WS00-DD

Move WS-UDATE TO WS-TEST

COMPUTE WS01-INTEGER-LAUPE =
FUNCTION INTEGER-OF-DATE
(WS-TEST)

This code compiled & worked fine. I displayed value of WS-UDATE & WS-TEST to check. Both were same then how come it was giving error in first case????????

Thanks,
Back to top
View user's profile Send private message

shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Thu May 18, 2006 5:24 pm    Post subject:
Reply with quote

Sorry.....WS-TEST is as below:

01 WS-TEST PIC X(8) VALUE SPACES.....(not of X(26))
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat May 20, 2006 7:46 am    Post subject:
Reply with quote

The manual says that WS-UDATE/WS-TEST must be an integer. I would have used PIC 9(8).

Theoretically the contents of WS-TEST is an integer. That may be why it was successful. WS-UDATE may have pulled an error because it was a group item.

To be on the safe side I would do what the manual states as a requirement. A year from now IBM may fix that compiler "BUG".
Back to top
View user's profile Send private message
shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Mon May 22, 2006 10:08 pm    Post subject: Re: FUNCTION INTEGER-OF-DATE
Reply with quote

Thanks.....
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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
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


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