Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compiler Error IGYPA3009-S in Evaluate Statement

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

New User


Joined: 08 Jun 2006
Posts: 28
Location: hyderabad

PostPosted: Tue Nov 06, 2007 3:42 pm    Post subject: Compiler Error IGYPA3009-S in Evaluate Statement
Reply with quote

We're having a problem coding an EVALUATE statement in place of
nested IFs.

Working Storage looks something like:

01 .....
05 WS-EIBCPOSN PIC S9(4) VALUE ZEROS.
88 FUNC-SET VALUES 241, 242, 243, 244.
88 FUNC-IGEN VALUES 241, 242.


The Procedure Division code that works:

IF FUNC-SET
IF FUNC-IGEN
MOVE .....

The Procedure Division code that doesn't work:
-------
IF FUNC-SET
EVALUATE WS-EIBCPSON
WHEN FUNC-IGEN
MOVE ....

We get a compile error IGYPA3009-S that says:
"The selection object at position 1 in the "WHEN" phrase did not
match the type of the corresponding selection subject in the
"EVALUATE" statement. The selection object was discarded."

So what's wrong here?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Nov 06, 2007 4:13 pm    Post subject:
Reply with quote

Use EVALUATE TRUE when your WHENs are 88 levels.

WHEN FUNC-IGEN only returns true or not true.

But if your EVALUATE interrogates the value of a data-element, your WHENs must return equal lt,gt.
Back to top
View user's profile Send private message
gixcng

New User


Joined: 26 Oct 2007
Posts: 15
Location: chennai

PostPosted: Tue Nov 06, 2007 4:15 pm    Post subject:
Reply with quote

hi prabhath,

can you be more clear. what is the group variable here,under which the condition names are defined?
if at all the condition constants were to be
checked , their condition variables should be set.

if iam not wrong,you have not set the condition variable.
for ex:
WORKING-STORAGE SECTION.
01 CONDSCHE PIC 9(2).
88 EVENM VALUE 04,06,08,10,12.
88 ODDM VALUE 01,03,05,07,09,11.
88 FEB VALUE 02.
PROCEDURE DIVISION.
ACCEPT DAT.

MOVE MT TO CONDSCHE. //*setting the CONDSCHE
DIVIDE YR BY 4 GIVING YR1 REMAINDER YC.
IF YC = 0
IF (MT < 01) OR (MT > 12)
DISPLAY "INVALID MONTH"
ELSE
IF EVENM AND (DAYM > 30)

if iam not answering the question you are referring to,please let me know.

regards
Back to top
View user's profile Send private message
PRABHATH
Warnings : 1

New User


Joined: 08 Jun 2006
Posts: 28
Location: hyderabad

PostPosted: Tue Nov 06, 2007 5:01 pm    Post subject:
Reply with quote

Hi ,

For example:
IDENTIFICATION DIVISION.
PROGRAM-ID. EVALEX.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 REG PIC X(2).
88 C1 VALUE 'R1'.
88 C2 VALUE 'R2'.
88 C3 VALUE 'R3'.
PROCEDURE DIVISION.
MAIN-PARA.
ACCEPT REG.
EVALUATE REG
WHEN C1 DISPLAY 'WELCOME TO REGION 1'
WHEN C2 DISPLAY 'WELCOME TO REGION 2'
WHEN C3 DISPLAY 'WELCOME TO REGION 3'
WHEN OTHER DISPLAY 'THERES NO REGION DEFINED'
END-EVALUATE.
STOP RUN.

This would return the same result as before.
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Tue Nov 06, 2007 5:27 pm    Post subject:
Reply with quote

Hi Prabhath,

Could you tell me, What u r doing here

Code:
IF FUNC-SET
    EVALUATE WS-EIBCPSON
         WHEN FUNC-IGEN
                  MOVE ....


See, In above code FUNC-SET and FUNC-IGEN are the conditional data item for WS-EIBCPSON variable so Both variable will going to have same value so you can use below code

EVALUATE WS-EIBCPSON
WHEN FUNC-SET
WHEN FUNC-IGEN
MOVE .............
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Nov 06, 2007 5:29 pm    Post subject:
Reply with quote

Hi Prabhath,

Code:
This would return the same result as before.


Ru still facing problem?
Back to top
View user's profile Send private message
PRABHATH
Warnings : 1

New User


Joined: 08 Jun 2006
Posts: 28
Location: hyderabad

PostPosted: Tue Nov 06, 2007 5:49 pm    Post subject:
Reply with quote

Thanx Dick,

that worked for me...EVALUATE TRUE did well here.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Nov 06, 2007 7:56 pm    Post subject:
Reply with quote

Thanks for sharing the solution Prabath. icon_smile.gif This is a good practice to complete the thread.
Back to top
View user's profile Send private message
gixcng

New User


Joined: 26 Oct 2007
Posts: 15
Location: chennai

PostPosted: Wed Nov 07, 2007 10:25 am    Post subject:
Reply with quote

hi everyone,

ya EVALUATE TRUE did work icon_smile.gif

if we have several condition variables:
01 cond_che1
88....
88...
01 cond_che2
88...
88...
procedure division.
accept cond_che1
accept cond_che2
evaluate true...
(now,what variable will it check for?)
for me,
evaluate cond_che1 true dint work!!
Back to top
View user's profile Send private message
PRABHATH
Warnings : 1

New User


Joined: 08 Jun 2006
Posts: 28
Location: hyderabad

PostPosted: Wed Nov 07, 2007 12:40 pm    Post subject:
Reply with quote

Hi Gayathri,

I did try out an example for such a case...

For example in the following program:

IDENTIFICATION DIVISION.
PROGRAM-ID. EVALEX.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 T1 PIC 9(2).
01 REG PIC X(2).
88 C1 VALUE 'R1'.
88 C2 VALUE 'R2'.
88 C3 VALUE 'R3'.
01 REF PIC 9(2).
88 C5 VALUE 80.
88 C6 VALUE 90.
01 MONTH PIC 9(2).
PROCEDURE DIVISION.
MAIN-PARA.
ACCEPT REF.
ACCEPT T1.
ACCEPT REG.
DISPLAY T1.
EVALUATE TRUE
WHEN C1 DISPLAY 'WELCOME TO REGION 1'
WHEN C2 DISPLAY 'WELCOME TO REGION 2'
WHEN C3 DISPLAY 'WELCOME TO REGION 3'
WHEN OTHER DISPLAY 'THERES NO REGION DEFINED'
END-EVALUATE.
EVALUATE TRUE
WHEN C5 DISPLAY 'VALUE IS 80'
WHEN C6 DISPLAY 'VALUE IS 90'
WHEN OTHER DISPLAY 'WRONG ENTRY'
END-EVALUATE.
ACCEPT MONTH.
EVALUATE MONTH
WHEN 11 DISPLAY 'THIS IS NOVEMBER'
WHEN 12 DISPLAY 'THIS IS DECEMBER'
WHEN 1 THRU 10 DISPLAY 'VALUES OF LAST MONTHS' MONTH
WHEN OTHER DISPLAY 'WRONG ENTRY'
END-EVALUATE.
STOP RUN.

run this out...and you would come to know....
Back to top
View user's profile Send private message
PRABHATH
Warnings : 1

New User


Joined: 08 Jun 2006
Posts: 28
Location: hyderabad

PostPosted: Wed Nov 07, 2007 12:41 pm    Post subject:
Reply with quote

the above example shows the usage of EVALUATE in 2 different ways...
Back to top
View user's profile Send private message
gixcng

New User


Joined: 26 Oct 2007
Posts: 15
Location: chennai

PostPosted: Wed Nov 07, 2007 12:59 pm    Post subject:
Reply with quote

ya prabhath, it did work!

so the condition variables are set,in a way letting EVALUATE true.


thank you
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 FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 0 Mon Sep 18, 2017 4:31 pm
No new posts Reply MQ open error Vignesh Sid COBOL Programming 5 Thu Sep 07, 2017 6:02 pm
No new posts Error in SQL-PLIST3 'Above value tru... rikdeb DB2 4 Wed Sep 06, 2017 1:34 pm
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us