BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASAna
Quartz | Level 8

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

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

 

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

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

 

SASAna
Quartz | Level 8
Thanks for the help. I changed it to 8 byte and it worked fine loading the data to Oracle tables.

Thanks again,
Ana
ChrisNZ
Tourmaline | Level 20

The title has no link whatsoever with the question asked.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1201 views
  • 0 likes
  • 2 in conversation