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

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)

1 ACCEPTED SOLUTION

Accepted Solutions
M_Maldonado
Barite | Level 11

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

4 REPLIES 4
art297
Opal | Level 21

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


Zachary
Obsidian | Level 7

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

M_Maldonado
Barite | Level 11

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

art297
Opal | Level 21

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

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 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
  • 1030 views
  • 7 likes
  • 3 in conversation