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
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 |
do you need to know if there are any missing values? : Sas programming
Approximately what date is represented by SAS date value of 730
how do you derive descriptive statistics?
1 Answers Accenture, Quintiles,
Explain the main difference between the sas procedures and functions? : Sas-administrator
what is option year cuttoff in sas
explain the key concept of sas? : Sas-administrator
how to know the attributes of first five datasets in a library
How will you react when, while consulting a SAS documentation manual to get an answer to a problem, someone says hey, I thought you were supposed to know all that stuff already, and not have to look it up in a book?
How would you identify a macro variable? : sas-macro
What is LOGICAL VARIABLES in SAS.And how it can be used..Can anyone support..???
why is a stop statement needed for the point=option on a set statement? : Sas programming
Can Some one Explain How the Datasets from SAS can be loaded in to the MVS OS?