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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 19 replies
  • 15804 views
  • 1 like
  • 10 in conversation