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
 

 

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: 6968
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 Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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