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 the difference between a PROC step and a DATA step?
What is by-group processing?
What is data _null_?
What SAS statements would you code to read an external raw data file to a DATA step?
Where do the database management systems store data and how do u import them.
what is Global Symbol table and Local symbol table?
if reading an external file to produce an external file, what is the shortcut to write that record without coding every single variable on the record
Describe a time when you were really stuck on a problem and how you solved it?
How do you add a number to a macro variable?
How to test the debugging in sas?
If you were told to create many records from one record show how you would do this using arrays and with PROC TRANSPOSE?
What is a macro routine?