Previous Topic: 3.1.2.1.4 Controlling Summarization (SUMBY and SUMTYPE)

Next Topic: 3.1.2.1.6 Generating Reports & SAS Listing Options (RMFPP)

3.1.2.1.5 Selecting Data (SELECT)

During the creation of the work files used to generate the
reports, user specified SAS code may be included to modify or
subset the data.  These program statements are specified by
means of a SAS global variable assignment statement.  The
statement is optional, but if specified must be present after
the //CONTROL DD *  statement in the report JCL.  The format
of the statement is:

    %LET SELECT = %STR(SAS program code;);

No validity checking is done on the defined code.  If the
user code contains syntax or logic errors, the report job
will either terminate abnormally or will produce
unpredictable results.

Note the use of the %STR MACRO function.  This allows the use
of semicolons as statement terminators within the SAS code
being defined; otherwise, the first semicolon found within
the code terminates the global assignment statement.

Be sure to include both the semicolon that terminates the
last SAS statement that is part of the data selection or
modification code as well as the semicolon used to terminate
the assignment statement.


Examples:  %LET SELECT = %STR(IF SYSID="SYS1";);
           %LET SELECT = %STR(IF DEVTYPE=:"3380";);