Previous Topic: 4.4 SAS Functions and Call Routines

Next Topic: 4.4.2 SAS Function and Call Routine MALABEL

4.4.1 SAS Call Routine GBLFCN


Name:            GBLFCN

Abstract:        Provides for the storage and retrieval of
                 CA MICS global variables. These variables
                 persist beyond the SAS Data step in which
                 they were created and are destroyed at
                 the end of the Job step.

External
Specifications:  CALL GBLFCN(action, name, value);

    The variables action, name, and value are character
    variables defined as follows:

    action - action to perform on CA MICS global variables.
             Valid values are:

             "SET"   To create or replace the value
                     associated with a variable name.

             "GET"  To retrieve the value associated with a
                     variable name.  If no match is found,
                     blank is returned.

             "PRINT" To print all variable names and their
                     associated values on the MICSLOG.

    name   - literal or variable containing a 1- to
             16-character name to be associated with a value.

    value  - a 1- to 200-character variable or literal.
             If action="SET", then value=a tag of "name".
             If action="GET", then value=the value
             associated with "name".

Sample usage:

            data _null_;
              ARG3='RMF SMF TSO CICS';
              call GBLFCN('SET', 'COMPTS', ARG3);
            run;

            data _null_;
              length VALUE $200;
              retain VALUE ' ';
              call GBLFCN('GET', 'COMPTS', VALUE);
              put VALUE=;
            run;

       The output will be:

            VALUE='RMF SMF TSO CICS'

Usage notes:

The most common coding error associated with GBLFCN is having
name or value truncated because the variable for name or
value is too short.  To avoid this problem, make the name
variable's length 16 and value variable's length 200.

SAS will give a "VARIABLE NOT INITIALIZED" message for
variables that are only set with CALL functions.  To avoid
these messages, RETAIN the value variables with a value.