Thank you everyone!
Two questions:
I just need the value rounded to the tenth exported into an excel worksheet. I tried Tom's code and got the following error when I used the following code.
1. What am I doing wrong?
2. What does (obs=1) do?
Any help you can give will be most appreciated. Thank you!
proc sql;
create table want as
select 'C.' label='A-G',
(select round(sum(A)/sum(F) from a.have),0.1) as All,
(select round(sum(A)/sum(F) from a.have),0.1) where pub_priv='PUBLIC') as Public,
(select round(sum(A)/sum(F) from a.have),0.1) where pub_priv='PRIVATE') as Private
from a.have(obs=1);
quit;
771
772 proc sql;
773 create table want as
786 select 'C. label='A-G',
787 (select round(sum(A)/sum(F) from a.have),0.1) as All,
---- -
22 76
202
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, ',', -, /, <,
<=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE,
LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
787! (select round(sum(A)/sum(F) from a.have),0.1) as All,
-
22
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, !, !!, &, *, **, +,
',', -, /, <, <=, <>, =, >, >=, ?, AND, AS, BETWEEN, CONTAINS, EQ, EQT, FORMAT, FROM,
GE, GET, GT, GTT, IN, INFORMAT, INTO, IS, LABEL, LE, LEN, LENGTH, LET, LIKE, LT, LTT,
NE, NET, NOT, NOTIN, OR, TRANSCODE, ^, ^=, |, ||, ~, ~=.
788 (select round(sum(A)/sum(F) from a.have),0.1) where pub_priv='PUBLIC') as
788! Public,
789 (select round(sum(A)/sum(F) from a.have),0.1) where pub_priv='PRIVATE') as
789! Private
790 from a.have(obs=1);
791 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
... View more