Example 9.12 Creating a SAS Time Value from a Character Value
Goal
Read a character value that cannot be read with an existing SAS time informat or function to create a SAS time value.
Example Features
Featured Step | PROC FORMAT and DATA step |
Featured Step Options and Statements | PICTURE format, INPUT and PUT functions |
Input Data Set
Data set INCIDENTS has power supply information for five incidents. Character variables IN_NOTED and RESP_NOTED records the times each incident was noted and responded to. The time values are not stored in a way that can be read with a single time informat.
INCIDENTS Obs location type in_noted resp_noted 1 SW009A Surge 33.49 38.01 2 N0003Q Drop 9:13.69 12:15.02 3 ESE01C Transformer 8:00:00.33 10:21:06.43 4 NW503K ...
Get Combining and Modifying SAS® Data Sets: Examples Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.