The FUNCTION
variable supports several programming functions that manipulate the
internal coordinates and provide other utility operations. Several
of these functions use the LIFO stack to track and set variable values.
The LIFO (last-in-first-out)
stack is a storage area where you can keep internal coordinate values
for later use. It is useful when you want to save the current values
of (XLAST,YLAST) and (XLSTT,YLSTT) and use them with functions later
in the DATA step.
You store and retrieve
values from the stack using the PUSH and POP functions. The PUSH function
copies the current values of XLAST, YLAST, XLSTT, and YLSTT onto the
stack. The POP function copies values from the stack into XLAST, YLAST,
XLSTT, and YLSTT.
LIFO stacks manage the
stored data so that the last data stored in the stack is the first
data removed from the stack. This means that a POP function retrieves
the values most recently stored with a PUSH function.
Using PUSH and POP to Store and Retrieve Coordinate Values illustrates how PUSH and POP functions work together.