SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
GN0001
Barite | Level 11

Hello team,

This refers to the lines that I have case statements.

Regards,

blue blue

Blue Blue
1 REPLY 1
Patrick
Opal | Level 21

You get such a message if you formulate a comparison between a column of type character and a column of type numeric.

 

You can only compare variables of the same data type (numeric with numeric or character with character).

 

Run a Proc Contents over your table and the report will show you one of the columns as char and one as num.

 

You have to convert one of the columns to the other type: i.e. put(<numerical column>,32.) to create a string of digits to compare with another variable which contains similar string of digits.

 

If you formulated a comparison variable=<some value> then make sure that if your variable is of type character the value is in quotes, and if the variable is of type numeric then not quotes around the value.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1772 views
  • 2 likes
  • 2 in conversation