Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



you have a data set like this. data qqq; input name $ total; cards; qq 22 ww 33 qq 22 ee 44 ..

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

you have a data set like this. data qqq; input name $ total; cards; qq 22 ww 33 qq 22 ee 44 ..

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

you have a data set like this. data qqq; input name $ total; cards; qq 22 ww 33 qq 22 ee 44 ..

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

you have a data set like this. data qqq; input name $ total; cards; qq 22 ww 33 qq 22 ee 44 ..

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

you have a data set like this. data qqq; input name $ total; cards; qq 22 ww 33 qq 22 ee 44 ..

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

you have a data set like this. data qqq; input name $ total; cards; qq 22 ww 33 qq 22 ee 44 ..

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

Post New Answer

More SAS Interview Questions

how to handle in stream data containing semicolon in it?

3 Answers  


how many data types in sas? : Sas-administrator

1 Answers  


what is the difference between informat$8. $char8.

3 Answers   SAS,


what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi

0 Answers  


explain the function of substr in sas? : Sas-administrator

0 Answers  


when we are using the PROC TRANSPOSE? OBSERVATIONS are repeated then what will happen and what it will show in log window.

1 Answers  


How would you keep from overlaying the a SAS set with its sorted version?

4 Answers  


How to display duplicate observations in data?

1 Answers  


how many display types available in sas bi dashboard? : Sas-bi

0 Answers  


what is washout period?

3 Answers   Cognizant,


What type of tables you are using in YOUR reporting..???

2 Answers   GSK GlaxoSmithKline,


what is the usage for assigning error=1 in a dataset ?

2 Answers   Satyam,


Categories