02-22-2012 01:02 AM
We are experiencing a situation where SAS Eminer does not optimize the sas code produced in the scoring node. It seems to be linked to the fact that we are inserting a SAS code node into process. The outcome is that the score node publishes the code, but it is not optimized in the sense that all the transform variables are included, instead of only the one's that are used in the final model.
I have found the following comment on the web http://support.sas.com/kb/44/249.html but our problem seems to be caused by the SAS code node rather than inserting a specific type of transform node.
08-14-2017 05:08 PM - edited 08-14-2017 05:08 PM
SAS Enterprise Miner does not 'optimize' code per say but it does monitor the variables being passed through the process so that (in general) only the code involving necessary variables is included. It is possible that some data preparation methods (e.g. Tree imputation) might require variables for imputation that were not actually used in the model. Some transformations such as principal components involve many variables that might not be used in the final model yet they would all be required if they were needed for a principal component.
In the SAS Code node, there are sections for training code and for scoring code. The code you place in the Score code section of the SAS Code node will be included in the code captured by the Score node. Are you creating new variables in the SAS Code node? If so, is it possible to create them in a standard node such as the Transform Variables node? If not, what code are you running in the SAS Code node? Please note that the Score code is designed for transformations that can be done in a single data step. If your code requires more than one data step and/or requires a procedure step, it is possible you will not be able to generate optimized score code.
If you can share your flow and the code, we could likely respond more specifically.