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.

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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