This code appears to be written in SAS and processes...
This code appears to be written in SAS and processes a dataset named rawdata
. Here's what it does, step by step:
-
Create a New Dataset (
TBD
):
Thedata TBD;
creates a new dataset calledTBD
. -
Read Data from
rawdata
:
Theset rawdata;
statement reads the data from the datasetrawdata
into the new dataset for processing. -
Add a New Variable (
TVFC_Suspended
):
The lineTVFC_Suspended = "Suspended";
creates a new variable namedTVFC_Suspended
and assigns it the constant string"Suspended"
for every observation. -
Delete Rows Based on
Follow_up_Due_Date
:
The conditionif Follow_up_Due_Date > "&suspended"d then delete;
checks whether theFollow_up_Due_Date
is greater than the SAS macro variable&suspended
(interpreted as a date with thed
suffix).- If the condition evaluates to
true
, the observation (row) is removed from the dataset. - Note: The behavior of this depends on whether the
&suspended
macro variable has been defined and its value (as a date).
- If the condition evaluates to
-
Delete Rows Based on
Follow_up_Complete_Date
:
The conditionif Follow_up_Complete_Date not in ("Overdue" "Pending") then delete;
checks whether theFollow_up_Complete_Date
variable does not have the values"Overdue"
or"Pending"
.- If
Follow_up_Complete_Date
is neither"Overdue"
nor"Pending"
, the observation is deleted.
- If
-
Output Rows Based on
ActivityDate
:
The conditionif ActivityDate > (today() - 5) then output;
checks if theActivityDate
is within the last 5 days (from today).- If this condition is true, the row is included in the output dataset
TBD
.
- If this condition is true, the row is included in the output dataset
Summary:
This code creates a filtered subset of the rawdata
dataset. It performs the following actions:
- Creates a new variable (
TVFC_Suspended
) with the value"Suspended"
. - Removes rows where
Follow_up_Due_Date
exceeds a specified macro variable date (&suspended
). - Removes rows where
Follow_up_Complete_Date
is not"Overdue"
or"Pending"
. - Keeps only rows where
ActivityDate
is within the last 5 days.
The resulting dataset is written to TBD
.