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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.