View previous topic :: View next topic
|
Author |
Message |
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Code: |
05 WS-FORMAT-DOB.
10 WS-DOB-MM PIC 9(02) VALUE ZEROES.
10 FILLER PIC X(01) VALUE '/'.
10 WS-DOB-DD PIC 9(02) VALUE ZEROES.
10 FILLER PIC X(01) VALUE '/'.
10 WS-DOB-CC PIC 9(02) VALUE ZEROES.
10 WS-DOB-YY PIC 9(02) VALUE ZEROES.
10 WS-XRF-PER-DOB-FD PIC X(10) VALUE SPACES.
IF WS-DOB-MM > 0
AND WS-DOB-DD > 0
MOVE WS-FORMAT-DOB TO WS-XRF-PER-DOB-FD <---- ERROR
ELSE
MOVE '01/01/0001' TO WS-XRF-PER-DOB-FD
END-IF
IBM Enterprise COBOL for z/OS 4.2.0
IGYOP3091-W Code from "MOVE (line 1836.01)" to "MOVE (line 1836.01)" can never be executed and was therefore discarded.
I have tried various attempts on this if statement and I still get the same
error, anyone have a solutition.?? |
[/code] |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Have you ever moved anything to WS-DOB-MM, WS-DOB-DD, or WS-FORMAT-DOB? |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1041 Location: Richmond, Virginia
|
|
|
|
You have two MOVE's, but have not shown the compiler line numbers, so we cannot know which the compiler has flagged.
Also need code statically preceding this code.
The (smart, eh?) compiler "knows" the value of variables that are hard-coded statically before your IF, so it knows that one of these tests has to fail.
Please provide the additional info. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Code: |
05 WS-UNFORMAT-DOB PIC 9(06) VALUE ZEROES.
MOVE DATE-BRTH-OBLO TO WS-UNFORMAT-DOB
MOVE WS-UNFORMAT-DOB(5:2) TO WS-DOB-DD
MOVE WS-UNFORMAT-DOB(3:2) TO WS-DOB-MM
MOVE WS-UNFORMAT-DOB(1:2) TO WS-DOB-YY
IF WS-DOB-YY > WSSUT13W-DATE-CURR6-YY
MOVE 19 TO WS-DOB-CC
ELSE
MOVE 20 TO WS-DOB-CC
END-IF |
this is the code just before the if statement. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Mickey,
You're moving a group to an elementary item belonging to this same group.
Try making ===> WS-XRF-PER-DOB-FD an 05 level (same as the group level), defining it outside of the group.
Bill |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Phil, if you look at the if statement I have marked the line with the
error with <---- ERROR
Code: |
IF WS-DOB-MM > 0
AND WS-DOB-DD > 0
MOVE WS-FORMAT-DOB TO WS-XRF-PER-DOB-FD <---- ERROR
ELSE
MOVE '01/01/0001' TO WS-XRF-PER-DOB-FD
END-IF
|
|
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Bill,
Thanks that was the exact problem and I never thought about that
as being the issue. Once again many thanks.. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1041 Location: Richmond, Virginia
|
|
|
|
Hadn't noticed that - good catch. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Mickey,
Delving into some of these COBOL "Nuances", it makes me curious if -
Code: |
MOVE WS-FORMAT-DOB (1:8) TO WS-XRF-PER-DOB-FD (1:)
|
Would work, leaving WS-XRF-PER-DOB-FD as a level 10 (still part of the group)?
The COBOL compiler may generate an MVCL (what a waste of cycles) and perhaps that's why it would work and boggle the mind!
Just a SWAG on my part....
Bill |
|
Back to top |
|
|
|