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
 

 

Moving numeirc to alphanumeirc for comparition with zero

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

New User


Joined: 01 Sep 2006
Posts: 17
Location: Delhi

PostPosted: Sat Oct 21, 2006 11:44 am    Post subject: Moving numeirc to alphanumeirc for comparition with zero
Reply with quote

I have a alphanum field as x(4) and
i have a numeric field as 9(2) which have value as zero

if suppose, I moved numeirc to alphanumeirc then I compared alphanumeric like below
if alpha-numeirc = 0 then perform first else perform second.

where it'll go ?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Oct 21, 2006 6:51 pm    Post subject:
Reply with quote

It will not compile. you need to change your code from:
Code:
If alpha-numeirc = 0 then perform first else perform second.


to:

Code:
If alpha-numeirc = '0000' then perform first else perform second.


after coding properly, first will be performed.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Oct 21, 2006 6:57 pm    Post subject:
Reply with quote

Correction:

after the move of numeirc to alpha-numeirc, alpha-numeirc will contain '00bb' where b = space.

Unless you compare alpha-numeirc to '00' (or '00bb') second will be performed.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


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

PostPosted: Sun Oct 22, 2006 2:10 am    Post subject: Re: Moving numeirc to alphanumeirc for comparition with zero
Reply with quote

Quote:
It will not compile. you need to change your code from:

I am not sure, if it throws a compilation error, Does it?... but expected execution wouldn't be achieved until compare that alphanum variable with a value with quotes.

So in your current coding situation, It'll always execute second until you modify it to '00bb' as suggested by Mr. Dick.
Back to top
View user's profile Send private message
kutty.r

New User


Joined: 22 Jun 2006
Posts: 24

PostPosted: Thu Oct 26, 2006 11:58 am    Post subject: Re: Moving numeirc to alphanumeirc for comparition with zero
Reply with quote

hi,

you cant test the class of an field like is alpha-numeric.
the class test can be done only as follows

is numeric
is alphabetic
is alphabetic-higher
is alphabetic-lower
icon_wink.gif
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 Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
No new posts Moving character data to smallint in db2 rikdeb DB2 5 Thu Jul 14, 2016 12:38 am
No new posts MOVING COMP-3 into binary akodakka COBOL Programming 2 Tue Dec 01, 2015 5:02 pm
No new posts CICS- Moving to High availability vicky10001 CICS 8 Fri Oct 23, 2015 7:49 pm
No new posts What is the best way for moving from ... Hooman24 All Other Mainframe Topics 0 Sun Apr 26, 2015 6:36 pm


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