how to obtain last ‘n’ observation from a dataset—
The step to obtain last observation can be done in data step by using the following code since there are no options for obtaining last ‘n’ observations (like obs which indicates last obs to be read starting from first and firstobs which indicates starting obs , there is no lastobs option which takes us to the last starting from any observation in between)
data data1;
set vikas.health_data nobs=tot;
if _n_ gt( tot-5) then output data1;
run;
outputs—
Obs subj dob visitdate lastdate age agetoday
1 011 21FEB1980 16APR1960 28OCT2001 25 13
2 012 18MAY1981 19MAY1963 20DEC2000 24 12
3 013 24JAN1983 21JUN1964 21SEP2000 22 10
4 014 25SEP1984 25OCT1968 23OCT2003 21 9
5 015 05NOV1976 27NOV1970 24NOV2006 29 17
hi, let us study how to generate different report formats in sas using different techniques and sas procedures..we will also learn how to customize the layout of the reports as per the requirement using the power of sas.. Discalimer-:This blog is for sharing the knowledge that i have gained .i do not calim the ownership of the original content that is included in the blog.SAS is a trademark of SAS ,usa.
Send link to --
SEO Court Directory
myblog
Free Web Directory - Add Your Link
The Little Web Directory
Monster Directory A List Sites
The Little Web Directory
Monster Directory A List Sites