how do i get last 10obs from a dataset when we don't know
about the number of obsevations in that dataset?
Answer Posted / sumit
data new;
set old;
n = _N_;
run;
Proc sort data = new;
by descending n;
run;
Option OBS= 10;
Proc sort data = new (drop = n);
by descending n;
run;
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
Why and when do you use proc sql?
What is the function of Stop statement in a SAS Program?
For what purposes have you used sas macros? : sas-macro
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
What makes sas stand out to be the best over other data analytics tools?
what is the difference between nodup and nodupkey options? : Sas programming
Hi Friends, Am Priya,new to your forum. am looking for Interview questions on SAS Platform Administration. I searched everywhere but I couldn't find them,please can anyone help me with complete interview questions normally everyone will face in the interviews on SAS Administration. am really facing problems in the interviews,am not able to answer any of their questions. I would really appreciate all your help if you can email the complete Interview Questions to priyafeb84@gmail.com Kindly awaiting for your reply with eager
What are the difference between ceil and floor functions in sas?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
Describe what are the different levels of administrative users in sas? : sas-grid-administration
What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?
What do you know about sas data set?
What is the difference between SAS functions and procedures?
Explain proc sort?
What do the sas log messages “numeric values have been converted to character” mean? What are the implications?