View previous topic :: View next topic
|
Author |
Message |
shell100
New User
Joined: 14 Apr 2006 Posts: 25 Location: Banglore,India
|
|
|
|
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 |
|
|
shell100
New User
Joined: 14 Apr 2006 Posts: 25 Location: Banglore,India
|
|
|
|
Sorry.....WS-TEST is as below:
01 WS-TEST PIC X(8) VALUE SPACES.....(not of X(26)) |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
shell100
New User
Joined: 14 Apr 2006 Posts: 25 Location: Banglore,India
|
|
|
|
Thanks..... |
|
Back to top |
|
|
|