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

regarding alphanumeric to numeric


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

New User


Joined: 19 Oct 2007
Posts: 37
Location: chennai

PostPosted: Mon Jan 28, 2008 9:55 am
Reply with quote

Hi,


I have one query is it possible to move from x(4) to 9(4).


Regards
Karthik
Back to top
View user's profile Send private message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Mon Jan 28, 2008 12:45 pm
Reply with quote

Karthik,

Its been discussed lot of times, please search the forum for the answers.
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Mon Jan 28, 2008 5:41 pm
Reply with quote

Hi Karthik,

You would be getting a S0C7 abend if you try to move a X(4) variable into a 9(4) varaible. However for the other way round, you won't get any error.

Please do check the forums in a proper way before you post a similar question.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Mon Jan 28, 2008 6:27 pm
Reply with quote

swapnadeep.ganguly:

What if the x(4) = 1234 and you try to move that to the 9(4)? SOC7?
Back to top
View user's profile Send private message
rag swain

New User


Joined: 17 Dec 2007
Posts: 33
Location: pune,INDIA

PostPosted: Mon Jan 28, 2008 6:45 pm
Reply with quote

Its always better to go for numeric test before such move(if it is numeric go for the move otherwise do other processing to prevent any abort). The other way round is to use NUMVAL or NUMVALC fucntion.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jan 28, 2008 10:18 pm
Reply with quote

Hello,

Quote:
You would be getting a S0C7 abend if you try to move a X(4) variable into a 9(4) varaible.
As mentioned by Steve - not necessarily

I'd also suggest you pay attention to what "rag swain" posted.
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Tue Jan 29, 2008 11:07 am
Reply with quote

hello,

you can always use the functions like NUMVAL, IS NUMERIC etc.
however, if you want to move the data without any check, you wont get any error while moving. if you try to perform some operation on those data then you may result into a S0C7 abend in case of invalid data.
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 Convert HEX to Numeric DB2 3
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts Handling the numeric data in unstring... COBOL Programming 18
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
No new posts Numeric check on packed signed and un... COBOL Programming 4
Search our Forums:

Back to Top