Hi SAs users,
I needed some help with loading the Claim_id field in Oracle database(character field of 20 byte length) . Claim_id was numericin the source data and i used put statement to convert into character with length & format of 20 bytes.
FINAL dataset is looking fine (7 byte claimid ), but ORacle load has shrinked to 5 byte. what i am missing?
PROC SQL;
create table FINAL as
select a.*,
put(CLM_ID ,22.) as CLM_ID1 format = $20. ,
;
quit;
Thanks,
Ana
I don't understand what you are doing.
In any case, in case this helps:
1. SAS can only store 16-digit integers (on PC/unix) before losing precision and distorting the values, when using numeric variables
so put(CLM_ID ,22.) is bound to produce bad results if you have that many digits.
You should never use numeric variables for such a long series of digits.
2. If you have that many digits or more always use a string
3. If you have large integers stored as numeric variables, always use a length of 8 bytes for that variable
I don't understand what you are doing.
In any case, in case this helps:
1. SAS can only store 16-digit integers (on PC/unix) before losing precision and distorting the values, when using numeric variables
so put(CLM_ID ,22.) is bound to produce bad results if you have that many digits.
You should never use numeric variables for such a long series of digits.
2. If you have that many digits or more always use a string
3. If you have large integers stored as numeric variables, always use a length of 8 bytes for that variable
The title has no link whatsoever with the question asked.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.