---
title: "What is Data Stack in TSO Rexx"
description: "REXX in TSO/E uses an expandable data structure called a data stack to store information. The data stack combines characteristics of a conventional stack and queue. Stacks and queues are similar types..."
url: https://srinimf.com/2016/03/02/what-is-data-stack-in-tso-rexx/
date: 2016-03-02
modified: 2026-10-10
author: "Srini"
categories: ["REXX"]
tags: ["How Data Stack can be used in REXX"]
type: post
lang: en
---

# What is Data Stack in TSO Rexx

REXX in TSO/E uses an expandable data structure called a data stack to store information. The data stack combines characteristics of a conventional stack and queue. Stacks and queues are similar types of data structures used to temporarily hold data items (elements) until needed. When elements are needed, they are removed from the top of the data structure.

Related[How to Execute TSO, CLIST and REXX Commands](https://srinimf.com/2014/08/04/mainframe-tso-clist-and-rexx/)

The basic difference between a stack and a queue is where elements are added (as shown in the following figure). Elements are added to the top of a stack and to the bottom of a queue. Using a stack, the last element added to the stack (elem6) is the first removed. Because elements are placed on the top of a stack and removed from the top, the newest elements on a stack are the ones processed first. The technique is called LIFO (last in first out).

Related[Synchronous Vs Asynchronous Message-queues Working Concept to Read now](https://srinimf.com/2015/02/20/mainframe-ques-and-messages/)

Using a queue, the first element added to the queue (elem1) is the first removed. Because elements are placed on the bottom of a queue and removed from the top, the oldest elements on a queue are the ones processed first. The technique is called FIFO (first in first out).

**How Data is organized in Stack and Queue?**

![S1](https://i0.wp.com/srinimf.com/wp-content/uploads/2016/03/s1.png?resize=563%2C465&ssl=1)

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2016%2F03%2F02%2Fwhat-is-data-stack-in-tso-rexx%2F&media=https%3A%2F%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2016%2F03%2Fs1.png&description=What%20is%20Data%20Stack%20in%20TSO%20Rexx)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2016/03/02/what-is-data-stack-in-tso-rexx/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2016/03/02/what-is-data-stack-in-tso-rexx/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2016/03/02/what-is-data-stack-in-tso-rexx/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2016/03/02/what-is-data-stack-in-tso-rexx/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20What%20is%20Data%20Stack%20in%20TSO%20Rexx&body=https%3A%2F%2Fsrinimf.com%2F2016%2F03%2F02%2Fwhat-is-data-stack-in-tso-rexx%2F&share=email)
-

### Like this:

Like Loading…
