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

I want to trim the end 2 numbers from a column and normally can just do a trim statement but not working right.

Here is my code:

proc sql;

create table implants.alldrgs_sum as

(select distinct

trim(left(clm_aud_nbr),10) as ClaimNum,

sys_drg,

drg_desc,

alloc_rvnu_cd,

funding,

alloc_allw_amt,

epd_calc_allw_amt,

alloc_net_pd_amt

from implants.implants_aso_alldrgs_copy

group by clm_aud_nbr);

run;

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

The TRIM() function does not take any numeric parameters.  What is it you want to do?

If CLM_AND_NBR is a character variable then use SUBSTR() function to take the first 10 characters.

If CLM_AND_NBR is a number what do you want to do?  Convert it to a string?  You could use the PUT() function.

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

The TRIM() function does not take any numeric parameters.  What is it you want to do?

If CLM_AND_NBR is a character variable then use SUBSTR() function to take the first 10 characters.

If CLM_AND_NBR is a number what do you want to do?  Convert it to a string?  You could use the PUT() function.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 7195 views
  • 0 likes
  • 2 in conversation