Hello,
I have a CHAR column that has numbers in them 13 digits in length, I want to convert these to numeric but when I try to do this using INPUT I get a numeric column displaying the scientific format. I don't want this how do I go about stopping this?
This is what I am currently using,
PROC SQL;
CREATE TABLE WORK.ACCOUNT_NUMERIC as
SELECT *, INPUT (ACCOUNT, 16.) AS NUMERIC_ACCOUNT
What am i doing wrong?
The problem is not the informat, but the format. If you give the number the format you want, that should solve it, e.g.
PROC SQL;
CREATE TABLE WORK.ACCOUNT_NUMERIC as
SELECT *, INPUT (ACCOUNT, 16.) format=16.0 AS NUMERIC_ACCOUNT
INPUT (ACCOUNT, best32.)
Nope that didn't work.
Account Account_Numeric
1100001866320 1.1000019E12
1100002875975 1.1000029E12
1100004528978 1.1000045E12
1100009131297 1.1000091E12
This is a sample of the results I am getting
@Symun23 wrote:
Nope that didn't work.
Account Account_Numeric
1100001866320 1.1000019E12
1100002875975 1.1000029E12
1100004528978 1.1000045E12
1100009131297 1.1000091E12This is a sample of the results I am getting
If you don't do arithmetic with something it likely should not be numeric: postal codes, phone numbers, account numbers, product numbers, and patient identifiers for example. Then the issue should not have occurred at all.
The problem is not the informat, but the format. If you give the number the format you want, that should solve it, e.g.
PROC SQL;
CREATE TABLE WORK.ACCOUNT_NUMERIC as
SELECT *, INPUT (ACCOUNT, 16.) format=16.0 AS NUMERIC_ACCOUNT
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: