BookmarkSubscribeRSS Feed
Talwinder
Calcite | Level 5

Hi,

I have huge data with variable name HighPrice. How can i find highest and lowest number from the data. Have data like given below

 

HighPrice
568.45
571
604.3
619.35
612.7
629
651
650.7
652
678.9
689.9
665
664.4
666.8
627.5
619.4
627.25
650.8
663.95
642
631.9
3 REPLIES 3
Jagadishkatam
Amethyst | Level 16

Please try the proc univariate which will displays the 5 lowest and 5 highest value observation. in that the first lowest and last highest represent the lowest and highest values.

 

data have;
input HighPrice;
cards;
568.45
571
604.3
619.35
612.7
629
651
650.7
652
678.9
689.9
665
664.4
666.8
627.5
619.4
627.25
650.8
663.95
642
631.9
;

proc univariate data=have;
var highprice;
run;

 

Thanks,
Jag
Jagadishkatam
Amethyst | Level 16
Even through proc sql also you could get result

proc sql;
select min(highprice), max(highprice) into:min, :max from have;
quit;
Thanks,
Jag
ballardw
Super User

Many procedures available: proc means or summary, Proc Report or Proc Tabulate if want to make pretty output.

 

proc means data=have max min;

   var highprice;

run;

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 829 views
  • 0 likes
  • 3 in conversation