you have a data set like this.
data qqq;
input name $ total;
cards;
qq 22
ww 33
qq 22
ee 44
rr 33
ww 44
;
run;
and you want output like this.........
name total
qq 22
ww 44
Do it by data set step.
Answer Posted / alok karan
data qq;
do i=1 to n by n-1;
set qqq point=i nobs=n ;
output;
end;
stop;
proc print data=qq;
run;
/*Above is more efficient program to know the first and last observation */
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro
How to limit decimal places for the variable using proc means?
if you were told to create many records from one record, show how you would do this using array and with proc transpose? : Sas programming
what is the limit of the number of the rows and columns available in the worksheet? : Sas-bi
What is the role of unrestrictive users? : sas-grid-administration
how do you pull data from equifax?tell me the process?
How can you create a macro variable with in data step? : sas-macro
what is operational data and operational system? : Sas-di
What is the difference between proportion and average?
What does the RUN statement do?
Differentiate between format and informat? : sas-grid-administration
What would be the value of month at the end of data step execution and how many observations would be there?
How would you invoke a macro? : sas-macro
what do the sas log messages "numeric values have been converted to character" mean? : Sas programming
Are you sensitive to code walk-throughs peer review or QC review?