Receiving from multiple hosts
You can receive the same type of data sent from multiple remote hosts as a single Receive file. This is called 'Multiple Receive' in HULFT.
From what host the data was sent and where it is stored within the Receive file is managed using the Multiple Receive Information file. Using this information, you can extract and process only the data you wish to select.
The flow of receiving for multiple hosts is illustrated in Figure 2.16 .
1) Waiting for connection from sending host
The Receive program (XRRCV) waits for connection from the host on the sending side.
2) Carrying out of Receive processing
If 'M' (Multiple Receive) is specified for the Receive Mode (RCVTYPE) in the Receive Management Information, the Receive program (XRRCV) receives the data using the Receive work file according to the file information concerning transfer from the host on the sending side and the Receive Management Information of the host on the receiving side. A Receive work file is created for each remote host. From that point, parallel communication is carried out.
HULFT creates the Receive work file on the volume that is specified for the Work Volume Serial (WORK-VOL) in the Receive Management Information, with the data set name obtained from the string that is specified for the First Modifier of Receive Work Files (RPREFIX) in the System Environment Settings, and the timestamp.
If you omit the Work Volume Serial, the work file is created on the volume with the same volume serial number as the Receive file.
In an SMS-managed environment, the behavior of HULFT when the Multiple Receive is carried out may vary depending on the settings for Receive work files and the work volume serial.
For details, refer to Operation of HULFT in an SMS-managed environment.
3) Writing of Receive Log record
After the Receive processing ends, the Receive program (XRRCV) writes the Receive Log record to the Send and Receive Log file (HULFT.LOG).
4) Startup of Post-receive Job
The Receive program (XRRCV) starts the Post-receive Job according to the settings that are registered in the Receive Management Information. In the Receive Management Information you can register both a successful job to be started when the Receive processing ends successfully, and an unsuccessful job to be started when the Receive processing ends unsuccessfully. HULFT starts one of the two types of jobs depending on the transfer result.
The Post-receive Job is started as the Receive processing for each remote host is completed.
5) Integration of receiving data into Receive file
HULFT writes the data of the Receive work files to the Receive file. The processing is carried out by the automatically-incorporated merge program within the successful job that is specified as a Post-receive Job. The merge program is automatically incorporated when 'M' (Multiple Receive) is specified for the Receive Mode (RCVTYPE) in the Receive Management Information. If the Receive processing ends unsuccessfully, the merge program is not incorporated. When the merge program ends successfully, the Receive work files are deleted.
6) Writing to Multiple Receive Information file
The merge program writes to the Multiple Receive Information file the information on the host from which data was sent and on the location within the Receive file where the data was stored. If the Receive processing ends unsuccessfully, this information is not written to the file.
The Multiple Receive Information file is created with the same volume serial number as the Receive file, and with the data set name 'Receive File Name.CNTL.'
7) Writing of job execution log record
The job steps, incorporated by HULFT into the Post-receive Job, will write job execution log records to the Send and Receive Log file (HULFT.LOG).
To extract the received data for processing per host on the sending side, the Post-receive Job must refer to the Multiple Receive Information file to carry out processing.
Example of JCL
The JCL job step for the automatically-incorporated merge program is shown below.
//XRMRG EXEC PGM=XRMRG,REGION=1024K //STEPLIB DD DISP=SHR,DSN=HULFT.LOAD //XRFILE DD DSN=HULFT.FILE,DISP=SHR //XRHOST DD DSN=HULFT.HOST,DISP=SHR //XRCRD DD * //SYSUDUMP DD SYSOUT=*
DD Name |
Value |
Description |
---|---|---|
STEPLIB |
HULFT.LOAD |
HULFT load module library (STEPLIB specified in the System Environment Settings) |
XRFILE |
HULFT.FILE |
Send and Receive Management File |
XRHOST |
HULFT.HOST |
Host Information File |
The STEPLIB specified for the Subsequent Job Addition Step STEPLIB Settings 1 in the System Environment Settings file (HULFT.PARMLIB(HULPRM)) is added to the JCL job step of the automatically-incorporated merge program. If the field is not specified, the STEPLIB is not added.
To run the JCL job step for the automatically-incorporated merge program, specify the Successful Job ID (JOBID) in the Receive Management Information. The JCL job step for the merge program is incorporated before the user job steps.