BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Rakesh93
Fluorite | Level 6
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
Fluorite | Level 6
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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 600 views
  • 0 likes
  • 2 in conversation