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

Evaluate and level 88


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Thu Sep 07, 2006 6:41 pm
Reply with quote

good moorning.....can help me?

please a need help...
i want to use a level 88 at evaluate statement (like this), and receive de following msg compiler error:

The selection object at position 1 in the "WHEN" phrase did not match the type o
subject in the "EVALUATE" statement. The selection object was discarded.

Code Example

01 COD-PEDIDO-AUTORIZACION PIC 9(3).
88 AUTORIZAR
VALUES 28 29 42 550 569 570 571 692 693 695 696.
88 OPOSICION
VALUES 426.
MOVE CLAVE-RESP-0005 TO COD-PEDIDO-AUTORIZACION
EVALUATE COD-PEDIDO-AUTORIZACION
WHEN 0
EXIT
WHEN AUTORIZAR
PERFORM ROLLBACK-DB
MOVE 28 TO NUM-TEXT
MOVE CT-ERROR-LOGICO TO R-RETORNO
MOVE 1 TO IND-MEN787-60B1
PERFORM TRATAR-ERROR
SET CORRECTO TO TRUE
PERFORM PREP-DIA-ERRORSUC
WHEN OPOSICION
PERFORM ROLLBACK-DB
MOVE R-RETORNO TO NUM-TEXT
MOVE CT-ERROR-LOGICO TO R-RETORNO
MOVE 1 TO IND-MEN787-60B1
PERFORM TRATAR-ERROR
SET CORRECTO TO TRUE
PERFORM PREP-DIA-ERRORSUC
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Sep 07, 2006 7:15 pm
Reply with quote

Define it like :-
Code:
01 COD-PEDIDO-AUTORIZACION PIC 9(3).
88 AUTORIZAR
VALUES 28 29 42 550 569 570 571 692 693 695 696.
88 OPOSICION
VALUES 426.
88 ZERO
VALUE 000.


and check for WHEN ZERO
Back to top
View user's profile Send private message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Thu Sep 07, 2006 7:26 pm
Reply with quote

give me the same error.......
add a level 88, and de when....
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Sep 07, 2006 9:11 pm
Reply with quote

did you change your EVALUTAE for checking WHEN ZERO after adding it in 88 level.
Back to top
View user's profile Send private message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Thu Sep 07, 2006 9:27 pm
Reply with quote

EVALUATE COD-PEDIDO-AUTORIZACION
WHEN CERO
EXIT
WHEN AUTORIZAR
PERFORM ROLLBACK-DB
MOVE 28 TO NUM-TEXT
MOVE CT-ERROR-LOGICO TO R-RETORNO
MOVE 1 TO IND-MEN787-60B1
PERFORM TRATAR-ERROR
SET CORRECTO TO TRUE
PERFORM PREP-DIA-ERRORSUC
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Sep 07, 2006 9:33 pm
Reply with quote

grabeva,

Do as priyesh said, and then change

'EVALUATE COD-PEDIDO-AUTORIZACION '
to
'EVALUATE TRUE'

This will solve your problem, I think.

Dave
Back to top
View user's profile Send private message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Thu Sep 07, 2006 9:38 pm
Reply with quote

Dave, thanks,
but this its not possible, because
i want to check differente value,
example: 426 ..do....something.-...
28 or 46 or 49 ...do something....
0 exit
y other....do something different....

i'm clear???
thanks again....
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Sep 07, 2006 9:44 pm
Reply with quote

I believe what you want is exactly waht will happen. Give it a try.


the use of the 88 level COD-PEDIDO-AUTORIZACION

is equivalent to coding


COD-PEDIDO-AUTORIZACION = ( 28 or 29 or 42 or 550 or 569 or 570 or 571 or 692 or 693 or 695 or 696 )

And as you can see

EVALUATE COD-PEDIDO-AUTORIZACION
WHEN COD-PEDIDO-AUTORIZACION = ( 28 or 29 or 42 or 550 or 569 or 570 or 571 or 692 or 693 or 695 or 696 )

is not valid

EVALUATE TRUE
WHEN COD-PEDIDO-AUTORIZACION = ( 28 or 29 or 42 or 550 or 569 or 570 or 571 or 692 or 693 or 695 or 696 )

is valid



Dave
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Sep 07, 2006 9:56 pm
Reply with quote

Quote:
Do as priyesh said, and then change

'EVALUATE COD-PEDIDO-AUTORIZACION '
to
'EVALUATE TRUE'

Oh yeah... I missed this one... Thanks Dave...
Back to top
View user's profile Send private message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Thu Sep 07, 2006 10:57 pm
Reply with quote

Dave....

if i use evaluate true....can i use "WHEN OTHER" ?????
what can i do with the rest of value?....i need to do something with the rest of the values....(its de "when other" of a normal evaluate)
for example....
88 autorizar value 28 29 570 571
88 oposicion value 426
88 cero value 0

evaluate true
when autorizar ....move 1 to campo
when oposicion ...move 2 to campo
when zero ... exit
when other?????
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Sep 07, 2006 11:19 pm
Reply with quote

Yes,

WHEN OTHER is valid with EVALUATE TRUE

It?s a catch all for when no other condition has been satisfied.

Dave
Back to top
View user's profile Send private message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Fri Sep 08, 2006 12:39 am
Reply with quote

thankssssssssssssssssssssssss
gra
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 How to load to DB2 with column level ... DB2 6
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts Evaluate variable to execute a jcl step JCL & VSAM 3
No new posts JPM Reports for each DB2 V12 Function... DB2 0
No new posts Program level statistics CICS 6
Search our Forums:

Back to Top