Previous Topic: BPXBATCH Remote Job Step for USS ObjectsNext Topic: Create a Destination


How to Tailor the Command Stream

You can tailor the command stream to your site standards, by inserting a step to tailor the file at the remote location. For example, you can insert mkdir, chown, or chgroup commands or modify the delivered un-pax command switches.

  1. Select a model for the remote JCL. The RJCLROOT parameter in the Defaults table (C1DEFLTS) determines which custom set of models is in use at your site.

    For more information about RJCLROOT, see Specifying Remote Job Stream in C1DEFLTS.

    For more information about the Defaults table, see the chapter "Using the Defaults Table" in the Administration Guide.

  2. Edit the copy step model JCL as follows:
    1. Locate the appropriate model in your CSIQOPTN library:
      • If your Defaults table specifies RJCLROOT=FCPY, use this model member: #RJFCPY1
      • If your Defaults table specifies RJCLROOT=ICPY use this model member: #RJICPY1
    2. Locate the BPXBATCH step in your model member. This step executes the command stream. A sample BPXBATCH step for #RJICPY1 is shown next:
      //*                                         
      //BPXBAT   EXEC PGM=BPXBATCH           ICPY 
      //STDOUT   DD   SYSOUT=*                    
      //STDERR   DD   SYSOUT=*                    
      //STDPARM  DD   DISP=SHR,                   
      //         DSN=&RUCD                       
      
      
      DSN=&RUCD

      Resolves the name of the remote command file.

    3. Insert steps before the BPXBATCH step to invoke your modification code according to your needs.

Example: Remote Command File Edited for REXX

Suppose that you want to have a REXX program read in the current command stream from SYSUT1 and then write the customized stream to SYSUT2. To accomplish this result, you would insert the following code before the BPXBATCH step in your model member:

//*********************************************************** //* SAMPLE TAILOR UCD COMMAND STREAM //*********************************************************** //UCDEDIT EXEC PGM=IRXJCL,PARM='UCDEDIT' //SYSEXEC DD DISP=SHR,DSN=BST.SUPPNDVR.ISRCLIB //SYSUT1 DD DISP=SHR,DSN=&RUCD //SYSUT2 DD DISP=SHR,DSN=&RUCD //SYSPRINT DD SYSOUT=* //SYSTSPRT DD SYSOUT=* //***********************************************************

The following sample REXX exit (UCDEDIT) illustrates the key requirements of your command stream tailoring. The program must read in the existing command stream and write out the tailored stream. The program reads the input from SUSYT1 and writes the tailored output to SYSUT2. This exit performs a simple string search and replace to amend (insert) an extra switch in the pax command.

/* Rexx to read from Sysut1 and write to Sysut2 (like IEBGENER) However, this version is a bit special in that it also performs some string substitutions. It's intended to allow a customer to edit their USS Ship command stream at the remote location changing the pax command parms or saving some commands to be executed later. */ frmstr = 'pax -rvzk' /* This is what we're looking for */ tgtstr = 'pax -rvzk -p op' /* and we'll replace it with this */ /* Read input file (BPXBATCH commands) */

"EXECIO * DISKR SYSUT1(STEM DATA. FINIS" IF RC ¬= 0 THEN SIGNAL IOERROR

/* Main loop to search/replace the string */

do i = 1 to DATA.0 start = 1 do while start < length(DATA.i) found = pos(frmstr,DATA.i,start) if found = 0 then leave endstr = found + length(frmstr) newstr = Left(DATA.i,(found - 1)) || tgtstr DATA.i = newstr || substr(DATA.i,endstr) start = found + length(tgtstr) end end

/* Write the substituted file out */

"EXECIO * DISKW SYSUT2(STEM DATA. FINIS" IF RC ¬= 0 THEN SIGNAL IOERROR

/* That's it all done */ Exit 0

IOERROR: SAY 'PROBLEM DURING I/O, Return code:' || RC EXIT RC