data have;
input xyz a b c total;
cards
a 1 2 3 6
b 4 5 6 15
c 2 3 4 9
total 7 10 13 30
run;
required:
vertical a column total 7 need to divide with all a veriable vertical rows only similarly vertical b,c,total
Start by posting working code:
24 data have;
25 input xyz a b c total;
26 cards
27 a 1 2 3 6
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, CANCEL, PGM.
ERROR 76-322: Syntax error, statement will be ignored.
28 b 4 5 6 15
29 c 2 3 4 9
30 total 7 10 13 30
31 run;
32
33
34 GOPTIONS NOACCESSIBLE;
35 %LET _CLIENTTASKLABEL=;
36 %LET _CLIENTPROJECTPATH=;
37 %LET _CLIENTPROJECTNAME=;
38 %LET _SASPROGRAMFILE=;
NOTE: DATA statement used (Total process time):
real time 0.05 seconds
cpu time 0.00 seconds
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.HAVE may be incomplete. When this step was stopped there were 0 observations and 5 variables.
And post an example for the expected result. Your requirement is quite cryptic.
Thanks for the inputs. I'll put my efforts.
That looks like a cross tab. Why not start with the raw data and let SAS generate the report you need?
data have;
length var1 var2 $8 amount 8;
input var1 $ @ ;
do var2='a','b','c';
input amount @ ;
output;
end;
cards;
a 1 2 3
b 4 5 6
c 2 3 4
;
proc freq data=have ;
tables var1*var2 ;
weight amount ;
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.