The first command contains no variable and is passed to DITTO as coded between the quotes.
In the second statement, SERIALNO is the variable. After REXX processes the command, it will appear as INT OUT PUT=SYS001,SERIALNO=111111 and be passed to DITTO (this is assuming the value of SERIALNO was 111111).
The third command accesses a stem variable (RECORD.) and writes it to tape.
The fourth command accesses a stem variable (RECORD.), uses a variable (MEMNAME), is on two lines, and requires a space and comma at the end. The stem variable is written to PRD2. CONFIG as the value of MEMNAME.
The fifth command is similar to the fourth command except only a part of the library member name (‘LOG”CUU”. SAVE”) is variable (CUU). Therefore, if CUU=123, then the name is LOG123. SAVE.
Take note of the fact that some commands start with a double quote before DITTO while others have the single quote before the $. One or the other is required and the dependency in these cases is the ease of coding when variables are used. Naturally, all quotes are paired at the beginning and ending.
Since REXX is somewhat flexible, these command examples can probably be coded in other ways and still work. Just remember that after REXX processes the statement, it must be legal to DITTO.
The DITTO ‘SET PRINTLEN…….. ‘ command sets up a REXX stem variable (named DITTO.) to trap the DITTO command output that would normally be directed to a printer. The printer output can then be processed just as any normal stem variable. In Figure 1, the DITTO output is the SET OPTIONS and any command errors. A REXX DITTO.0=0 will clear the stem, if needed, between commands.
In Figure 1, the only probable print output would be an error message from a command error. We won’t discuss that possibility here for the sake of brevity. The LX command is a library to stem variable (RECORD.).
DITTO and REXX are a marriage made in heaven. The functionality added to DITTO to take advantage of REXX makes it just that much more powerful and flexible. All those DITTO operations that require operational decisions and interactions can now easily be logically controlled and automated with REXX.
The toolset for z/VSE continues to get stronger and richer; let’s use it, and develop it. After all, it’s included in the z/VSE software package.