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

How do you debug and test your SAS programs?

1043


explain the proc in sas? : Sas-administrator

612


what are the types of interactive display types? : Sas-bi

647


what is enterprise guide? What is the use of it? : Sas programming

533


what is the difference between unique key and primary key? : Sas-di

589






WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?

2260


what is the Population you used in your project, is it ITT or PP?

2175


what are the component of range? : Sas-bi

612


What are the data types does SAS contain?

647


how does sas handle missing values in assignment statements? : Sas programming

565


what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming

717


How to include or exclude specific variables in a data set?

637


Explain translate function?

625


what are the scrubbing procedures in sas? : Sas programming

825


is data integration and etl programming is same? : Sas-di

570