Saturday, 20 February 2021

REXX Tutorial: REXX Programming Language | Mainframe REXX Tutorial | REXX Introduction.


REXX Tutorial, REXX Programming Language, Mainframe REXX

REXX - REstructured eXtended eXecutor


Welcome back to today's session on REXX Programming Language or TSO/REXX. In this session, you'll get an overview of the Mainframe REXX scripting language. Followed by REXX features and how mainframe REXX played a vital role in automating the task. Let's start today's tutorial with a question. 

Question. If I ask which all scripting languages you guys are aware of?

Few languages that most of you will think of would be Python or Perl or PHP. But, there is one more language that is REXX. It's used on IBM Mainframe to an automated daily task. REXX is the powerful and oldest scripting language available on Mainframes. 


REXX Tutorial


What is REXX?

The term, REXX stands for REstructured eXtended eXecutor. REXX is a very useful, robust, and extremely versatile scripting language. What is more shocking is REXX is actually a forerunner to all these other scripting languages mentioned above. 

Now, most of you might have this doubt that why have we not heard of it then?  

The reason being REXX is a very old language. It was developed by IBM in the 1970s. It gained popularity and was used extensively in the 1990s. It is still being used by a lot of programmers for creating tools to reduce manual efforts.

REXX is a free format scripting programming language. REXX is also available on a different computing platforms such as LINUX, DOS.

REXX Code Example. 

/**************** REXX *********************************/
SAY 'This is a my first REXX program!'

Features of REXX. 

REXX is a powerful and robust programming language. It has many other features, a couple of which are listed below:

Easy to Code and Free Formatted: 

  • REXX is a very versatile general-purpose programming language. You can easily learn and use to automate your daily task without any hassle. REXX is an English-like language you can easily read and understand the REXX program. A very simple example to demonstrate this would be: We give a command called 'SAY' to display anything on the screen and 'PULL' to actually take the input from the end-user. 
  • REXX is a free format programming language, so you're not required to learn additional formatting rules such as COBOL, JAVA, etc. Programmer can literally code from the first column in line 1 and then from the fifth column in line 2.
  • Variable type declaration is never an issue with REXX. You can directly use the variable and the first time the value is pushed to a variable it gets declared with that type.
  • REXX programs are not case-sensitive. It means, upper and lower case is treated as same. The programmer is free to use any case or mix cases as per requirements.

Full of Integrate yet Relevant Functions:

  • REXX programming language has a lot of in-built functions. You can call these functions to perform complex calculations instead of writing complex logic for easy operations. These functions include arithmetic calculation functions, search functions, formatting functions, comparison functions, etc. 

Capabilities to Debug the Code:

  • A programming language is incomplete if there is no debugging facility associated with it. It's easy to write code but it gets extremely difficult to find and fix bugs in your programs. If you tend to run REXX in the TSO/E environment and the code encounters an error, suitable messages are displayed on the screen itself. 
  • Not only this the REXX programming language even has a 'TRACE' option with which you can easily debug your code and find the errors very accurately.

Parsing Capabilities:

  • Parsing as most of you might know is the ability to split a sentence into different parts. REXX has extensive parsing capabilities for string manipulation. Most of the daily requirements are related to string manipulation. This parsing capability of REXX makes it the cream of the crop.

REXX Components:

  • REXX programming language is a combination of four components are Instructions, Inherent Functions, External Functions, and Data Stack Functions.
  • The Instructions comprised of Keyword, Assignment, Label, Null, TSO/E REXX commands, and Host Commands.
  • Inherent functions are functions that are built internally for the REXX processor and are used for various purposes.
  • External Functions are primarily provided by TSO/E and it actually interacts with the system to perform many tasks for this programming language.
  • Stack Functions are basically the functions that are used to store data for Input/ Output and other types of processing.

Conclusion:

Finally, this was all about the introduction to REXX or REXX Programming Language. In this REXX tutorial, you studied the Rexx history, features, and components of REXX. The REXX introduction tutorial is to lay the foundation for the next upcoming REXX tutorials. I hope you understood the basics of REXX. Please feel free to pin down your doubts or suggestions in the comment section. See you soon in another Rexx Tutorial


►Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on - 

► Youtube
► Facebook 
► Reddit

Thank you for your support. 
Mainframe Forum™

4 comments:

  1. Is there any way that I get notifications thru my email whenever you update your blog? Your blog is amazing.

    ReplyDelete
    Replies
    1. Hi SK,

      Thanks for your message. Yes, it is possible to receive notification via email. You need to subscribe to our blog email service and you'll get notification as and when we publish new blog post.

      Thanks.

      Delete
  2. Fwiw. I've written a Rexx script on the mainframe that will generate the swagger and schemas for an API based on the input/output copybooks for the relevant program.
    Time to run? Less than a second. Time to develope? Ah, a bit longer 😀

    ReplyDelete
    Replies
    1. Hey Michael,
      That's interesting. Would you mind sharing a sample script and describing how to build such a script, if you do not mind? I'm interested in learning that.
      Thanks

      Delete