Setting the Macro Environment


You set the global ARM macro environment by using the _ARMACRO variable with the value of 1 or 0. The value of 1 specifies that all ARM macros occur in open code and the value of 0 specifies that the ARM macros occur only in DATA steps. You use the MACONLY= option if an individual ARM macro is not placed outside of the global environment that is defined by the _ARMACRO setting. For SCL programs, you specify _ARMSCL with a value of 1.

The following table shows the global value, the temporary option needed, and the results.

Table 6.3: Using _ARMACRO and _ARMSCL to Set the ARM Macro Environment

Global Value

Temporary Option

Result

%let _ARMACRO=0;

MACONLY=NO

macro is in DATA step

%let _ARMACRO=1;

MACONLY=YES

macro is in open code

%let _ARMSCL=1;

none

macro is in SCL

%let _ARMSCL=0;

none

macro is not in SCL

The following example shows how to set the macro environment in a DATA step:

 /* set global environment */      %let _armacro = 1;  data _null_;      %arminit(appname='Appl 1', appuser='user1',               appidvar=appl,   maconly=no   );        /* exception to global value */  run;        /* using global setting */        /* maconly= parameter not needed */      %armgtid(txnname='Txn 1A', txndet='Txn Class 1A',               appidvar=appl, txnidvar=txn1a); 

The following example shows how to set the macro environment in SCL using autoexec:

 /* set global environment */   %let _armscl = 1;   %let _armexec = 1; 

The following example shows how to set the macro environment in SCL:

 init:      %arminit(appname='Appl 1', appuser='user1',               appidvar=appl);      %armgtid(txnname='Txn 1A', txndet='Txn Class 1A',               appidvar=appl, txnidvar=txn1a);  return;  main:      %armstrt(txnidvar=txn1a,shdlvar=strt1);  return;  term:      %armstop(shdlvar=strt1);      %armend(appidvar=app1);  return; 



SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net