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: 785
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: 6966
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: 785
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: 1239
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
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


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