BookmarkSubscribeRSS Feed
C_Ishihara
Calcite | Level 5

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;

4 REPLIES 4
FriedEgg
SAS Employee

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

C_Ishihara
Calcite | Level 5

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

Thanks,

Cavett 

FriedEgg
SAS Employee

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

M_Maldonado
Barite | Level 11

@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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 4 replies
  • 2270 views
  • 5 likes
  • 3 in conversation