Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

Enterprise Miner--SAS Code Node

Reply
Occasional Contributor
Posts: 5

Enterprise Miner--SAS Code Node

First, I admit that I am not a programmer. I use EG and EM to do most of the heavy lifting for me....I hope this forum can help me....

I am using EM 13.2 to prepare data set for text mining. I am trying to find a way to cut several process steps by using the SAS Code Node.

In EG, a conditional date statement reads (below). I need a similar code for Code Node, allowing me to define my data set before Parsing Node and Filter Node.

Accomplishing this may reduce my cycle time dramatically.

---

Updated: I was making a simple error.  Now things work great!

DATA &EM_EXPORT_TRAIN; SET &EM_IMPORT_DATA;

WHERE RECEIVE_DT>='10JAN2014'D;

RUN;

Trusted Advisor
Posts: 1,301

Re: Enterprise Miner--SAS Code Node

Posted in reply to C_Ishihara

Setup Flow:

flow.png

Look at the macro variables you have available, you will want either _TRAIN or _RAW or something similar:

code_node_macros.png

Setup you export:

code_node_exports.png note that Pass imported data sets to successors is not checked

Enter the code you want to run:

/*this shouldn't really do anything, as &_raw should change each time this node runs anyway, but the macro you have in your example performs a similar function*/

data _null_;

if exist("&_raw.") then call execute("proc sql; drop table &_raw.; quit;");

run;

proc sql;

create table &_raw. as

select t1.name,

       t1.milk,

       t1.coffee,

       t1.tea,

       t1.soda,

       t1.juice,

       t1.beer,

       t1.wine,

       t1.beverage

from &_train. t1

where t1.beverage like 'b%';

quit;

run_it.png

results.png

Occasional Contributor
Posts: 5

Re: Enterprise Miner--SAS Code Node

FriedEgg, I can still use your example on my next issue.

Thanks,

Cavett 

Trusted Advisor
Posts: 1,301

Re: Enterprise Miner--SAS Code Node

Posted in reply to C_Ishihara

Yep, looks like you figured it out on your own.  Clearly, my example is from a much older version of EMiner.

Super Contributor
Posts: 337

Re: Enterprise Miner--SAS Code Node

@friedegg thanks for jumping in! The screenshots take quite some time, very appreciated!

I didn't remember the old icons had the "$" sign. Those are so funny.

I hope you get to try some of the new stuff soon (ensemble, HPforest, boosting, etc)!

Take care,

Miguel

Ask a Question
Discussion stats
  • 4 replies
  • 826 views
  • 5 likes
  • 3 in conversation