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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.