BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Rakesh93
Calcite | Level 5
I have a lab dataset in which LBSTNRHI, LBSTNRLO, LBREFID , LBSTNRHI_US, LBSTNRLO_US are there. I want to convert these variable so that they could handle both character data type as well as numeric data type. Kindly share your answers with programming code.

Thank you.
1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

If LBSTNRHI, LBSTNRLO, LBREFID , LBSTNRHI_US, LBSTNRLO_US are character variables then they can store both character and numeric data. Use PROC CONTENTS as I showed you to confirm if they are character or not.

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star

Only SAS character variables can store both character and numeric data. Use PROC CONTENTS to confirm if your variables are either character or numeric:

proc contents data = MyLib.MyTable;
run;
Rakesh93
Calcite | Level 5
I have mentioned those variables in message. I want only those variables
can read both numeric and character data. Do you know any formats which can
Achieve that?
SASKiwi
PROC Star

If LBSTNRHI, LBSTNRLO, LBREFID , LBSTNRHI_US, LBSTNRLO_US are character variables then they can store both character and numeric data. Use PROC CONTENTS as I showed you to confirm if they are character or not.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 483 views
  • 0 likes
  • 2 in conversation