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 think professionally?
In the flow of DATA step processing, what is the first action in a typical DATA Step?
what is the primary data source for the wrs? : Sas-bi
I am looking to buy a sas advance book. So any one can guide me that which one i should buy.
if we dont want to print output what we have to do..???give syntax..???
8 Answers Accenture, GSK GlaxoSmithKline,
Are you involved in writing the inferential analysis plan? Tables specfications?
How would you remove a format that has been permanently associated with a variable? ________________
How to read multiple excel sheets from a single excel file at once????
7 Answers HCL, Verinon Technology Solutions,
how to assign a macro value to a variable?
Differentiate between sas functions and sas procedures.
what is SAS/Access and SAS/Connect?what are the uses?
What is the difference Using & and && in the macro variables