Use Sterling B2B Integrator to Copy a File to Sterling Connect:Direct for z/OS (Advanced)

In this sample, shown in BPML, the Sterling B2B Integrator CopyToCDzOS business process passes a document to the Connect:Direct Server Adapter (PNODE) which copies the file to the Sterling Connect:Direct® for z/OS® node (SNODE). The business process functions much like a Sterling Connect:Direct process. In this complex example containing nine operations, the operation numbers are shown in the BPML code and correspond to the following narrative.

In Operation 1 of the CopyToCDzOS business process, the File System Adapter collects (reads) the bp1mbin.txt file from the Sterling B2B Integrator local file system. This file becomes the primary document of the business process.

Operation 2 uses the CD Server Begin Session Service to establish a connection to the remote Sterling Connect:Direct node, CD.ZOS. The local node name of the Connect:Direct Server Adapter is SI51CD. The Begin Session Service uses the remote user ID of cduser to authenticate to the Sterling Connect:Direct server.

Operation 3 executes a CD Server Run Task service to delete and uncatalog the output file, CSDQA1.O.TESTFILE.SMS2, if that file already exists. In addition, this operation unallocates the CSDQA1.O.TESTFILE.SMS2 file.

Note: SystemOpts is the equivalent of Sysopts.

Also, do not enclose the value specified for SystemOpts in double quotes.

Operation 4 uses the CD Server CopyTo Service to copy the primary document to the remote Sterling Connect:Direct for z/OS node. The CopyTo Service allocates an SMS managed file on z/OS with the following Remote parms:

  • RemoteSMS—SMS parms passed to z/OS for allocation. This parm specifies that the z/OS system allocates this file with a DATACLAS of CSGWORK, STORCLAS of BENCH, MGMTCLAS of STANDARD, and uses kilobytes (K) as the allocation unit (AVGREC)
  • RemoteDISP— the disposition of the new file.
  • RemoteFileName—the name of the destination z/OS dataset.
  • RemoteSPACE—defines the space requirements for the allocation.

Operation 5 uses the CD Server Run Task Service to execute the DMRTDYN utility program to perform the following functions:

  • Allocate a file on the z/OS system with a DDname of OLDDD to be used as a basis for comparison to the output file
  • Allocate the output file from the previous step with a DDname of NEWDD for a comparison.
  • Allocate an output DD called OUTDD that holds the output report file for the Compare step instead of an actual file.

Operation 6 uses the CD Server Run Task Service to execute the ISRSUPC program, a compare utility. The ISRSUPC program compares the file allocated to OLDDD and the file allocated to NEWDD using the parms in the Sysopts. The results are written to the OUTDD.

Operation 7 uses the CD Server Run Task Service to execute DMRTDYN to deallocate OLDDD, NEWDD and OUTDD.

Operation 8 uses the CD Server End Session Service to terminate the session with the Sterling Connect:Direct server after the business process has executed successfully. To accommodate error processing, Operation 9 contains an onFault branch with its own instance of the CD Server End Session Service. If an error occurs after the Begin Session Service, the onFault logic is invoked and the End Session Service terminates the session with the Sterling Connect:Direct server.

Note: To see BPML source code like the example shown below, select View > Source while using the Sterling B2B Integrator Graphical Process Modeler (GPM). To see the business process as depicted in the GPM user interface, select View > Graph.
 <operation name="CD Server Run Task Service">               OPERATION 3
      <participant name="CDServerRunTask"/>
      <output message="CDServerRunTaskServiceTypeInputMessage">
        <assign to="SystemOpts">C' ALLOC',C' DSN=CSDQA1.O.TESTFILE.SMS2',
                    C' DISP=(MOD,DELETE)',F'-1',C' UNALLOC',
                    C' DSN=CSDQA1.O.TESTFILE.SMS2'</assign>				
        <assign to="Program">DMRTDYN</assign>
        <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">
        </assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
    <operation name="CD Server CopyTo Service">                         OPERATION 4
      <participant name="CDServerCopyTo"/>
      <output message="CDServerCopyToServiceTypeInputMessage">
        <assign to="RemoteSMS">DATACLAS=CSGWORK AVGREC=K STORCLAS=BENCH MGMTCLAS=STANDARD
        </assign>
        <assign to="RemoteDISP">(NEW,KEEP,DELETE)</assign>
        <assign to="RemoteFileName">CSDQA1.O.TESTFILE.SMS2</assign>
        <assign to="RemoteSPACE">(TRK,(18,2),RLSE)</assign>
        <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">
        </assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
    <operation name="CD Server Run Task Service">                       OPERATION 5
      <participant name="CDServerRunTask"/>
      <output message="CDServerRunTaskServiceTypeInputMessage">
        <assign to="SystemOpts">C' ALLOC',C' DSN=CSDQA1.TESTFILE.BENCH.M1',
                    C' DISP=SHR',C' DD=OLDDD',F'-1',C' ALLOC',
                    C' DSN=CSDQA1.O.TESTFILE.SMS2',C' DISP=SHR',
                    C' DD=NEWDD',F'-1',C' ALLOC',C' DD=OUTDD',
                    C' DUMMY',C' SYSOUT=A'
        </assign>
        <assign to="Program">DMRTDYN</assign>
        <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">
        </assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
    <operation name="CD Server Run Task Service">                       OPERATION 6
      <participant name="CDServerRunTask"/>
      <output message="CDServerRunTaskServiceTypeInputMessage">
        <assign to="SystemOpts">C' DELTAL',C' LINECMP',C'',C''</assign>
        <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">
        </assign>
        <assign to="Program">ISRSUPC</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
<operation name="CD Server Run Task Service">                          OPERATION 7
      <participant name="CDServerRunTask"/>
      <output message="CDServerRunTaskServiceTypeInputMessage">
        <assign to="SystemOpts">C' UNALLOC',C' DD=OLDDD',F'-1',
                    C' UNALLOC',C' DD=NEWDD',F'-1',C' UNALLOC',
                    C' DD=OUTDD'
        </assign>
        <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()"></assign>
        <assign to="Program">DMRTDYN</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
    <operation name="CD Server End Session Service">                   OPERATION 8
      <participant name="CDServerEndSession"/>
      <output message="CDServerEndSessionServiceTypeInputMessage">
        <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">
        </assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
    <onFault>
      <operation name="CD Server End Session Service">                OPERATION 9
        <participant name="CDServerEndSession"/>
        <output message="CDServerEndSessionServiceTypeInputMessage">
          <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">
          </assign>
          <assign to="." from="*"></assign>
        </output>
        <input message="inmsg">
          <assign to="." from="*"></assign>
        </input>
      </operation>
    </onFault>
  </sequence>
</process>