Operating Systems

z/VSE: Using DITTO With REXX

2 Pages

REXX for VSE wasn’t as widely used when it was first developed in the early ’90s, but in recent years, users have really taken advantage of its many facilities. Numerous REXX procedures have been written to interface with almost every facility and to accomplish a variety of tasks, including console managers, storage analysis routines, z/VSE library access tools, VSAM list catalog enhanced reports, CICS transaction implementers, POWER command interfaces, and many other REXX procedures. The z/VSE community, including IBM development personnel, has been very helpful in developing, publishing, and sharing REXX procedures.

When reviewing the vast number of REXX procedures generated for use, one seems to be missing: how to use REXX to invoke DITTO commands.

The REXX documentation certainly discusses using DITTO. In fact, Chapter 13.2.4 of REXX/VSE provides an example of ADDRESS LINK to DITTO from REXX. The examples show a tape-totape copy and a tape compare.

Many z/VSE users are unaware of the information contained in the DITTO manuals. When implementing REXX/DITTO, the DITTO manuals are the first place to look. These manuals show the DITTO-specific REXX commands that dramatically affect how easily REXX functions can be performed and how powerful the interface is between the two products.

The DITTO manuals offer much more documentation and many more examples of using REXX and DITTO. A simple search of the DITTO bookshelf for REXX will reveal more examples and information than can be consumed in one afternoon. Numerous enhancements were made to DITTO in 1999/2000 to enable REXX functionality for then VSE/ESA, now z/VSE.

A command group is available to get data from disk, tape, library, etc. and place it into a REXX stem variable or the reverse—from a stem variable to disk, tape, etc. Typically, any DITTO command containing a starting or end ing x is to or from a REXX stem variable. Examples XL – Stem variable to library, TX – tape to stem variable.

REXX running DITTO is certainly not limited to REXX type commands. REXX can invoke any DITTO command and process the output of the command. With the other DITTO interfaces to libraries, VSAM, tape, disk, etc. REXX and DITTO become an extremely powerful tool.

The DITTO/ESA Users Guide 1.2.3.2 manual contains a REXX/DITTO example using the ADDRESS DITTO function. Figure 1 uses the information from the manual to create a REXX/DITTO procedure. The example takes members from a z/VSE library and stores them in a REXX stem variable, sorts the stem variable, and lists it on a printer. The specific DITTO-related REXX statements are shown in red. Note: ARG and SAY member statements are abbreviated for space.

The CALL “DITSETUP” is required to set up DITTO’s REXX interface and must be issued prior to the ADDRESS DITTO command. Any command sent to DITTO then must have DITTO as the first five characters, followed by the actual DITTO command prefaced with a $ and its parameters. The DITTO command and parameters must be enclosed in single or double quotes. REXX variables must not be enclosed in single or double quotes.

That sounds very simple, and it is. The complexity is coding the actual command parameters, especially when variables are used in the parameters. Remember that they must be coded so that after REXX has processed them they are legitimate DITTO statements. Figure 2 shows five different statements coded to produce a correct DITTO command.

2 Pages