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

Exporting and Replacing a SAS Data File for Use in EG From EM

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 115
Accepted Solution

Exporting and Replacing a SAS Data File for Use in EG From EM

Please view the following basic code that I put into a SAS Code Node within Enterprise Miner:

%let EXPORT_DIR_NAME = \\SAS01\sasusers\Shared\PredictiveModeling;
%let EXPORT_TABLE_NAME = ExportedContinuousData;

libname export "&EXPORT_DIR_NAME";

data export.&EXPORT_TABLE_NAME.;
  set &EM_IMPORT_DATA;
  keep _NODE_ P_BLEND_GROSS_LOAD V_BLEND_GROSS_LOAD BLEND_GROSS_LOAD PURE_PREMIUM COST_CENTER_ID;
  replace;
run;

It worked perfectly before I had the line saying replace in there, but now it just will not work.

Thank you very much in advance.

Message was edited by: Communities Admin (removed email and phone for security reasons)


Accepted Solutions
Solution
‎11-24-2014 11:30 AM
Super Contributor
Posts: 337

Re: Exporting and Replacing a SAS Data File for Use in EG From EM

I googled an example. It seems that you should use a modify statement instead of a set statement.

   SAS Replace Statement

   http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201991.htm

Zach, why do you need to use a replace statement in your SAS Code Node? This code would re-run every time you run that path on your EM diagram, wouldn't it?

I hope it helps,

Miguel

View solution in original post


All Replies
PROC Star
Posts: 7,491

Re: Exporting and Replacing a SAS Data File for Use in EG From EM

The REPLACE statement can appear only in a DATA step that contains a MODIFY statement


Frequent Contributor
Posts: 115

Re: Exporting and Replacing a SAS Data File for Use in EG From EM

Thank you. Do you have an example handy of the modify command? Or would you suggest doing it outside of the DATA step?

Solution
‎11-24-2014 11:30 AM
Super Contributor
Posts: 337

Re: Exporting and Replacing a SAS Data File for Use in EG From EM

I googled an example. It seems that you should use a modify statement instead of a set statement.

   SAS Replace Statement

   http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201991.htm

Zach, why do you need to use a replace statement in your SAS Code Node? This code would re-run every time you run that path on your EM diagram, wouldn't it?

I hope it helps,

Miguel

PROC Star
Posts: 7,491

Re: Exporting and Replacing a SAS Data File for Use in EG From EM

Since all you are doing is saving a copy of an existing SAS dataset, simply remove the line that contains the replace statement. You simply shouldn't use a replace statement for what you are trying to do.

However, since you asked, the documentation about it can be found at: SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 314 views
  • 7 likes
  • 3 in conversation