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

FUNCTION INTEGER-OF-DATE


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


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 Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
Search our Forums:

Back to Top