SAS® Real-Time Decision Manager enables you to create activities from DS2 programs. You can use these activities in decision campaigns in SAS Customer Intelligence Studio. However, if your DS2 program returns a String List (array), then SAS Customer Intelligence Studio might return an error similar to the following when you attempt to execute the associated activity:
com.sas.analytics.ph.RTDMException: Error executing activity
The following is example DS2 code that returns an array:
proc ds2 nolibs conn="driver=remts;server=localhost;port=21032;protocol=bridge;uid=fedadmin;
pwd='{SAS002}2FA3912633AAF4361AEEA0F754862866';conopts=(DSN=BASE_DSN)";
package ArrayTest /overwrite=yes sas_encrypt=yes;
method EXECUTE(in_out varchar test_array);
declare package tap_array output_test_array();
output_test_array.add('A');
output_test_array.add('B');
output_test_array.add('C');
test_array = output_test_array.encode();
end;
endpackage;
run;
quit;
This DS2 code fails with the error listed above if you use the code in an activity in SAS Customer Intelligence Studio. When this problem occurs, the SAS Real-Time Decision Manager design-time server log shows the following error:
2012-04-11 18:12:17,852 WARN 2d56ca31fa677797:-3de184d7:1367a64d37b:1b42 2d56ca31fa677797:-3de184d7:1367a64d37b:1b42
com.sas.rtdm.implementation.TestExecutor - Execution faulted:
Activity Node name: FOI2LKKG1NLBYAAC_1, Activity name: ArrayTest, Activity Method name: execute,
Input parameters: , Output parameters: array_test = [Name:array_test, Type:STRING, isArray:true, Value:null, Initial Value:[]]
Node: FOI2LKKG1NLBYAAC_1, type=activity, activityName: ArrayTest, activityMethod: execute
Node: FOI2LKKG1NLBYAAC_1, type=activity, activityName: ArrayTest, activityMethod: execute
com.sas.analytics.ph.RTDMException: Error executing activity
at com.sas.rtdm.implementation.EventExecutor.execute(EventExecutor.java:210)
at com.sas.rtdm.implementation.TestExecutor.execute(TestExecutor.java:213)
at com.sas.rtdm.implementation.engine.ActivityNode._execute(ActivityNode.java:51)
at com.sas.rtdm.implementation.engine.ActivityNode._execute(ActivityNode.java:17)
at com.sas.rtdm.implementation.engine.SchedulableNode$1.call(SchedulableNode.java:86)
at com.sas.rtdm.implementation.engine.SchedulableNode$1.call(SchedulableNode.java:81)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.NoSuchElementException
at java.util.LinkedList.remove(LinkedList.java:788)
at java.util.LinkedList.removeFirst(LinkedList.java:134)
at com.sas.rtdm.implementation.activity.Array_and_Table_Encoding.decodeArrayStr(Array_and_Table_Encoding.java:152)
at com.sas.rtdm.implementation.activity.sasactivity.DS2Activity.getOutputValues(DS2Activity.java:247)
at com.sas.rtdm.implementation.activity.sasactivity.DS2Activity.handle_output(DS2Activity.java:219)
at com.sas.rtdm.implementation.activity.sasactivity.DS2Activity.execute(DS2Activity.java:113)
at com.sas.rtdm.implementation.EventExecutor.execute(EventExecutor.java:203)
... 10 more
In order to make this example DS2 code work in both Base SAS® and the DataFlux® Federation Server, change the set_type method of tap_array to check for null and blank values:
if null(array_type) or trim(array_type) = '' then do;
The workaround is required because the isNull() method in DS2 returns true for both missing and blank values in SAS® 9.2. However, the isNull() method returns false for blank values in SAS 9.3.
Click the Hot Fix tab in this note to access the hot fix for this issue.
Operating System and Release Information
SAS System | SAS Real-Time Decision Manager | Microsoft® Windows® for x64 | 5.4_M1 | 6.1 | | 9.2 TS2M0 |
64-bit Enabled AIX | 5.4_M1 | 6.1 | | 9.2 TS2M0 |
64-bit Enabled Solaris | 5.4_M1 | 6.1 | | 9.2 TS2M0 |
HP-UX IPF | 5.4_M1 | 6.1 | | 9.2 TS2M0 |
Linux for x64 | 5.4_M1 | 6.1 | | 9.2 TS2M0 |
Solaris for x64 | 5.4_M1 | 6.1 | | 9.2 TS2M0 |
*
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.