BookmarkSubscribeRSS Feed
Vicky_SAS
Calcite | Level 5

Can DM.RFPENDTC have a partial dates? If yes, how do we take max of a partial dates? 

4 REPLIES 4
Patrick
Opal | Level 21

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).

Tom
Super User Tom
Super User

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.

Mazi
Quartz | Level 8
DM.RFPENDTC is typically directly available in the CRF from the Subject Termination form. Are you sure this date is not captured already? Usually the Question would be “Did subject complete the study”

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.
smart_xuan
Calcite | Level 5
I agree with this.SDTM.RFPENDTC keep partial.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 274 views
  • 0 likes
  • 5 in conversation