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...


data task;
input id date date9. visit;
cards;
101 01jan2015 1
101 02jan2015 2
101 06jan2015 3
102 04jan2015 1
102 07jan2015 2
102 12jan2015 3
103 06jan2015 1
103 13jan2015 2
;
run;
write a program to find out missing dates between visits by each subject.



data task; input id date date9. visit; cards; 101 01jan2015 1 101 02jan2015 2 101 06jan2015 3 ..

Answer / chaudhary_1989

data task;
input id date date9. visit ;
cards;
101 01jan2015 1
101 02jan2015 2
101 06jan2015 3
102 04jan2015 1
102 07jan2015 2
102 12jan2015 3
103 06jan2015 1
103 13jan2015 2
;
run;

Answer

data task1;
set task;
by id;
date1=lag(date);
if first.id ne 1 then x=date-date1;
run;

proc print; run;

proc transpose data = task out = b;
var date;
by id;
run;

data new;
set b;
x=col2-col1;
y=col3-col2;
run;

proc print; run;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SAS Interview Questions

what is the difference btw proc means and proc univariate?

8 Answers   HSBC, TCS,


what are different analysis datasets you created and what are the new variables created

2 Answers   Sciformix,


what is slowly changing dimension? : Sas-di

0 Answers  


What is the difference between proportion and average?

0 Answers   KPMG,


How to select the observations randomly from a SAS dataset

7 Answers   NTT Data,


how do you derive descriptive statistics?

1 Answers   Accenture, Quintiles,


What is the Program Data Vector (PDV)? What are its functions?

5 Answers   Accenture,


what is the difference between DUPKEY and NODUPKEY???

4 Answers   Cognizant, EXL,


Will it bother you if the guy at the next desk times the frequency and duration of your bathroom or coffee breaks on the grounds that ?you are getting paid twice as much as he is??

0 Answers   Oracle,


How would you invoke a macro? : sas-macro

0 Answers  


What is the purpose of trailing @ and @@? How do you use them?

0 Answers  


what is the frontend and backend of sas? Is sas is a progaming langauge or tool? on which langauge sas depends?

3 Answers  


Categories