BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ronein
Onyx | Level 15

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;
1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star
Your VAR statement is incomplete. If you want statistics calculated from s1, s2, and s3, add those names to the VAR statement.

View solution in original post

4 REPLIES 4
Astounding
PROC Star
Your VAR statement is incomplete. If you want statistics calculated from s1, s2, and s3, add those names to the VAR statement.
PeterClemmensen
Tourmaline | Level 20

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;
Ronein
Onyx | Level 15
and you forgot to add s1 s2 s3 to var statement
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1094 views
  • 3 likes
  • 4 in conversation