Chapter Contents


SAS Companion for the CMS Environment

Invoking a SASMACRO from the Windowing Environment Command Line

Any SASMACRO can be invoked as a SAS statement, but not directly as a windowing environment command. A SASMACRO can be indirectly invoked from the windowing environment command line by using a command-style SAS macro as an interface.

A command-style SAS macro that invokes a SASMACRO should have the following form:

%macro TRYIT/cmd parmbuff;
   submit "TRYIT &syspbuff;"
In the example, the first line begins the definition of a command-style SAS macro named TRYIT whose arguments are assigned as the value of the automatic macro variable SYSPBUFF. The second and third lines specify the execution of TRYIT SASMACRO from within the TRYIT SAS macro, by using the original arguments.

You can store this macro as you would any other SAS macro, in SAS code or in an autocall library for example, as described in the SAS Macro Language: Reference. Once the macro is defined in your SAS session, you can issue the command TRYIT on the windowing environment command line to execute the TRYIT SASMACRO.

Note:   The SAS system option CMDMAC must be in effect for SAS to recognize command-stye macros.  [cautionend]

Autocall macros that invoke the Productivity Aid SASMACROs (see Productivity Aids for Interactive SAS Sessions under CMS) are already provided for you so only the CMDMAC system option is required to use them as windowing environment commands.

Note:   The SAS system option MAUTOSOURCE must be in effect in order for you to use the autocall facility.  [cautionend]

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.