BookmarkSubscribeRSS Feed
dooheekim01
Obsidian | Level 7

This is my code;

 

Data NewClams_2010_2013;
Set tca.claims_2010_2013;
NewClaimNumber=input(Claim_Number, 15.);
run;

 

But, still the format is Chat. 

dooheekim01_0-1641341280830.png

 

I have attached the file. 

 

5 REPLIES 5
novinosrin
Tourmaline | Level 20

Hi @dooheekim01 Claim_Number is ought to be character as that is the variable being read. However , check your NewClaimNumber. This should be numeric

 

Remember, you can't change the metadata i.e. data type of a variable from a dataset that is being read. You are basically assigning its values to a new numeric variable.

dooheekim01
Obsidian | Level 7

Thank you. 

SASKiwi
PROC Star

Unless you are doing calculations on claim number it is best left as character to avoid numeric precision problems. Please be aware that SAS numbers can only hold at most 15 digits accurately so you are right on the border of introducing precision errors. 

Patrick
Opal | Level 21

I'd keep claim_number as character for the reasons @SASKiwi explained.

But "just for fun" and using your code here how you could get to a numerical variable claim_number.

Data NewClams_2010_2013;
  Set tca.claims_2010_2013;
  NewClaimNumber=input(Claim_Number, 15.);
  drop Claim_Number;
  rename NewClaimNumber=Claim_Number;
run;
Reeza
Super User

You've circled the wrong variable.

 

You named the new numeric variable NewClaimNumber which is at the bottom of the list of variables as numeric. 

 


@dooheekim01 wrote:

This is my code;

 

Data NewClams_2010_2013;
Set tca.claims_2010_2013;
NewClaimNumber=input(Claim_Number, 15.);
run;

 

But, still the format is Chat. 

dooheekim01_0-1641341280830.png

 

I have attached the file. 

 


 

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!

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
  • 5 replies
  • 555 views
  • 6 likes
  • 5 in conversation