how can get the first and last observations in a dataset
using Proc SQl?

Answer Posted / venkatesh layam

crate one data in sql with adding of new var (a = 1) and
sort(order by) descending order by another variable and
take distinct of a (newvar-which is already created) --then
u wil get last observation.

next do ascending and get first obs ,then union these two
data sets .u will get first and last obs.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i want for interview question & answer plz it need immediate send t my mail raviprakashmot@gmal.cm

1846


Give some ways by which you can define the variables to produce the summary report (using proc report)?

602


Describe 5 ways to do a “table lookup” in SAS?

701


Explain what is SAS informats?

627


Mention few capabilities of sas framework.

696






What would you change about your job?

1929


I have a dataset concat having variable a b & c. How to rename a b to e & f?

583


What areas of SAS are you most interested in?

1065


For what purpose would you use the RETAIN statement?

1047


What is the maximum and minimum length of macro variable

657


What are the default statistics for means procedure?

646


What is Linear Regression?

687


what versions of sas have you used (on which platforms)? : Sas programming

586


which features do you use to check the data validations and errors? : Sas-administrator

552


where to use sas business intelligence? : Sas-bi

582