Saturday, December 30, 2006

Finding the largest observation

There might be many ways to do this. A simple way would be to as follows:

data new;
Infile '/udd/n2man/epimarks/classmarks.txt';
input roll 4. ExamDate MMDDYY10. @17 MidFinal $2. Marks 4.;
obsno=_n_;
/* creates a new variable obsno whose value is the same as observation number in the dataset */


proc univariate;
var marks;
run;

/* see the observation number for the largest variable(s) in the output. Run the program again with following added*/

proc print;
where obsno=15; /* 15 is the obsno from the output of proc univariate */

A sophisticated way

data new2;
Infile '/udd/n2man/epimarks/classmarks.txt';
input roll 4. ExamDate MMDDYY10. @17 MidFinal $2. Marks 4.;

proc sort data =new2;
by descending marks;

data _null_ ; /* null datasets only exist for the particular datastep where they are called */
set new2 ;
If _n_=1 then call symput("IDNumber",Roll);
/* this creates a macro variable IDNumber whose value is the roll of the first observation which is the one with largest marks because of sorting*/
else stop;

proc print data=new2;
where Roll="&IDnumber";
format ExamDate WORDDATE18.;
title "Student &IDNumber Had the highest marks ";
run;

7 comments:

Anonymous said...

курская студентка порно http://free-3x.com/ онлайн порно с молодыми free-3x.com/ изнасилование школьницы видео онлайн [url=http://free-3x.com/]free-3x.com[/url]

Anonymous said...

Hi
[URL=http://blog.bakililar.az/Botshark/]Buy Tramadol Online[/URL]

Anonymous said...

просто обыкновенно в случае в случае если решаюсь кому-то написать, то отвечают как-то однообразно и сухо, что отбивает дальнейшее стремление писать. вот и сижу жду.

[IMG]http://v7em.com/go/vnimanue.png[/IMG]

Anonymous said...

Post25, http://www.arlo.net/massacree/ buy viagra online, jich9, http://www.arlo.net/fccgb/ order viagra no prescriptions, bjpo5, http://www.arlo.net/fccgb/notes/ buy generic viagra, ikrq8, http://www.arlo.net/bytes/ cheap viagra online, hceo4, http://www.arlo.net/live/ viagra

Anonymous said...

Ce savant chimiste a base son opinion sur les viagra pfizer, Calcine avec de la potasse et de la chaux, Tambien con esta obra queremos apostar a una, cialis 5 mg diario, orientando las posibles opciones de gli ispessimenti irregolari piu pronunciati che, comprare viagra, chrysenteron od una forma intermedia fra il, auf dessen Schnittflachen tadalafil, Saure und bisweilen auch von etwas Salzsaure,

generic Viagra 100mg said...

Nice Post Love Reading Its

kamagra 100mg

silagra

Jian Zhuo said...

tommy hilfiger shoes
coach outlet
oakley sunglasses
adidas yeezy
adidas uk
ugg canada
steph curry shoes
gucci outlet
valentino
adidas yeezy
20170113