Help using Base SAS procedures

ID statement in PROC SUMMARY

Reply
Frequent Contributor
Posts: 89

ID statement in PROC SUMMARY

dear all,
i am using a PROC SUMMARY to calculate the MAX value per year/week.
I also want to know in which week this max value occured so i tried to
use the ID statement.
But this does not work because the proc gives me the max week for the
specified group.
This is also stated in the sas help!!

How can i get my wanted info (without writing datasteps of course ;-)


GreetZ,
Herman
Super Contributor
Super Contributor
Posts: 3,174

Re: ID statement in PROC SUMMARY

Your CLASS or BY statement must also include some SAS variable(s) to identify the year/week (likely a week-start date). The ID statement is not for this purpose, I would say.

Scott Barry
SBBWorks, Inc.
Super Contributor
Posts: 281

Re: ID statement in PROC SUMMARY

If you want to know which week (out of the 52 weeks per year) has the maximum value per year (I hope I am understanding you properly), then try the MAXID option of the OUTPUT statement.
Ask a Question
Discussion stats
  • 2 replies
  • 133 views
  • 0 likes
  • 3 in conversation