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 |
what is pdv? how it is related to input buffer in sas?
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??
how to read raw data in sas. Do it manually and throw the programming.
what is the use of LRECL option.
how to display duplicated observations in a data using base sas.
13 Answers HCL, TCS,
is there any differnce between proc means and proc summary?
how many types of prompts are there? : Sas-bi
What are the main differences between sas versions 8.2, 9.0, 9.1?
how do the in= variables improve the capability of a merge? : Sas programming
What procedure you used to calculate p-value?
2 Answers Accenture, Quintiles,
what is sas database server? : Sas-di
what is hash files in sas and why we are using this one in sas?