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. 

 


 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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