Presentation is loading. Please wait.

Presentation is loading. Please wait.

11) Data Stacks Instructions QUEUE, PUSH. Built-in function QUEUED()

Similar presentations


Presentation on theme: "11) Data Stacks Instructions QUEUE, PUSH. Built-in function QUEUED()"— Presentation transcript:

1 11) Data Stacks Instructions QUEUE, PUSH. Built-in function QUEUED()
TSO commands and functions for work with stacks: DELSTACK, DROPBUF, MAKEBUF, NEWSTACK QBUF QELEM QSTACK Resources: TSO REXX Reference Chapter 10. TSO/E REXX Commands This course has been prepared by Milos Forman for MCoE needs only!

2 PROPRIETARY AND CONFIDENTIAL INFORMATION
These education materials and related computer software program (hereinafter referred to as the "Education Materials") is for the end user’s informational purposes only and is subject to change or withdrawal by CA, Inc. at any time. These Education Materials may not be copied, transferred, reproduced, disclosed or distributed, in whole or in part, without the prior written consent of CA. These Education Materials are proprietary information and a trade secret of CA. Title to these Education Materials remains with CA, and these Education Materials are protected by the copyright laws of the United States and international treaties. All authorized reproductions must be marked with this legend. RESTRICTED RIGHTS LEGEND TO THE EXTENT PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS DOCUMENTATION "AS IS" WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IN NO EVENT WILL CA BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, GOODWILL OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE. THE USE OF ANY PRODUCT REFERENCED IN THIS DOCUMENTATION AND THIS DOCUMENTATION IS GOVERNED BY THE END USER’S APPLICABLE LICENSE AGREEMENT. The manufacturer of this documentation is CA, Inc. Provided with "Restricted Rights" as set forth in 48 C.F.R. Section , 48 C.F.R. Sections (c)(1) and (2) or DFARS Section (c)(1)(ii) or applicable successor provisions.

3 Data Stack Stacks – a method to store data in memory without using variables. Notice the difference between stack and queue: stack works as LIFO, queue works as FIFO.

4 Data Stack - Manipulating with data
PARSE PULL PARSE EXTERNAL Use PARSE EXTERNAL to read from terminal.

5 QUEUE Queue will put the data in the stack in FIFO order.
This course has been prepared by Milos Forman for MCoE needs only!

6 QUEUE example PARSE PULL will remove the data from the stack one line at a time. The data will be pulled into a variable. It can be useful under TSO to only use EXTERNAL instead of PULL when working with stacks, PARSE PULL will go to a stack for data before the screen. See ‘MCOE.REXA.REXX(RX201114)’ This course has been prepared by Milos Forman for MCoE needs only!

7 PUSH PUSH will put the data in the stack in LIFO order.
This course has been prepared by Milos Forman for MCoE needs only!

8 PUSH example There is a mistake in this slide. It is just copy/paste from the previous one. Here should be PUSH instead of QUEUE. I prefer to use QUEUE - see ‘MCOE.REXA.REXX(FTPCOM)’ See ‘MCOE.REXA.REXX(RX201116)’ This course has been prepared by Milos Forman for MCoE needs only!

9 QUEUED() This course has been prepared by Milos Forman for MCoE needs only!

10 QUEUED() Example The QUEUED() function will return how many items are in the stack, and can be used to loop until the stack is empty. See ‘MCOE.REXA.REXX(RX201117)’ This course has been prepared by Milos Forman for MCoE needs only!

11 QUEUED() Example (cont.)
This course has been prepared by Milos Forman for MCoE needs only!

12 Multiple Buffers and Stacks
More than one stack can be used at any time, but you can only access the current stack. The current stack has to be deleted to access the stacks behind it.

13 MAKEBUF Let us look to some TSO REXX commands working with stacks.
This course has been prepared by Milos Forman for MCoE needs only!

14 NEWSTACK This course has been prepared by Milos Forman for MCoE needs only!

15 DELSTACK After the DELSTACK the previous stack is accessed.
This course has been prepared by Milos Forman for MCoE needs only!

16 DROPBUF This course has been prepared by Milos Forman for MCoE needs only!

17 DROPBUF (cont.) This course has been prepared by Milos Forman for MCoE needs only!

18 QBUF This course has been prepared by Milos Forman for MCoE needs only!

19 QBUF (cont.) This course has been prepared by Milos Forman for MCoE needs only!

20 QELEM This course has been prepared by Milos Forman for MCoE needs only!

21 QELEM This course has been prepared by Milos Forman for MCoE needs only!

22 QSTACK This course has been prepared by Milos Forman for MCoE needs only!

23 QSTACK (cont.) This course has been prepared by Milos Forman for MCoE needs only!

24 Multiple Stacks example
“NEWSTACK” creates an additional stack in front of the current stack. The newstack has to be removed before the data on the original stack can be retrieved. “DELSTACK” deletes the current stack. “QSTACK” returns the number of stacks into RC. See ‘MCOE.REXA.REXX(RX20111A)’ This course has been prepared by Milos Forman for MCoE needs only!

25 Unused Stack Data Putting TSO commands on the stack allows them to be executed on completion of the REXX program. See ‘MCOE.REXA.REXX(RX20111B)’ This course has been prepared by Milos Forman for MCoE needs only!

26 EXECIO and Stacks The data stack can be used with EXECIO instead of using STEM variables by removing the STEM option and variable. See ‘MCOE.REXA.REXX(RX20111C)’

27 Work Section 11.1 Write it and test it.

28 Work Section 11.2 Write it and test it.

29 Additional Program Write it and test it.


Download ppt "11) Data Stacks Instructions QUEUE, PUSH. Built-in function QUEUED()"

Similar presentations


Ads by Google