BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
gzhiwei
Calcite | Level 5

Hi all,

 

I am new at SAS Enterprise Miner 14.1. 

 

I would like to do a replacement of values for a variable of the value of another value is 0.

 

E.g.

Car Ownership (Binary)

Car Value (Interval)

 

I would like to clear the Car Value value for all rows that Car Ownership = 0.

 

Thank you.

 

Regards,

Zhi Wei

1 ACCEPTED SOLUTION

Accepted Solutions
MikeStockstill
SAS Employee

Hello Zhi Wei -

 

By "clear the value", it sounds like you mean that you want to replace car values of 0 with a missing value.

 

One approach is to connect a SAS Code node to your flow, and write code to perform the replacement.  Select the Code Editor property of the SAS Code node, and try code like this (let car_value be the variable name that corresponds to 'car value'):

 

data &em_export_train;
  set &EM_IMPORT_DATA;
  if car_value=0 then car_value=.;
  run;

 

After the SAS Code node, continue your modeling flow.

 

Some customers prefer to perform re-coding in the ETL process that prepares the SAS data set before it is used in Enterprise Miner, rather than performing the re-coding in Enterprise Miner.  Use whichever approach you prefer.

 

Have a good week!

View solution in original post

1 REPLY 1
MikeStockstill
SAS Employee

Hello Zhi Wei -

 

By "clear the value", it sounds like you mean that you want to replace car values of 0 with a missing value.

 

One approach is to connect a SAS Code node to your flow, and write code to perform the replacement.  Select the Code Editor property of the SAS Code node, and try code like this (let car_value be the variable name that corresponds to 'car value'):

 

data &em_export_train;
  set &EM_IMPORT_DATA;
  if car_value=0 then car_value=.;
  run;

 

After the SAS Code node, continue your modeling flow.

 

Some customers prefer to perform re-coding in the ETL process that prepares the SAS data set before it is used in Enterprise Miner, rather than performing the re-coding in Enterprise Miner.  Use whichever approach you prefer.

 

Have a good week!

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 13046 views
  • 0 likes
  • 2 in conversation