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
 
COMP-3 VARIABLE IN CONDITION STATEMENTS.

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

New User


Joined: 05 Aug 2008
Posts: 10
Location: bangalore

PostPosted: Wed Feb 25, 2009 5:43 pm    Post subject: COMP-3 VARIABLE IN CONDITION STATEMENTS.
Reply with quote

hello All,
my code is getting abended when iam trying to verify a comp-3 variable.

i have declare a varible like

Code:
01    cm-test                      pic S9(6)v9(4).
01    abc                            pic   99.

and the code is

Code:
Evaluate True
 when cm-test = zeroes
   move 10 to abc
  when other
    move 20 to abc
end-evaluate.


but my code is abending at Evaluate, is that the conditional statement with comp-3 variable is valid.

regards,
seenu.
Back to top
View user's profile Send private message

Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Wed Feb 25, 2009 5:49 pm    Post subject:
Reply with quote

Quote:
01 cm-test pic S9(6)v9(4).

Is this COMP-3 field?

Quote:
but my code is abending at Evaluate

Please post the error code and message.
Back to top
View user's profile Send private message
seerajen
Currently Banned

New User


Joined: 05 Aug 2008
Posts: 10
Location: bangalore

PostPosted: Wed Feb 25, 2009 5:51 pm    Post subject:
Reply with quote

sorry for the mistake happend....

ya u r right........its a comp-3 variable the declaration is as:

01 cm-test pic S9(6)v9(4) comp-3.

thanks,
seenu
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Feb 25, 2009 5:58 pm    Post subject:
Reply with quote

You should first test cm-test for numeric-ness...
Would "when cm-test numeric also cm-test = zeroes" work?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Feb 25, 2009 6:02 pm    Post subject:
Reply with quote

I can't remember for sure,
but I believe you can not rely on the resolution order of an 'ALSO' in a WHEN.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Wed Feb 25, 2009 6:07 pm    Post subject:
Reply with quote

Does cm-test contain a value or initialized?
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Feb 25, 2009 9:54 pm    Post subject:
Reply with quote

As alluded to, I'd put the EVALUATE inside an IF statement that tests for NUMERIC.
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 CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts PLI %IF statements Pedro PL/I & Assembler 1 Tue Sep 19, 2017 12:06 am

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