LOCAL

Example

LOCAL specifies the variables which will be considered local to a TSP PROC. Their values will not be saved on exit from the procedure.

LOCAL <list of variables> ;

Usage

The LOCAL statement should be placed following the PROC statement to which it applies. Follow the word LOCAL with the names of variables which will be created during the execution of the PROC, but which will not be needed on exit. This can save storage space, or allow the use of duplicate names, which can be especially convenient if you wish to build a library of PROCs and don't want variable name conflicts.

Output

LOCAL produces no output.

Example

The procedure below computes moving averages of variable length LEN. The local variables LAST, which is the index of the last observation but one and LAG, the loop index, are not saved on return from PROC MA:

PROC MA X,LEN,XMA ;

     LOCAL LAST LAG ;

     XMA=X ;

     SET LAST=1-LEN ;

     DO LAG=LAST TO -1 ;

          XMA = XMA+X(LAG) ;

     ENDDO ;

     XMA=XMA/LEN ;

ENDPROC MA ;