Editor’s note: This is part 1 of a 3-part series that describes the use of RDz for doing z/OS Assembler development. Parts 2 and 3 will be published some time in early 2016

If COBOL and PL/I are software languages from I/T’s Jurassic period, then Assembler programming (even its bespoke nephew HLASM (High Level Assembler) – must be from the Cambrian/pre-Cambrian period. Hard to believe that anything written in a language that old is actually alive and running – in production – on z/OS … right?

Ummmm…. no. There’s actually lots of Assembler out there. Sometimes it’s a bunch of fast and highly-efficient utilities and subroutines called by COBOL, PL/I and 4GLs like CA-Ezetrieve . Other times it’s fast and highly-efficient application code – providing sub-second response time for apps like airline reservation systems, etc. And of course I/O device drivers and such are virtually all written in Assembler (because they need to issue privileged and semi-privileged control instructions). In the 8 years that I’ve been working with z/OS shops doing consulting and training, over 90% of them are actively coding and maintaining application components in Assembler. As they say in metro NYC – “go figure”. As they say in the “C Suite” – about those fast/economical Assembler applications… I’ll drink to the R.O.I.

Who’s doing all this Assembler work?
So – while the art of Assembler programming hasn’t gone the way of the Velociraptor – it’s not like there are as many Assembler programmers as there are; COBOL, PL/I – or virtually any of the common z/OS application languages. Why then would IBM sink time & money into Assembler features for its flagship IDE (RDz)? Good question – but as I used to tell my classes, I’ll answer any questions, except for questions that starts with the word “Why”. So let’s begin a question with “what” -More to the point; What can RDz do for Assembler programmers?

Part 1 – RDz and Assembler
RDz’s Assembler support extends across the entire software lifecycle. There are Assembler-specific features in RDz for: Analysis, Edit, Build, Test and Debug… and if you combine RDz with UrbanCode, RDz’s support carries over into deployment. While RDz’s Assembler feature/function is not as deep it is for PL/I and COBOL, it’s still head-and-shoulders above ISPF … and (as far as we know) the only Eclipse IDE with rich Assembler tooling.

In this issue we’ll focus on RDz’s Assembler Analytic capabilities. In January we’ll continue with Coding/Syntax Check/Compile/Link and Debugging Assembler.

RDz/Assembler Analysis

    RDz’s Assembler analytics include Data Flow Analysis and procedural code/structure understanding – from the standpoint of branch (i.e. Go To) statements.
    Data Flow Analysis – using Search/Pin Search View.
  • We covered Data Flow Analysis a few weeks ago for COBOL & PL/I, but discussed the “Occurrences in Compilation Unit” feature of RDz
  • Which doesn’t yet exist for Assembler files.
  • But you can still use the Ctrl+F3 search coupled with Regular Expressions to provide precise, compact views of related code+variables
  • And RDz’s Search/Text/File menu option provides the equivalent hyper-linked search results (see Figure 1) that make doing Data Flow Analysis much easier than code reading with ISPF tools.
  • Jon_7Dec2015_Fig1
    Figure 1 – Data Flow Analysis using Search/Text/File to open multiple hyper-linked Search Result Views of variable references

    To use Search/Text/File in Data Flow Analysis you; 1. Select a starting variable to search. 2. Select Search/Text/File. 3. Use the Search Results View to navigate to, and study the variable’s usage. 4. Pin the Search View and 5. Select another (related) variable and begin again.

    You can utilize as much of the RDz/Eclipse Windows/screen real estate as you can reasonably consume. That includes un-docking Search Results Views and moving them outside of the RDz Workbench or (better) – moving them to a dual monitor (the hyper-links will still work).

    Ctrl+F – Advanced Search/Replace Functionality
    Besides supporting standard ISPF Command Line Find/eXclude/NotXclude/and PF-Key searching,another option that simplifies Assembler code understanding is the Ctrl+F (Find/Replace) menu – which supports standard search options plus: Results Peek (which exposes lines above/below the found) and Regular Expressions. Regular Expressions provide a number of powerful approaches to filtering code, and pulling into view exactly (and only) the statements need to analyze

    Figure 2 shows a Ctrl+F Find command for a series of nine Assembler variables, all related through program logic

  • Of interest, the expression in Figure 2: (ap.*pcksum) – finds only lines that contain “AP” (Regular Expressions are case insensitive) and contain the variable “PCKSUM”.
  • This “Logical AND” expression is extremely difficult to achieve using ISPF. And for doing analysis work on large source Logical And – and the rest of the Ctrl+F find functionality will save you time & effort.
  • Jon_7Dec2015_Fig2
    Figure 2 – Analyzing Assembler Label usage with Ctrl+F3/Find using Regular Expressions

    Program flow analysis – Assembler program structure
    For understanding the branching instructions RDz provides a filter that exposes all Assembler branching constructs – plus the program labels they reference. This Branch instructions… filtering feature as well as other code-clarifying options are available from the Context Menu Filter View (Figure 3).
    Jon_7Dec2015_Fig3
    Figure 3 – The Assembler editor’s Filter View options

    The Filter View provides Context Menu filtering support for analysis requirements such as:

  • Show me only all of the Assembly instructions (DC, EQU, USING statements, etc.)
  • Show me only all of the Assembler branch instructions – and the labels they reference (making it easier to grasp the program’s control flow)
  • Show me only all of the Comments/Macros/Embedded SQL – or Embedded CICS, etc.
  • Note that you can also combine Filter Views, taking advantage of RDz’s superior Windows Screen Real Estate for your code (Figure 4). By doing this you can simultaneously view multiple filters … or in the case of Figure 4 – a Filter view and the “Show all source code” view of your entire program – using the Filter views as set of: source code Rolodexes – bouncing between them and hyper-linking to points-of-interest inside of the program, in orderv to accelerate your understanding.
    Jon_7Dec2015_Fig4
    Figure 4 – Assembler Branching and Execution Analysis using Filter > Branch instructions and labels

    The Outline View for Assembler Programs
    The RDz Outline View supports Assembler programs in three ways:
    1. By single-clicking a Label or Macro RDz navigates through the source code to find the statement you’ve clicked in the Outline View
    2. By right-clicking on a Label or Macro and selecting Filter, RDz will filter out all lines in the source file that do not reference the field selected. This is analogous to an ISPF stacked command: Top ; x all ; f ABCD All (but with a single click)
    3. In RDz v9.5 the right-click Context Menu over a Macro provides an Open option – which allows you to open the Macro source into the editor much the same way that Open Copybook brings in a COBOL copybook or PL/I Include
    Jon_7Dec2015_Fig5
    Figure 5 – Navigating within your source program using the Outline view

    Jon_7Dec2015_Fig6
    Figure 6 – Assembler program code Filtered – using the Outline View

    As you can see from Figure 6 – the effect of Filtering on RETURN from the Outline View creates a compact display of all statements in the program containing that Label. Further, you can expand the source around the Filtered statements by:

  • Clicking the Eclipse expand circled plus sign
  • Press Ctrl+W – or from the Context Menu, selecting Show All
  • Figure 7 shows the use of opening a Macro into the Editor from the Outline View. Note that this requires RDz v9.5 or later. And note that this works with most of the IBM-supplied Macro Library source, and with User Macro Libraries – provided you’ve setup your Property Group file correctly for Macro Libraries (Assembler Tab)
    Jon_7Dec2015_Fig7
    Figure 7 – IBM Macro source file opened from the Outline View

    Net:  It’s not IBM’s intention to create RDz as an “all-things-to-all-people” product. There are many specialized areas of z/OS work that benefit from other technologies, other products and even (!!) other technologies and products from other vendors. However, when it comes to the benefits provided by RDz for z/OS application developers, consider this list: – before assuming that what you want isn’t in the box.

    3 comments on"RDz and Assembler Development – Uplifting the workflow for the oldest (and still the fastest) z/OS language – Jon Sayles/IBM"

    1. Nice article Jon!

    2. Hi, All.
      I have a doubth. I have the next two fieds:
      CAMPOA DS PL7 for assembler program
      CAMPOA = ’00 00 00 00 50 00 0F’ Namaly ‘00000500.00’

      CAMPOB DECIMAL(11, 2) For DB2 Program. 11 Bytes & 2 decimals

      Now I want to move CAMPOA TO CAMPOB, but the decimals of the field CAMPOA are not considered in the field CAMPOB becasue the assembler program consider the first field without decimlas. The question is?, How I can do this operation inside an assembler program?

    3. jsguitargeek April 10, 2018

      Hi Elteo. I’m an RDz tools technical-instructor – not an HLASM developer. I would suggest joining: http://ibmmainframes.com/ – so that you can pose that question to the Assembler experts in that forum

    Join The Discussion

    Your email address will not be published. Required fields are marked *