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

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
Meteorite | Level 14
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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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