Hello
I want to create proc format with ranges that included negative values
I receive an error
28 low<(-100000)='Lower than -100K'
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: (, ',', -, =.
ERROR 76-322: Syntax error, statement will be ignored.
proc format;
value ffmt
low<(-100000)='Lower than -100K'
(-100000)-<(-50000)='[-100,-50)'
(-50000)-<(-40000)='[-50,-40)'
(-40000)-<(-30000)='[-40,-30)'
(-30000)-<(-20000)='[-30,-20)'
(-20000)-<(-15000)='[-20,-15)'
(-15000)-<(-10000)='[-15,-10)'
(-10000)-<(-5000)='[-10,-5)'
(-5000)-<(-1000)='[-5,-1)'
(-1000)-<0='[-1,0)'
0-<1000='[0,1)'
1000-<5000='[1,5)'
5000-<10000='[5,10)'
10000-<15000='[10,15)'
15000-<20000='[15,20)'
20000-<30000='[20,30)'
30000-<40000='[30,40)'
40000-<50000='[40,50)'
50000-<100000='[50,100)'
100000-high ='[100+'
;
run;
You don't need the parenthesis. Try:
proc format lib=work;
value test
low - -1000 = "less then -1K"
-100 - 0 = "Still negative"
0 - high = 'Positive"
; run;
@Ronein wrote:
Hello
I want to create proc format with ranges that included negative values
I receive an error
28 low<(-100000)='Lower than -100K'
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: (, ',', -, =.ERROR 76-322: Syntax error, statement will be ignored.
Please check the line mentioned in the log ... there is an obvious syntax error. Comparing it to the other range-definitions may help.
You don't need the parenthesis. Try:
proc format lib=work;
value test
low - -1000 = "less then -1K"
-100 - 0 = "Still negative"
0 - high = 'Positive"
; run;
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.