TCP/IP

SolveWare subject TCP/IP is designed to facilitate file transfers between various machines connected by a TCP/IP network. Control-O rules are used to connect the systems and issue FTP commands to remote systems. Optionally, the rules can set a prerequisite condition to inform Control-M of the file transfer.

Solutions Provided

SolveWare subject TCP/IP contains the File Transfer to Another System solution. This solution facilitates file transfer to another system and sets a prerequisite condition (to be referenced by Control-M) upon successful completion of the transfer.

File Transfer to Another System

This solution facilitates file transfer to another system and sets a prerequisite condition (to be referenced by Control-M) upon successful completion.

FTP software must be present on all systems to be accessed. This solution contains a REXX procedure used to interact with the FTP software. The Control-O server used to run the REXX procedure in this solution must have a region size of at least two megabytes.

Rules

The File Transfer to Another System solution includes the Send a File using FTP rule.

Rules Structure

The following tables describe the structures of the File Transfer to Another System solution rules, as well as the following REXX procedure:

  • FTP File "Put"

Table 153 Send a File using FTP Rule Structure

Item

Description

Title

Send a File using FTP

Name

CTOFTPPT

Table

TCP/IP

DO RULE

CTOFTPPT destination
local-file
foreign-file
condition
time-out

DO RULE Description

The DO RULE statement that triggers this statement must contain the arguments shown above.

Basic Scheduling Parameters

Always schedule this rule.

Runtime Scheduling Parameters

No special considerations.

Global Variables

None.

Rule Logic

The rule is triggered by a DO RULE statement in another rule. Rule arguments are parsed and a REXX procedure is invoked. (Rule arguments are described in detail in "Customization" below.)

If a return code of 0 is returned from the REXX procedure, the specified condition is set. Otherwise, a message to the operator is issued.

Rule Actions

  • Invokes a REXX procedure to perform file transfer.

  • "Shouts" a message to the operator if the file transfer was not successful.

Activating the Rule

Once scheduled, the rule remains active until deleted from Control-O.

Recommended Mode or Category

During the testing period activate the rule in LOG mode. When you are satisfied with the results of the rule, change the mode to PROD to avoid log messages for the rule.

SolveWare Category for this rule is 1—minimal or no customization is required.

Customization

The following arguments must be specified in the DO RULE statement that invokes this rule:

  • destination–Name of the destination host (as defined to TCP/IP)

  • local-file–Name of the file to be transferred
    The file to be transferred can be either a sequential dataset or a member.

  • foreign-file–Name under which the file is to be stored in the destination host

  • condition–Name of the IOA condition to be set upon successful completion of file transfer
    Maximum length: 20 characters.

  • time-out–Value to be entered in the TIMEOUT field of the DO TSO statement that invokes REXX procedure CTOFTPPT

Table 154 FTP File "Put" REXX Procedure Structure

Item

Description

Title

FTP File "Put"

Name

CTOFTPPT

REXX Script Description

This script opens a connection to the destination host system and transfers a specified file using that connection.

Activating the Script

This REXX procedure is activated using rule CTOFTPPT in this solution.

Parameters

  • destination Name of the destination host (as defined to TCP/IP).

  • local-file–Name of the file to be transferred. The file to be transferred can be either a sequential dataset or a member.

  • foreign-file–Name under which the file is to be stored in the destination host.

  • userid–User ID of the job or started task or TSO under which the rule that activated this REXX procedure is running.

Parameters destination, local-file and foreign-file are passed as arguments from the rule that activated this REXX procedure. The value of parameter userid is extracted from AutoEdit variable %%$USERID.

Special Considerations

The script allocates a password file, named userid.NETRC (where userid is the value in %%$USERID as explained above), which is read by the FTP software. Since this file contains sensitive information, it must be protected by on-site security software.

The structure of this file is:

MACHINE sys1 LOGIN usera PASSWORD passa.

MACHINE sys2 LOGIN userb PASSWORD passb.

MACHINE sys3 LOGIN userc PASSWORD passc.

where

  • sysn is the host name (as defined to TCP/IP).

  • userx is the user ID.

  • passx is the password for the user (userx above).