BookmarkSubscribeRSS Feed
polingjw
Quartz | Level 8
Your right. The documentation for the NEXTRVAL=n option on proc univariate states that it

"specifies the number of extreme values that PROC UNIVARIATE lists in the table of extreme values. The table lists the n lowest unique values and the n highest unique values. By default, n=0 and no table is displayed."

I use the univariate procedure rather infrequently. Thanks for pointing out my mistake.
SASKiwi
PROC Star
Thanks for pointing out the NEXTRVAL=n option. It will still be slower to run than the ARRAY technique, but a whole lot quicker to write in the first place. My view of efficiency involves both code development and run times. This UNIVARIATE technique is an example of coding effiiciency being more important than run-time efficiency.
Ksharp
Super User
You are welcome. No man can be a perfect coder.


Ksharp
YR
Calcite | Level 5 YR
Calcite | Level 5

Thank you for sharing this code. Can you advise how using arrays to rename max_1-max_5 based on the columns where information came from?

nar_sas
SAS Employee

I tried the UNIVARIATE approach on a wide table of 7500 columns (35 rows), and UNIVARIATE ran in 300s.  All other techniques I tried on this table ran much much slower.  I think the Univariate approach is very powerful.  Here is my code just as an example.  

 

ods listing close;
ods output frequencies=_afreq;
proc univariate data=sashelp.cars NEXTRVAL=20 freq;
var _numeric_;
run;
ods listing;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 19 replies
  • 15728 views
  • 1 like
  • 10 in conversation