BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

Hello

I want to create format

What is the way to solve the problem with category

30000<50000='(d) 30-50'

Please note that it should be greater than 30000 and lower than 50000

proc format;
value fff
0='(a) 0'
0<-10000='(b) 0-10'
10000<-30000='(c) 10-30'
30000<50000='(d) 30-50'
50000='(e) 50'
50000<-high='(f) 50+'
;
run;

 

1 REPLY 1
Kurt_Bremser
Super User

To exclude both endpoints, use <-<:

proc format;
value fff
0='(a) 0'
0<-10000='(b) 0-10'
10000<-30000='(c) 10-30'
30000<-<50000='(d) 30-50'
50000='(e) 50'
50000<-high='(f) 50+'
;
run;

data test;
input number;
numberf = number;
format numberf fff.;
datalines;
29000
30000
30001
49999
50000
50001
;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 569 views
  • 2 likes
  • 2 in conversation