Hi!
I have created a dummy variable as my target variable where 0 indicates that the event "payment handled" has not occured, and 1 that is have occured. Furthermore, i want to add a value "2" in my target variable indicating that the event "payment handled" has not occured due to another event called "decleration rejected". This means that the event has to have a value <0 at decleration rejected, and 0 at payment handled. Both events are extracted from the same column named, activity_id.
Can someone help?
It has to have a value >0 at decleration rejected**
If I understand you correctly than add a line:
sum(activity_id="decleration rejected") as rejected /* new dummy */
then add a new step:
data tuetravelexpenses_cases;
set tuetravelexpenses_cases;
if rejected > 0 then target_variable=2;
*drop rejected;
run;
Almost!
The value "2" requires that "payment handled" is 0, and "declaration rejected" > 0, and not only that "declaration rejected" > 0.
But i managed that by adding "and". Thanks for the help!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: