Third-Party Copy via Local zOS, from Windows to Windows
Third-Party Copy via Local z/OS, from Windows to Windows via Universal Copy
The following figure illustrates the third-party copying of a file from a local z/OS system, which executes a ucopy command from Windows to Windows.
The standard error is read into the UMET utility to verify the existence of the input file. The last step copies standard error to the job log.
//S1 EXEC UCMDPRC //UNVIN DD DSN=hlq.userid(#nt2logon),DISP=SHR //LOGONDD DD DSN=hlq.userid(#ntlogon),DISP=SHR //UNVERR DD DSN=hlq.output(stderr),DISP=SHR //SCRIPT DD * @ECHO ON :: TRANSFER FROM NT to NT @SET OUTPUTFILE=c:\temp\output.file @SET INPUTFILE=c:\temp\input.file @SET NT2HOST=hostname @SET TEMPNT2ID=c:\temp\userid.enc @SET MODE=text ucopy -output %TEMPNT2ID% ucmd¬ -cmd "ucopy -output %OUTPUTFILE%" < %INPUTFILE% ¬ -host %NT2HOST% -encryptedfile %TEMPNT2ID% -level info -stdin -mode %MODE% SET RC=%ERRORLEVEL% del %TEMPNT2ID% URC %RC% //SYSIN DD * -script SCRIPT -encryptedfile LOGONDD -host NTHOST -level info /* //* //*********************************************************** //S1 EXEC PGM=UMET,PARM='-TABLE TABLE -LEVEL VERBOSE' //STEPLIB DD DISP=SHR,DSN=hlq.UNV.SUNVLOAD //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //CEEDUMP DD SYSOUT=* //TABLE DD * "The system cannot find the file specified." 8 /* //SYSIN DD DISP=SHR,DSN=hlq.output(stderr) //*********************************************************** //S1 EXEC PGM=IEBGENER //SYSUT1 DD DISP=SHR,DSN=hlq.output(stderr) //SYSUT2 DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD DUMMY
All error messages will be routed to the z/OS manager. The authentication information for the Windows server must reside on the z/OS.
The file is copied as a text file, since the default transfer mode for standard files is text.
The UMETSTEP step executes the UMET utility. UMET is used to set the condition code field to a value based on message text. The SYSIN DD is the standard error of the first step and the TABLE DD is the table defining which condition code to be used when text is found.
Note
The UMET program is used because native Windows returns a 0 return (exit) code, even when the stdin does not exist. Therefore, the process would end with a 0, even if the input file did not exist. UMET will set the condition code to 8.
The IEBGENER step will copy the standard error file to SYSLOG if the process gets a non-zero condition code.
Parameters
The following parameters should be changed to match your information:
Parameter | Description |
---|---|
#USERIDNT | Encrypted userid and password member for sending Windows server |
#USERIDNT2 | Encrypted userid and password member for receiving Windows server |
OUTPUTFILE | Path and filename of receiving file |
INPUTFILE | Path and file name of sending file |
NTHOST | IP address or hostname of sending Windows server |
NT2HOST | IP address or hostname of receiving Windows server |
TEMPNT2ID | Temporary file on the Windows sending server used to house the encrypted logon information for the Windows receiving server. |
MODE | Mode of file transfer (binary / text). Default is set to text. |
SYSIN Options
The SYSIN options used in this example are:
Option | Description |
---|---|
DD from which to read a script file. The script file is sent to the remote system for execution. | |
DD from which to read an encrypted command options file. | |
Directs the command to a computer with a host name of NTHOST. | |
-level | Sets the level of message information. |
Components
Universal Command Manager for z/OS
Universal Command Manager for Windows