Problem Note 20195: "Statement is not valid" error running Text Miner score code with other
score code
If your SAS Enterprise Miner 4.3, Text Miner 3.1 diagram flow includes a
Text Miner node followed by other nodes which are then followed by a
Score node, running the flow will return the following error:
*************************************;
*** begin scoring code for node *****;
*************************************;
NOTE: SCL source line.
length _WARN_ $4;
------
180
ERROR 180-322: Statement is not valid or it is used out of proper
order.
The Text Miner score code contains PROCEDURE calls and DATA statements.
The error occurs because the appended score code assumes that the
previous code DATA step code only.
Work-around example
IDS_t - Input Data Source node pointing to Training data
IDS_s - Input Data Source node pointing to Scoring data
TM - Text Miner node
S - Score node
DSA - Data Set Attributes node
Tree - Tree Node
NN - Neural Network node
Suppose your flow is as follows:
ORIGINAL FLOW
IDS_t -> TM -> Tree -> NN -> S
^
|
IDS_s
In order to correctly score the data, you will need to re-write your
flow as two flows.
FIRST FLOW
IDS_t -> TM -> DSA
^
|
IDS_s
1. Add an Input Data Source. Read in your training data set (for
example EMDATA.STRNNC2T). Specify the desired variable roles and
measurement levels.
2. Add a second Input Data Source. Read in your score data set (for
example EMDATA.SSCR7XT). Specify the desired variable roles and
measurement levels.
3. Add a Text Miner node. Connect both data sets to the Text Miner
node. (Change any properties in the Text Miner node that are
appropriate for your analysis.) Run the Text Miner node.
4. Add a Data Set Attributes node. On the Data tab, choose the Train
and Predict (score data) data sets. Close the node (you do not need to
run it).
SECOND FLOW
IDS_t -> Tree -> NN -> Score
^
|
IDS_s
5. Add a third Input Data Source node. Read in the training data set
found in the Data Set Attributes node (for example EMDATA.STRNNC2T).
Specify the desired variable roles and measurement levels. Make sure
that the text variable, which was an INPUT variable in the first Input
Data Source node, is set to REJECTED in the third Input Data Source
node.
6. Add the Tree, Neural Network, and Score nodes. On the settings tab
of the Score node, select "Apply training data score code to score data
set." Close the node and save changes.
7. Add a fourth Input Data Source. Read in the score data set found in
the Data Set Attributes node (for example EMDATA.SSCR7XT). Specify the
desired variable roles and measurement levels. Make sure that the TEXT
variable, which was an INPUT variable in the second Input Data Source
node, is set to REJECTED in fourth Input Data Source node.
Now you can run the Score node. This will correctly score your data.
Operating System and Release Information
| SAS System | SAS Text Miner | Microsoft Windows XP Professional | 5.2 | | | |
| Microsoft Windows Server 2003 Standard Edition | 5.2 | | | |
| Microsoft Windows NT Workstation | 5.2 | | | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 5.2 | | | |
| Microsoft Windows Server 2003 Enterprise Edition | 5.2 | | | |
| Microsoft Windows Server 2003 Datacenter Edition | 5.2 | | | |
| Microsoft Windows 2000 Datacenter Server | 5.2 | | | |
| Microsoft Windows 2000 Professional | 5.2 | | | |
| Microsoft Windows 2000 Server | 5.2 | | | |
| Microsoft Windows 2000 Advanced Server | 5.2 | | | |
| Solaris | 5.2 | | | |
| 64-bit Enabled Solaris | 5.2 | | | |
| 64-bit Enabled AIX | 5.2 | | | |
| AIX | 5.2 | | | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Problem Note |
| Priority: | medium |
| Topic: | Analytics ==> Text Mining
|
| Date Modified: | 2007-06-26 08:51:40 |
| Date Created: | 2007-05-11 09:27:06 |