BookmarkSubscribeRSS Feed
amsa1996
Fluorite | Level 6

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?

 

3 REPLIES 3
amsa1996
Fluorite | Level 6

It has to have a value >0 at decleration rejected** 

Shmuel
Garnet | Level 18

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;

 

amsa1996
Fluorite | Level 6

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!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 595 views
  • 1 like
  • 2 in conversation