data have; infile cards truncover;; input PRI EEOG $ PWD $ cards; 1 7 2 3 DIS 3 7 4 3 5 2 6 7 7 7 8 10 DIS 9 7 10 3 11 7 ; run; proc sql; create table want as select EEOG, count(*) as B, sum(PWD='DIS') as C, (calculated C/calculated B) as D format=percent 12.1, 0.023 as E calculated B* calculated E as F, case when calculated F-calculated C<0 then 0 else calculated F-calculated C end as G from have group by EEOG union select 'Total' as EEOG, count (*) as B, sum (PWD='DIS') as C, (calculated C / calculated B) as D format=percent 12.1, 0.023 as E, calculated B* calculated E as F, case when calculated F-calculated C<0 then 0 else calculated F-calculated C end as G from have; quit; ------------------------------------------------ ERROR 22-322: Expecting a format name. ERROR 202-322: The option or parameter is not recognized and will be ignored. 359 0.023 as E 360 calculated B* calculated E as F, ---------- 78 76 ERROR 78-322: Expecting a ','. ERROR 76-322: Syntax error, statement will be ignored. 361 case 362 when calculated F-calculated C<0 then 0 363 else calculated F-calculated C 364 end as G 365 366 from have 367 group by EEOG 368 union 369 select 'Total' as EEOG, 370 count (*) as B, 371 sum (PWD='DIS') as C, 372 (calculated C / calculated B) as D format=percent 12.1, 373 0.023 as E, 374 calculated B* calculated E as F, 375 case 376 when calculated F-calculated C<0 then 0 377 else calculated F-calculated C 378 end as G 379 from have; 380 quit; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 0.03 seconds cpu time 0.03 seconds
... View more