MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cast Char to Int????

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
dsonsamuel
Beginner


Joined: 25 Mar 2004
Posts: 26
Topics: 16

PostPosted: Thu Feb 09, 2006 9:39 am    Post subject: Cast Char to Int???? Reply with quote

Hi,
How can i cast a Char field in a table to integer type?Any thots?



regards,
dson.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Feb 09, 2006 11:31 am    Post subject: Reply with quote

dsonsamuel,

why not simply use scarlar INT function ? Check this link which explains in detail about INT function.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/3.2.38?SHELF=&DT=20010718164132&CASE=

If that does not help show us examples of input and desired output along with their lengths.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dsonsamuel
Beginner


Joined: 25 Mar 2004
Posts: 26
Topics: 16

PostPosted: Thu Feb 09, 2006 1:54 pm    Post subject: Reply with quote

Hi,
My concern is...

I have a amount fields in the table as 2, and 2,03 (CHAR 15)

I want to select the amount which exceeds a decimal amt limit for example 2 whcih is in working storage.

When I used cast(amt as decimal) it returned just the whole part which fails when the amt is 2,03 and limit is 2.

Is there any other solution to concert 2,03(char) to 2.03(Integer) and then do a compare with the limit 2?
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Feb 10, 2006 5:51 am    Post subject: Reply with quote

Would it be easier to cast the number to char?
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Feb 10, 2006 10:11 am    Post subject: Reply with quote

dsonsamuel,

please show us examples of both input and desired output

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group