?>Array ( [id] => 144 )
Scénario de test & Cas d'usage
Dieses Szenario verwendet zwei Sätze von Prototyp-Definitionen: einen gültigen Satz zur Verschlüsselung und einen absichtlich fehlerhaften Satz zur Überprüfung der Fehlerbehandlung.
| 1 | /* Gültige C++ Funktionen: |
| 2 | extern "C" double predict_churn(double tenure, int services); |
| 3 | extern "C" double score_sentiment(const char* text); |
| 4 | |
| 5 | Fehlerhafte Definition (fehlendes Semikolon und Typ): |
| 6 | extern "C" get_recommendations(int customerId) |
| 7 | */ |
| 1 | PROC CAS; |
| 2 | ACTION fcmpact.addPrototypes / |
| 3 | routineCode={"proto get_recommendations(int) link='c' return"} /* Fehlendes Semikolon und Typ */ |
| 4 | package="ML_Engine_Error" |
| 5 | funcTable={name="ml_prototypes_failed", caslib="casuser"}; |
| 6 | RUN; QUIT; |
| 1 | PROC CAS; |
| 2 | ACTION fcmpact.addPrototypes / |
| 3 | routineCode={ |
| 4 | "proto predict_churn(double, int) link='c' return=double;", |
| 5 | "proto score_sentiment(char[*]) link='c' return=double;" |
| 6 | } |
| 7 | package="ML_Engine_Secure" |
| 8 | encode=true |
| 9 | funcTable={name="ml_prototypes_secure", caslib="casuser", replace=true}; |
| 10 | RUN; QUIT; |
| 1 | PROC CAS; |
| 2 | TABLE.fetch / TABLE={name="ml_prototypes_secure", caslib="casuser"}; |
| 3 | RUN; QUIT; |
Schritt 1 schlägt wie erwartet fehl. Das CAS-Log enthält eine Fehlermeldung, die auf einen Syntaxfehler in der `routineCode`-Definition hinweist. Schritt 2 wird erfolgreich ausgeführt. Die Fetch-Aktion in Schritt 3 zeigt die Tabelle 'ml_prototypes_secure', aber die Spalten, die die Funktionsdefinitionen enthalten (_Code_, _ProtoTxt_), sind verschlüsselt und nicht als Klartext lesbar, was den erfolgreichen Einsatz des `encode`-Parameters bestätigt.