BookmarkSubscribeRSS Feed
Calcite | Level 5

Hi all, I have an issue that may be born of simple ignorance. I am trying to get the Java Scoring Code from a Score Node. The C is there, Java Score is set to Y, but there is simply no option for the actual Java code. So at the moment under Java I am only getting "User-defined Formats" and "File Metadata." Does anyone know where this might be hiding? This is version 6.2 FYI.


SAS Employee

The EM Java scoring code is only available as a .class file. There is no .java file. The "Score Code" in the Results viewer is only a wrapper that calls the  "Java Class" file (DS.class) that does the actual scoring. Note, since the DS.class file is not created using a java compiler it cannot be reliably decompiled.

Calcite | Level 5

Ok, but then I am confused.  If you look at page 20 of it specifies:  


5.In the Java Score Code window, return to the list box at the bottom and change the setting from Scoring Function Metadata to Score Code.

6. From the Results window main menu, select File Save As and save the file as in the c:\temp\scorecode\jscore directory that you created at the beginning of this example.


So is that right or not?

SAS Employee

It’s close but it looks like you might have skipped a step in the instructions.

In the Java Score Code window there should be 5 choices in the drop down box.

Scoring Function Metadata

User-defined Formats

Score Code

File Metadata

Java Class

The "Scoring Function Metadata" is an XML description of the models Input variables and Output variables. It is very handy for automating things like choosing what data to feed the model when you run it. 

The "User-defined Formats" is Java code that is often just a stub unless your training data contains user defined formats.

The "Score Code" is Java code that invokes the model that is in the "Java Class".

The "File Metadata" is another XML file that describes the mime types of the other files.

The "Java Class" file is a binary java class file in which the actual model resides.  One way to think of it is as "pre-compiled" java code.


The instruction are trying to say ...

Save the "Scoring Function Metadata" as JScore.xml.

Save the "User-defined Formats" as

Save the "Score Code" as

Save the "Java Class" as DS.class.

Calcite | Level 5

Right, so that is what I am trying to do, but I only get two options in the drop down (please see attachments).  I do not want to use C, but sure, why not?  Except when I go to to download cscore.h, the link fails.  FWIW, I strongly prefer Java.  The score node is input from a decision tree, so I am not sure what I am doing wrong to get my only 2 drop downs.

SAS Employee

Something is definately wrong. You should probably contact SAS Tech Support.

In the mean time can you share a pic of your EM flow and the log from the score node?

SAS Employee
What operating system is the EM server on?
Calcite | Level 5

The OS is Linux x64.  I think this is the important part of the log:


TScore NOTE: Start Java code generation ........ 1: Could not load class java/lang/Object. 1: Could not load class com/sas/ds/DSInterface. 1: Could not load class com/sas/ds/DSInterface.
ERROR:  TScore Java code generation failed, attempting error termination.

* Warning: A problem was encountered while generating the Java score code.


Does this just mean we are missing some kind of config file?

SAS Employee
I looks like you are going to need Tech Support to figure out how to configure your system correctly. The errors indicate that the DTJ_CLASSPATH was not setup correctly when the system was installed.

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
  • 8 replies
  • 2 in conversation