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.
Answers were Sorted based on User's Feedback
Answer / bharath
data abc1;
set qqq end=a;
if _n_=1 or a=1;
proc print data=abc1;
run;
Is This Answer Correct ? | 12 Yes | 0 No |
Answer / vishal
proc sort data=qqq;
by name;
run;
data f;
set qqq;
by name;
if first.name=0;
run;
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
Answer / ashish
data op;
set qqq end=last;
if _n_=1 or last=1 then output;
run;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / bharath
data qqq;
input name $ total;
cards;
qq 22
ww 33
qq 22
ee 44
rr 33
ww 44
;
run;
data abc;
set qqq;
if total in (22,44) and name in ('qq', 'ww');
proc print;
run;
data abc1;
set abc;
by name;
if first.name;
run;
proc print;
run;
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / singh.naveen409
proc sort data=qqq;
by name;
run;
options mlogic;
data www;
set qqq;
by name;
if first.name then serial=1
run;
data wwq (drop=serial);
set www;
if serial ne '1';
run;
Is This Answer Correct ? | 0 Yes | 5 No |
Dear all, proc means data=dsn noprint completetypes; class trtmntgroup /preloadfmt; output out=tot n=n; format trtmntgroup trtf. ; by vstgrp descending severity; run; This is the code I used for AE table. I got the values without giving the variable ‘trtmntgroup(numeric)’ in var statement. And if I give the var statement for that variable i’m getting the same values.How is that possible? What is the difference between class and var statement? Could any one explain me how does proc means work at the back end. And what is the difference between _freq_ value and N value in proc means. Thanks and regards, Rajesh.
What are common programming errors committed in sas
In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single variable)
8 Answers GSK GlaxoSmithKline,
hi here is a problem can anybody solve this? i want to report the data through third party file. by using data _null_ or proc report or macro automation process. but i want to insert the 'titles and footnotes' in between the data and also starting of 2nd and ending of 2nd and starting of 3rd and ending of the 3rd page. tell me how and write the code?
How to display duplicate observations in data?
how do you pull data from equifax?tell me the process?
0 Answers Synchrony Financial,
What is the difference between %put and symbolgen? : sas-macro
how do you read binary data in sas?
What does PROC print, and PROC contents do?
Are the preferred term counts are always equal to Body system counts? If so, Why are they equal if not why they are not equal?
explain the use of % includes a statement in sas? : Sas-administrator
Give e an example of..