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 a method to debug and test your SAS program?
what versions of sas have you used (on which platforms)? : Sas programming
What is run-group processing?
Name few SAS functions?
Explain what is data step?
This entry was posted in General. Bookmark the permalink. Post a comment or leave
How to specify variables to be processed by the freq procedure?
What is the difference between proportion and average?
Differences between where and if statement?
List out some key concept of SAS
What is maximum storage capability of SAS?
What are the difference between the sas data step and sas procs?
If you use a symput in a data step, when and where can you use the macro variable? : sas-macro
explain the concepts and capabilities of business object? : Sas-bi
what is hash files in sas and why we are using this one in sas?