Create Code File
create_code_fileCreates SAS Intelligent Decisioning code files in DS2, Python, or SQL from provided code and an optional signature, then reports whether the code parsed.
Instructions
Create a SAS Intelligent Decisioning code file: DS2, Python or SQL.
Viya reads the signature from the code. DS2: a package with
method execute(...) — in_out parameters are outputs:
package "${PACKAGE_NAME}" /inline; method execute(double score, in_out varchar band); ... end; endpackage;. Python: def execute(score): with 'Output: band' as the first statement and
the outputs returned. SQL: {?:name:type} marks an input and
{:name:type} an output column; the result rows also come back as a
data grid.
Python cannot state types in its code, so give signature with the
dataType of every input and output, or they stay unknown; for DS2
it adds descriptions and lengths. The result's status and
errorMessage say whether the code parsed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code. | |
| name | Yes | Code file name. | |
| folder | No | Where to store it: a folder path, ``My Folder``, a folder ID or URI. Omit to use the default folder; if there is none, ask the user. | |
| code_type | Yes | ds2, python or sql. | |
| signature | No | Optional ``[{"name", "dataType", "direction", "description"}]``. | |
| description | No | Optional description. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||