Desktop productivity for business analysts and programmers

SAS EG crashes when attempting to score model

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

SAS EG crashes when attempting to score model

Hi,

 

SAS EG is crashing for me when I want to use the score model node.

 

The model is built in Miner and packaged and deployed in Model manager. 

 

When I add the score model node in SAS EG, it takes a while to apply the selected model from the repository (10 min!) and the PC gets very worked up.

 

After mapping the variables and selecting exports and trying to run the export, I get the following pop-up

 

Exception of type 'System.OutOfMemoryException' was thrown.


-------------------------- Technical Information Follows --------------------------

Exception Details:
----------------------------------------
Exception type: System.OutOfMemoryException
Message: Exception of type 'System.OutOfMemoryException' was thrown.
Source: mscorlib
Target Site: ToString

Stack Trace:
at System.Text.StringBuilder.ToString()
at System.IO.StreamReader.ReadToEnd()
at SAS.EG.Tasks.TaskSDK.TaskModel.WriteXml(Boolean verbose)
at SAS.EG.Tasks.TaskSDK.TaskModel.get_XmlState()
at SAS.Shared.AddIns.Management.AddInProxy.get_XmlState()
at SAS.EG.ProjectElements.EGTask.MarshaledReadXmlState()
at SAS.EG.ProjectElements.EGTask.ReadXmlState()
at SAS.EG.ProjectElements.EGTask.Show(IWin32Window Owner)
at SAS.EG.MainForm.AddTask(Guid taskGuid, Element inputData, Boolean bIsWizard, String xml, String templateName, String templateNameFullPath)
at SAS.EG.MainForm.LaunchTask(Element target, Guid taskGuid, Boolean bIsWizard, String xml, String templateName, String templateNameFullPath)
at SAS.EG.MainForm.OnTaskClick(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 


Accepted Solutions
Solution
‎08-21-2017 10:30 AM
Community Manager
Posts: 3,463

Re: SAS EG crashes when attempting to score model

From what I remember (again, not my area), the score code is often a part of a SAS program, but not a complete runnable item.  What the EG task does is create the "header" part of the DATA step (to map columns) and then append score code (which has all of the rules from your EM model).  You would need to create a code node that does the same thing.  That's why I suggested trying the task with a less complex model (if you have one handy) and use it as a template.

View solution in original post


All Replies
Occasional Contributor
Posts: 6

Re: SAS EG crashes when attempting to score model

Forgot to mention, running 32bit EG 5.1, model built on EM 12.1. Machine is 64bit, with Win 7 and 16GB of ram and SSD.

Community Manager
Posts: 3,463

Re: SAS EG crashes when attempting to score model

I'm guessing this must be a very large model -- lots of variables and rules.  SAS EG is trying to load this into the Scoring task UI so that you can select variables to map.  Any idea how many variables?

 

You might need to write the score code -- the step that runs the score model -- by hand.  Later versions of EG might be a bit more robust in the extreme memory handling, but I'm not sure.  And if there are LOTS of variables to map you might find the UI to be overkill anyway.  

 

Do you have smaller models that work well?  You might be able to model your code in EG based on what the task generates for those.

 

If I'm way off, and the model is NOT all that large, then I think you should track this with SAS Tech Support.

Occasional Contributor
Posts: 6

Re: SAS EG crashes when attempting to score model

Posted in reply to ChrisHemedinger
Hi Chris,

might be the case. It's worrying the read what you wrote about the robustness of EG. I might then put back the scoring in EM but there it's more tricky (12.1) to export back scores to the datawarehouse (Oracle) because manual re-write doesn't sound to be the best way to spend my time. Any tip in the SAS code for exporting scores from EM to Oracle?

Thanks, Ivan
Community Manager
Posts: 3,463

Re: SAS EG crashes when attempting to score model

It's not my area of expertise, but if the data is in Oracle you might look into in-database scoring, which can score the data without moving the data from the database.  The built-in EG task won't help with that, but the scoring might happen a lot faster. 

 

EG will happily submit and run your large score models from a code node.  The heavy lifting will be done by the SAS session (and maybe be I/O bound by your database access).  But this Scoring task has the additional constraint of loading a large model defintion into its UI for mapping.

Occasional Contributor
Posts: 6

Re: SAS EG crashes when attempting to score model

Posted in reply to ChrisHemedinger
Hi Chris,

I tried exporting the score code (SAS version) from EM and apply in EG as a SAS code (attach right after the scoring dataset) but got tons of errors. I was hoping that to be the workaround but perhaps I am missing something.

Br,
Ivan
Solution
‎08-21-2017 10:30 AM
Community Manager
Posts: 3,463

Re: SAS EG crashes when attempting to score model

From what I remember (again, not my area), the score code is often a part of a SAS program, but not a complete runnable item.  What the EG task does is create the "header" part of the DATA step (to map columns) and then append score code (which has all of the rules from your EM model).  You would need to create a code node that does the same thing.  That's why I suggested trying the task with a less complex model (if you have one handy) and use it as a template.

Occasional Contributor
Posts: 6

Re: SAS EG crashes when attempting to score model

Posted in reply to ChrisHemedinger
Hi Chris,

thanks, you've given me some options to explore.

These type of solutions always make me feel that SAS is capable but equally non-intuitive or well-documented. But that's the long week filled with EG crashes talking.

Have a great weekend!

/Ivan
Occasional Contributor
Posts: 6

Re: SAS EG crashes when attempting to score model

Posted in reply to ChrisHemedinger

Hi Chris,

 

so to just come back and verify, yes, I used your suggestion as a solution (EG does template / EM optimized source score code embed for the more complex model).

 

Thanks again for your great help!

 

Ivan

☑ This topic is solved.

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

Discussion stats
  • 8 replies
  • 372 views
  • 2 likes
  • 2 in conversation