how do i get last 10obs from a dataset when we don't know
about the number of obsevations in that dataset?
Answer Posted / pratik
Suppose we have dataset like sasuser.admit.
we dontknow how many obs are there in this dataset.
then we can use
Proc contents data=sasuser.admit n;
run;
it will come the total no of obs in this dataset.
after doing this you will get 21 obs are there.
data dsn1;
set sasuser.admit(firstobs=12 obs=21);
run;
proc print data=dsn1;
run;
then you will get last 10 obs.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is the command used to find missing values?
What is the basic structure of a sas program?
how to generate the test data in sas without input data? : Sas-administrator
How do you connect the desktop application to metadata server? : sas-grid-administration
Give an example where SAS fails to convert character value to numeric value automatically?
What are the implications?
What are the applications primarily used by business analyst? : Sas-bi
How to specify variables to be processed by the freq procedure?
explain the difference between proc means and proc summary?
What commands are used in the case of including or excluding any specific variables in the data set?
how to change the execute of macro
What does the trace option do?
If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable? : sas-macro
For clinical entire study how many tables will create approx?
What are common programming errors committed in sas