04-17-2015 04:01 AM
04-17-2015 04:11 AM
So what is the question? There is another option in the intck - discrete or continuous, not sure if that is what you mean. If you are just dealing with dates however, which are days since a certain date, then you can just do latest_date - first_date = number of days (you may need to add 1 depending on inclusion of base or not).
04-17-2015 04:29 AM
Your code is bogus:
RFSTDTC =input ( RFSTDTC ,YYMMDD10.);
will cause problems.
By definition, the input(...yymmdd10.) needs a character value as input and delivers a numerical value.
SAS will do a lot of the conversions for you, but dirty programming like that will come back to hit you on the head, sooner or later.
data ftgu;
set ftu ;
do until
NumDays = intck( 'day',&A,DT );
run;
is syntactically wrong and will not compile; the do loop misses an end_statement.
If it compiled after the end is added, it would do nothing, or run indefinitely in an infinite loop, because the condition will not change at all.
04-17-2015 06:54 AM
What is the question? You posted a dataset with 3 variables. 2 are numeric with a date format attached (YYMMDD10.) and the third is character with values that look like they were generated with the same format.
What does the subject of your post mean? "Difference Between two dates for all the varaiable in dataset"
From the pseudo code you posted perhaps you want to
1) convert the character variable to a date.
2) calculate the difference between it and all of the other date variables in the dataset.
data want ;
set aedata ;
RFSTDT =input ( RFSTDTC , YYMMDD10.);
format RFSTDT yymmdd10. ;
study_day = aestdt - rfstdt + 1;
aedur = aeendt - aestdt + 1 ;
run;
04-17-2015 10:49 AM
Are you doing some CDISC about AE ?
You'd better post the sample data , not attachment . And more important the output you need .
Xia Keshan