Copy from Local zOS to Remote Windows (with Windows Date Variables)

Copy from Local z/OS to Remote Windows (with Windows Date Variables) via Universal Copy

The following figure illustrates the copying of a file from a local z/OS system to a remote Windows system.

The file name on the Windows server is dynamically created based on the current date.

//S1 EXEC UCMDPRC
//UNVIN    DD DISP=SHR,DSN=hlq.input.file
//LOGONDD  DD DISP=SHR,DSN=hlq.userid(userid)
//SCRIPTDD DD *
@echo off                                                         
for /f "tokens=1 delims=/" %%a in ('date /t') do set daymm=%%a    
for /f "tokens=2" %%a in ('echo %daymm%') do set mm=%%a           
for /f "tokens=2 delims=/" %%a in ('date /t') do set dd=%%a       
for /f "tokens=3 delims=/" %%a in ('date /t') do set yy=%%a       
echo daymm:  %daymm%                                              
echo mmddyy: %mm%%dd%%yy%                                         
ucopy -output c:\temp\outputfile%mm%%dd%%yy%                      
//SYSIN    DD *
-script SCRIPTDD
-encryptedfile LOGONDD
-host dallas
/*


The JCL procedure UCMDPRC is used to execute the command. The command is sent to a remote system named dallas for execution. The -output option is used with the ucopy command to direct stdout to a local data set on the remote Windows server. The file name is created with a date variable. The date variable is set to the current date in the commands preceding the ucopy command.

Additional command line options are read from the encrypted file allocated to DD LOGONDD.

The file is copied as a text file, since the default transfer mode for standard files is text.

SYSIN Options

The SYSIN options used in this example are:

Option

Description

-script

DD from which to read a script file. The script file is sent to the remote system for execution.

-encryptedfile

DD from which to read an encrypted command options file.

-host

Directs the command to a computer with a host name of dallas.

Components

Universal Command Manager for z/OS

Universal Command Server for Windows

Universal Copy