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 are 5 ways to perform a table lookup in sas? : Sas-administrator
what are the differences between proc report and proc tabulate?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
what are all the ways to define macro variable??
2 Answers GSK GlaxoSmithKline,
What are _numeric_ and _character_ and what do they do?
What are the Aggregate functions in SQL ?
Give e an example of..
Difference b/n proc means and proc summary procedures?
Which is the best place to learn SAS clinicals and Oracle clinical in hyderabad?
What is the general format of function in sas? : sas-grid-administration
Differentiate input and infile.
do you prefer proc report or proc tabulate? Why? : Sas programming