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

SAS Code Node

Accepted Solution Solved
Reply
Contributor
Posts: 65
Accepted Solution

SAS Code Node

   Hi i have a plenty of regressors and  their transformed versions. I just wanto check cross correlations between them. However i am unable to find a proper way to do it on SAS Miner, so i am trying to import my data to SAS EG.

However i have  a problem with SAS Code Node, the  node which i try to write a copy of table containing regressors to my database library


But think i am making  a mistake on coding.


On training code section of SAS i am inserting the following code

DATA CRM.OZ_SUS_EXPORT_TRANS;

Set &EMWS1.STAT_TRAIN;

Run;

here  Crm.OZ_SUS_EXPORT_TRANS table is the table which i want to create on database

EMWS1.STAT_TRAIN is the training data exported from my latest sas miner node

when i run this code i am recevining a run time error

could you please help on what has worked worng


Accepted Solutions
Solution
‎12-24-2014 02:22 AM
SAS Employee
Posts: 3

Re: SAS Code Node

Posted in reply to omerzeybek

I believe your problem is an extra "&" that should not be present in your set statement.  Your code is failing because it believes that EMWS1 is a macro that needs to be resolved, not a libname.

Try the following which should run successfully:

DATA CRM.OZ_SUS_EXPORT_TRANS;

Set EMWS1.STAT_TRAIN;

Run;

In addition, I wanted to point out the Save Data node available within EM under the Utility tab.  This node was designed to do exactly what you are trying to do via the SAS Code node and it takes the responsibility of writing the code off of the user.  This node allows you to save any of the output tables from a previous node into a predefined library.

To use the Save Data node in this example, if the CRM library has been initialized, you simply need to point to this using the SAS Library Name property within the node, set All Roles=No and specify Train=Yes under the Select Roles property.  This will automatically save a copy of the STAT_TRAIN table to your CRM library.

View solution in original post


All Replies
Super Contributor
Posts: 490

Re: SAS Code Node

Posted in reply to omerzeybek

In the the train code from code editor you have two run options: run node or run code

Try run code and attach the log.

zaki

Contributor
Posts: 65

Re: SAS Code Node

Posted in reply to mohamed_zaki

Hi Mohamed

When i run the node i receive following  error log text.

Thank you very much

14393  title10;

14394  %let EMEXCEPTIONSTRING=;

14395  %let syscc = 0;

PERFORMANCE  DETAILS

15876  *------------------------------------------------------------*;

15877  * EMCODE: Generation of macros and macro variables;

15878  * To see the code generated, set the EM_DEBUG macro variable to SOURCE or _ALL_;

15879  *------------------------------------------------------------*;

15880  %let syscc = 0;

15881  %inc "/sasdata/EMiner/Pegasus_Model_V_Son/Workspaces/EMWS1/EMCODE/EMTRAINCODE.sas";

NOTE: %INCLUDE (level 1) file /sasdata/EMiner/Pegasus_Model_V_Son/Workspaces/EMWS1/EMCODE/EMTRAINCODE.sas is file /sasdata/EMiner/Pegasus_Model_V_Son/Workspaces/EMWS1/EMCODE/EMTRAINCODE.sas.

15882 +DATA EMWS1.STAT_TRAIN;

15883 +Set &CRM.OZ_PEGASUS_EXPORT_TRANS;

           -

           22

           200

WARNING: Apparent symbolic reference CRM not resolved.

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, END, INDSNAME, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

15884 +Run;

14393  title10;

14394  %let EMEXCEPTIONSTRING=;

14395  %let syscc = 0;

PERFORMANCE  DETAILS

15876  *------------------------------------------------------------*;

15877  * EMCODE: Generation of macros and macro variables;

15878  * To see the code generated, set the EM_DEBUG macro variable to SOURCE or _ALL_;

15879  *------------------------------------------------------------*;

15880  %let syscc = 0;

15881  %inc "/sasdata/EMiner/Pegasus_Model_V_Son/Workspaces/EMWS1/EMCODE/EMTRAINCODE.sas";

NOTE: %INCLUDE (level 1) file /sasdata/EMiner/Pegasus_Model_V_Son/Workspaces/EMWS1/EMCODE/EMTRAINCODE.sas is file /sasdata/EMiner/Pegasus_Model_V_Son/Workspaces/EMWS1/EMCODE/EMTRAINCODE.sas.

15882 +DATA EMWS1.STAT_TRAIN;

15883 +Set &CRM.OZ_PEGASUS_EXPORT_TRANS;

           -

           22

           200

WARNING: Apparent symbolic reference CRM not resolved.

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, END, INDSNAME, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

15884 +Run;

Super Contributor
Posts: 490

Re: SAS Code Node

Posted in reply to omerzeybek

15882 +DATA EMWS1.STAT_TRAIN;

15883 +Set &CRM.OZ_PEGASUS_EXPORT_TRANS;

           -

           22

           200

WARNING: Apparent symbolic reference CRM not resolved.

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, END, INDSNAME, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

15884 +Run;

I think you entered it wrong

It is, as you mentioned previously right ?

Message was edited by: mohamed zaki

Solution
‎12-24-2014 02:22 AM
SAS Employee
Posts: 3

Re: SAS Code Node

Posted in reply to omerzeybek

I believe your problem is an extra "&" that should not be present in your set statement.  Your code is failing because it believes that EMWS1 is a macro that needs to be resolved, not a libname.

Try the following which should run successfully:

DATA CRM.OZ_SUS_EXPORT_TRANS;

Set EMWS1.STAT_TRAIN;

Run;

In addition, I wanted to point out the Save Data node available within EM under the Utility tab.  This node was designed to do exactly what you are trying to do via the SAS Code node and it takes the responsibility of writing the code off of the user.  This node allows you to save any of the output tables from a previous node into a predefined library.

To use the Save Data node in this example, if the CRM library has been initialized, you simply need to point to this using the SAS Library Name property within the node, set All Roles=No and specify Train=Yes under the Select Roles property.  This will automatically save a copy of the STAT_TRAIN table to your CRM library.

Frequent Contributor
Posts: 115

Re: SAS Code Node

Posted in reply to omerzeybek

Susanhaller's post makes complete sense as SAS understands that as &libref..datasetname, and typically the & macro trigger would be passed to the macro processor by the word scanner to look for the value to resolve to that is stored in the global symbol table and then place the resolved code in the input stack. In your case, it is apparent there is no mention of the macro variable being created at any point before. Therefore, that simple change should work unless there are other issues.

Contributor
Posts: 65

Re: SAS Code Node

Posted in reply to naveen_srini

thank you very much . This has worked on me

Frequent Contributor
Posts: 137

Re: SAS Code Node

Posted in reply to omerzeybek

Please mark this question as answered and if you wish give them gift of points who helped you as they deserve some appreciation.

Thanks,

Charlotte

Contributor
Posts: 65

Re: SAS Code Node

Posted in reply to CharlotteCain

sorry i didnt know that awards has a real point

i have closed the inqury with correct answer badge

Thank you for tip

🔒 This topic is solved and locked.

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

Discussion stats
  • 8 replies
  • 1174 views
  • 9 likes
  • 5 in conversation