Hello
What is the reason that autoname is not working?(error)
What is the way to solve it please?
data test;
input id m1 m2 m3 s1 s2 s3;
datalines;
1 1 2 3 500 1150 200
1 0 4 1 150 2000 430
2 0 0 4 396 396 789
2 10 4 8 150 170 430
3 5 8 9 100 150 240
3 6 0 1 140 270 698
;
run;
proc summary data=test nway;
class id;
output out=test2
max(m1 m2 m3) =m1 m2 m3
sum(s1 s2 s3) =s1 s2 s3;
run;
proc summary data=test nway;
class id;
var m1 m2 m3;
output out=test2
max(m1 m2 m3) sum(s1 s2 s3) / autoname; ;
run;
You're missing a few equal signs
proc summary data=test nway;
class id;
var m1 m2 m3;
output out=test2
max(m1 m2 m3) = sum(s1 s2 s3) = / autoname; ;
run;
You have been in this forum long enough, you should know by now to READ THE LOG.
69 proc summary data=test nway;
70 class id;
71 var m1 m2 m3;
72 output out=test2
73 max(m1 m2 m3) sum(s1 s2 s3) / autoname; ;
___ _
73 73
ERROR 73-322: Expecting an =.
74 run;
In this case, the LOG is extremely clear indicating how to fix this.
In fact, it should be a requirement that if there are errors in the log that you don't understand, then show us the log. If there are errors in the log, don't wait until we ask to see the log, just show the log to us every single time there are errors from now on, along with your code and data.
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.