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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

In ARRAY processing, what does the DIM function do?

1116


List out some key concept of SAS

1045


What are pdv and it functions?

1038


How to create list output for cross-tabulations in proc freq?

1064


How you can read the variables that you need?

1072


Describe the function and untility of the most difficult SAS macro that you have written.

2154


what is hash files in sas and why we are using this one in sas?

2159


How to limit decimal places for the variable using proc means?

1002


What is the difference between order and group variable in proc report?

1367


what is the effect of the options statement errors=1? : Sas programming

1003


What is the maximum length of the macro variable?

1133


What are the new features included in the new version of SAS Programming Language?

1152


how would you determine the number of missing or nonmissing values in computations? : Sas programming

1095


what are sas bi dashboard components? : Sas-bi

1115


How long can a macro variable be? A token? : sas-macro

1159