- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can DM.RFPENDTC have a partial dates? If yes, how do we take max of a partial dates?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If this is a SAS table and the variable is numerical with a SAS Date or DateTime format attached (=how SAS stores dates) then no, because such dates are counts of days since 1/1/1960 or datetime values are counts of seconds since 1/1/1960 and such counts can't be "partial".
If the variable is of type character then yes, the string could be partial and you would need to convert it to a SAS date or datetime value before you can derive the max - and if and how SAS can convert partial date strings to a SAS date value is documented (look at informats for dates and datetimes).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Are you talking about CDISC datasets?
I think the C in the DTC suffix stands for CHARACTER.
To find the maximum or character strings in YYYY-MM-DD order you can just take the MAX() since strings in that pattern when sorted lexigraphically will also be sorted chronologically. Note that will treat partial dates as being before any actual date in that month (or year) since spaces are less than digits.
If you want to use some other algorithm then you will need to convert the partial dates into actual dates. For example it is common to pick the middle of the interval. So the 15th if the day of the month is missing. June if the month is missing. This could yield a different maximum than sorting the partial date strings lexigraphically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If N a reason has to be selected, such as AE, Pregnancy during the study, protocol violation and so on.
If this information is not available, you’ll have to create a temporary variable storing numeric dates representing the date of last contact. For example if a date is “2024-03” you’d have to create a temporary numeric date such that it would represent “2023-03-01” then use this temporary date to do your calculations. You can still use the partial date to populate RFPENDTC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content