Hello, I have the following dataset
data test;
infile datalines;
input Est_inc $3.;
datalines;
008
015
020
040
051
060
061
070
150
;
run;
The values are character but are clean data. I want to specify range as follows, but unsuccesful. Please help.
proc format;
value $ emp;
"008"-"020"="8-20"
"040"-"060"="40-60"
"061"-"150"="61-150"
;
run;
Regards,
It looks like you just need to clean up the syntax of your VALUE statement.
It looks like you just need to clean up the syntax of your VALUE statement.
Personally I avoid using formats, but even more so when dealing with numbers as characters. Would the text "8" be considered between "008" and "024"? Textually its not. Is there a reason for the format need? Why not just convert to numeric and use numeric ranging - makes more sense as your really dealing with numeric data. Nothing stopping you keeping both, text and num, and using num.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.