how do i get last 10obs from a dataset when we don't know
about the number of obsevations in that dataset?

Answer Posted / shiva

data a;
do i=1 to 100;
output;
end;
run;

data data1;
set a nobs=tot;
if _n_ gt( tot-10) then output data1;
run;

Is This Answer Correct ?    20 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is change analysis in sas di ? : Sas-di

607


what is slowly changing dimension? : Sas-di

628


How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?

2387


if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation

1169


what is the one statement to set the criteria of data that can be coded in any step? : Sas programming

653






Describe the function and untility of the most difficult SAS macro that you have written.

1731


How to limit decimal places for the variable using proc means?

606


What are the default statistics that proc means produce?

606


What are the ways to do a “table lookup” in sas?

595


Describe the function and utility of the most difficult SAS macro that you have written?

2027


What are the differences between proc means and proc summary?

605


What are the uses of sas?

709


Differences between where and if statement?

586


how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?

2293


what is null hypothesis? why do you consider that?

2425