01-21-2013 09:45 AM
I need to convert a character variable into a numeric variable, by means of an expression in an Extract transformation.
The character variable is called Cust_No, and has the format $8. It needs to become a numeric variable with the format 8.0.
How can I accomplish this? I'm going insane experimenting with PUT, PUTC, PUTN, INPUT, INPUTN, INPUTC, etc. Whenever I think I've done it, the SQL Join tells me that I have the wrong data type.
I thought it would be correct to use this: input(Cust_No, 8.) However, that just turns all the values blank.
01-21-2013 10:39 AM
Thanks. For some reason, when I do either of those things, the variable becomes blank, as though it refuses to be numeric.
Out of curiosity, should I be able to do an inner join on character variables?
01-21-2013 10:44 AM
Yes, you should be able to do inner join on character variables.
Would you, please, share the code?
And a small sample data?
new_var = input(old_var,best.);
01-21-2013 10:02 AM
You are on the right path. input() will convert the character variable into numeric. it should work.
so are you trying that in sql, could you please send me the code you have used in sql.
01-21-2013 02:51 PM
Sounds like your character variable is either blank or is longer than 8 characters and is right aligned so that the first 8 positions are blank.