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.
Answer Posted / chaudhary_1989
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 |
Post New Answer View All Answers
what is transformation in sas data integration? : Sas-di
What is the use of PROC gplot?
Define run-group processing?
What does the RUN statement do?
Hi Friends, Am Priya,new to your forum. am looking for Interview questions on SAS Platform Administration. I searched everywhere but I couldn't find them,please can anyone help me with complete interview questions normally everyone will face in the interviews on SAS Administration. am really facing problems in the interviews,am not able to answer any of their questions. I would really appreciate all your help if you can email the complete Interview Questions to priyafeb84@gmail.com Kindly awaiting for your reply with eager
List out some key concept of SAS
What is the function of Stop statement in a SAS Program?
What system options would you use to help debug a macro? : sas-macro
How does proc sql work?
why a stop statement is needed for the point= option on a set statement?
explain about sas business intelligence? : Sas-bi
What are the functions which are used for character handling functions?
how will you location sas platform applications available from web browser? : Sas-bi
How to limit decimal places for variable using proc means?
Of all your work, where have you been the most successful?