option validvarname=any;
proc sql;
select customer as "Customer Name"n,
amount as "Transaction Amount"n format=Dollar10.2
from sq.transactionfull
where amount>1000 and service ne 'University'
order by 2 desc;
quit;
What you should actually do:
option validvarname=V7;
proc sql;
create table temporary as
select customer label="Customer Name",
amount label= "Transaction Amount" format=Dollar10.2
from sq.transactionfull
where amount>1000 and service ne 'University'
order by 2 desc;
quit;
proc print data=temporary labels;
run;
SQL doesn't have the concept of labels, SAS does, they are powerful and help you out. If you're using SAS regularly, it's worth understanding them and how to use them.
@xun1 wrote:
OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 proc sql;
70 select Customer as "Customer Name",
_______________
22
71 Amount as "Transaction Amount" format=DOLLAR10.2
____________________
22
ERROR 22-322: Expecting a name.
72 from sq.transactionfull
73 where Amount > 1000 and Service ne 'University'
74 order by Amount desc;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
75 title "Large Non-Educational Transactions";
76 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 225.59k
OS Memory 19104.00k
Timestamp 09/08/2023 02:25:41 PM
Step Count 154 Switch Count 1
Page Faults 0
Page Reclaims 17
Page Swaps 0
Voluntary Context Switches 7
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 16
77
78
79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
89
... View more