Considerations When Creating or Modifying DATA Step Score Code

How the SAS Scoring Accelerator Processes the DATA Step Score Code

The score.sas file is DATA step score code and is used as input by the SAS Scoring Accelerator. You can generate DATA step score code by using SAS Enterprise Miner, SAS Model Manager, SAS/STAT, and other SAS software.
Some SAS language elements and syntax are not supported when you create or modify your score code. Only the SAS language elements and syntax that are required to run critical data transformations and model scoring functions are available. If you use a statement or function that is not supported, an error occurs and your model is not published to the data source.
For more information, see Supported Language Elements and Syntax.

Supported Language Elements and Syntax

The following items describe the syntax that is supported:
  • all forms of DATA step array brackets (‘[‘. ‘{‘, ‘(‘).
  • declaration statements using LENGTH.
    This means declarations including lists of variables with the standard DATA step numeric or character length specifications (for example, 8 and $32).
  • attribute statements, although these have no semantic meaning.
    Only the syntax is supported. That is, you do not get a syntax error for them.
  • array statements and array initializers.
    This includes both temporary and variable arrays. For variable arrays, DATA step aliasing variables are available. However, these variable arrays are implemented literally as array references instead of as variable aliases as in the DATA step.
  • standard control structures, including IF, THEN, ELSE, DO, WHILE, UNTIL, SELECT/WHEN/OTHERWISE, CONTINUE, LEAVE, RETURN, LINK, and GOTO.
    The standard do i = 1 to n syntax is supported. WHILE and UNTIL are also supported. However, features such as list syntax, do i= 1,3,5, are not supported.
  • STOP and RUN are syntactically supported but have no semantic meaning.
  • assignment statements using arrays and scalars.
  • SUBSTR references, including left-hand-side 'pseudo' substring.
  • basic syntax for the PUT statement using lists of variables.
    Line and column controls are not supported.
  • DROP, FORMAT, and LABEL statements.
    FORMAT and LABEL syntax is supported, but the format or label information is not used.
    DROP is supported both syntactically and semantically. Dropped variables are made into local variables and are not included in any output table. Basic lists of variables are supported for DROP. Some syntax is supported for variable enumeration such as drop A1-A3. Colon syntax (A:) is not supported.
  • variable array syntax, variable range lists, and OF lists (for example, a1-a10 and sum(of a[*])).
  • all DATA Step expressions.
  • constant lists (as used in IN clauses and array initializations).
    This includes standard lists such as (1,2,3,4) and those including iterators such as (4 * 99). Array initializations are translated into DS2 array assignment statements.
  • some hash object syntax.
    This includes the basic declaration constructor and the DEFINEKEY, DEFINEDATA, DEFINEDONE, ADD, REPLACE, FIND, and CLEAR methods.
  • Format justifiers ('L', 'C', 'R') and some PUT modifiers ('?') are syntactically supported.
  • If you use the SAS Embedded Process to run your scoring model, you can use any function that is supported by the DS2 language. For more information, see “DS2 Functions” in SAS DS2 Language Reference.
  • If you use scoring functions to run your scoring model, only the following functions are supported:
    ABS
    ARCOS
    ARSIN
    ATAN
    ATAN2
    CEIL
    COS
    COSH
    DMNORM
    DMRAN
    DMINIT
    EXP
    FLOOR
    INDEX
    INT
    LEFT
    LENGTH
    LOG
    LOG10
    LOWCASE
    MAX
    MIN
    MISSING
    MOD
    N
    NMAX
    SIN
    SINH
    SQRT
    STRIP
    SUBSTR
    SUM
    TAN
    TANH
    TRIM
    UPCASE
    Note: The KLEFT, KTRIM, KLENGTH, KLOWCASE, KUPCASE, and KINDEX functions are syntactically supported by mapping each to its corresponding standard function.