z/OS TSO/E REXX Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


DELSTACK

z/OS TSO/E REXX Reference
SA32-0972-00

Read syntax diagramSkip visual syntax diagram
>>-DELSTACK----------------------------------------------------><

deletes the most recently created data stack that was created by the NEWSTACK command, and all elements on it. If a new data stack was not created, DELSTACK removes all the elements from the original data stack.

The DELSTACK command can be used in REXX execs that execute in both the TSO/E address space and non-TSO/E address spaces.

The exec that creates a new data stack with the NEWSTACK command can delete the data stack with the DELSTACK command, or an external function or subroutine that is written in REXX and that is called by that exec can issue a DELSTACK command to delete the data stack.

Examples

  1. To create a new data stack for a called routine and delete the data stack when the routine returns, use the NEWSTACK and DELSTACK commands as follows:
       ⋮
    "NEWSTACK"   /* data stack 2 created */
    CALL sub1
    "DELSTACK"   /* data stack 2 deleted */
       ⋮
    EXIT
    
    sub1:
    PUSH ...
    QUEUE ...
    PULL ...
    RETURN
  2. After creating multiple new data stacks, to find out how many data stacks were created and delete all but the original data stack, use the NEWSTACK, QSTACK, and DELSTACK commands as follows:
    "NEWSTACK"   /* data stack 2 created */
       ⋮
    "NEWSTACK"   /* data stack 3 created */
       ⋮
    "NEWSTACK"   /* data stack 4 created */
    "QSTACK"
    times = RC-1 /* set times to the number of new data stacks created */
    DO times     /* delete all but the original data stack */
      "DELSTACK" /* delete one data stack */
    END

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014