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
 

 

compile error on conditional if and move

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

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Oct 08, 2010 10:10 pm    Post subject: compile error on conditional if and move
Reply with quote

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
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7933
Location: Bellevue, IA

PostPosted: Fri Oct 08, 2010 10:21 pm    Post subject:
Reply with quote

Have you ever moved anything to WS-DOB-MM, WS-DOB-DD, or WS-FORMAT-DOB?
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Fri Oct 08, 2010 10:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Oct 08, 2010 11:01 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Oct 08, 2010 11:03 pm    Post subject: Reply to: compile error on conditional if and move
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Oct 08, 2010 11:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Oct 08, 2010 11:06 pm    Post subject:
Reply with quote

Bill,

Thanks that was the exact problem and I never thought about that
as being the issue. Once again many thanks..
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Fri Oct 08, 2010 11:08 pm    Post subject:
Reply with quote

Hadn't noticed that - good catch.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Oct 09, 2010 12:27 am    Post subject: Reply to: compile error on conditional if and move
Reply with quote

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
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 OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm


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