Skip to content

Bidirectional File Transfer

Note

This feature is available as an additional Enterprise Server component and requires special licensing. Contact your sales representative for details.

Bidirectional high-speed file transfer can minimize the use of mainframe resources when transferring text, printer, and data files. By using bidirectional file transfer, you can copy almost any file or directory to or from an MCP disk and a Windows disk. If the MCP disk is visible to Enterprise Server running on the Windows platform, it uses very few mainframe resources to copy a file from the MCP disk to the Windows disk. If the MCP disk is not visible to Enterprise Server, the file transfer is still typically faster than FTP.

Enterprise Server uses a command-line interface so that repetitive file transfers can be put in batch files for periodic execution. As it copies text files to a Windows disk, Enterprise Server translates EBCDIC characters to ASCII characters and inserts carriage-returns and linefeeds at the end of each line. For printer files, it inserts form feed characters at page breaks. Binary files, such as code files or container files, are copied without any translation or character insertions.

As it copies text files from a Windows disk to an MCP disk, Enterprise Server translates ASCII characters to EBCDIC characters and removes carriage-returns and linefeeds from the end of each line. The longest line in the first 4096 bytes of the file determines the MCP file’s MAXRECSIZE attribute.

Binary files created on the MCP disk will have FILESTRUCTURE = STREAM.

Before you can use bidirectional high-speed file transfer, the Unisys host must be configured using the MAKEUSER program.


Configuring Security on Host

Before you can use bidirectional file transfer in Enterprise Server, the Unisys host must be configured using the MAKEUSER program. For information about MAKEUSER, see the Unisys documentation. The following MAKEUSER example configures the Unisys host to allow file transfers using COPY:

To configure security

  1. Sign on to CANDE and transmit

RUN *SYSTEM/MAKEUSER

  1. After your terminal opens as a remote file displaying the version information, then transmit the following:

$ LIST IGNORE

  1. Next, create a remote user. For example, transmit the following:

+RU SALLY OF *IPADDRESS 192.168.16.1 LOCALALIAS=PROD

  1. Finish by transmitting the following:

END

In this example, SALLY is the name of the Windows user account where Enterprise Server is running, the value following IPADDRESS identifies the computer running Enterprise Server, and PROD is the MCP server usercode that has permissions to access the host files to be transferred. This command allows user SALLY to act as usercode PROD from the IP address specified.


Transferring Files or Folders

Use the following procedure and examples to transfer files to or from an MCP disk.

To transfer a file or folder

Note

To use this feature, you must have certain privileges. See Accessing File Transfer.

At a command prompt, type <DBEnterprise program directory>\DBEnterprise followed by a COPY command, as in the following example. Additional examples are provided below. Make sure that you enclose Windows filenames and directory names in quotation marks. Keywords and MCP filenames are case insensitive.

 COPY "localname" { TO | AS } (usercode)MCPName [ ON familyname ]
 [ { FROM | VIA } ipnameoraddress ] [ PORT portnbr ]
 [ TEXT | BINARY ] [ HIDE ]
 COPY (usercode)MCPName [ ON familyname ] { TO | AS } "localname"
 [ { FROM | VIA } ipnameoraddress ] [ PORT portnbr ]
 [ TEXT | BINARY ] [ INDIRECT ] [ HIDE ] [ OVERWRITE ]
Use this keyword For
TO The folder or directory destination. Files will have the same name in the destination directory as the source. To specify a file name use the AS keyword instead of TO.
AS The filename destination. Use this keyword to specify a desired target name. For example, use AS if you want to retain ON <familyname> in the name of a file that is copied from the MCP environment to Windows. If the source is multiple files, the AS keyword is treated as TO and the destination will be a folder or a directory.
FROM -or- VIA The host name or IP address of the DBServer. The keywords are synonymous. The ipnameoraddress is the host name or IP address of DBServer. An IP address must be enclosed in double quotation marks. The portnbr is the number of the DBServer port.
TEXT Translating the file contents between ASCII and EBCDIC and adding or removing carriage returns and line feeds.
BINARY Preventing any translation
INDIRECT Using Indirect Disk access even though Direct Disk might be available
HIDE Hiding the DBEnterprise Replication Dialog during the file transfer
OVERWRITE Overwriting the destination file if it already exists without prompting for confirmation

Important

The Windows file name or folder name must always be enclosed in double quotation marks.

When copying from Windows, the localname can include wildcard characters.

The MCPname can be a directory name, which is indicated by /=.

If a syntax error occurs, a dialog box appears with the correct syntax, provided the attempted command can be determined. Otherwise, the dialog box will show the syntax for all commands.

Examples

 DBEnterprise copy "e:\batch\data\*.txt" to (PROD)batchfiles/= on mypack via "192.168.16.1" port 6100
 DBEnterprise copy "y:\logs\dailyrun.log" as (admin)logfile/daily on prodpack
 DBEnterprise COPY (PROD)DATA/SPAN/= ON DBPACK TO "D:\BACKUP\SPAN\DATA"

Transferred Filenames and Logs

When you transfer a file to the MCP environment, nodes (in filenames or folder names) containing characters that are invalid in MCP titles are enclosed in quotation marks. Nodes longer than 17 characters are truncated if the SYSOPS LONGFILENAMES option is reset.

When you transfer MCP files to the Windows environment, slashes that separate filename nodes are converted to the percentage sign (%), and quotation marks are removed. Additionally, the ON <familyname> portion of the file title is dropped. If you want to retain this title in the filename of the copied file on Windows, use the AS keyword. See Transferring Files or Folders.

Logs for file transfers are placed in one of two folders in the Logs directory:

  • Copy from <ipaddress> contains logs for files that were copied from the MCP environment to Windows

  • Copy to <ipaddress> contains logs for files that were copied to the MCP environment from Windows


Accessing File Transfer

To use bidirectional high-speed file transfer, your user ID must belong to either the DBEAdmins or DBEUsers group, if they've been defined. If these groups have not been defined, any user of the system can access this feature.

To transfer files from MCP disk using Direct Disk mode requires that your user ID belongs to the Windows Administrator group. Non Administrators are limited to Indirect Disk mode.


Default COPY Parameters

Enterprise Server tracks the last COPY command performed by each Windows user and can re-use the DBServer parameters as default values on subsequent COPY commands.

For example, suppose you enter these two COPY commands:

 dbenterprise copy (gpc)source/bankdb/= on user to
 "e:\xferfiles" text from mcpvlan port 5000

 dbenterprise copy (JOE)UPDATES/= ON SYSPACK to "d:\hostfiles\test"

Enterprise Server will populate the missing parameters using stored settings. Internally, the second copy command expands to the following:

 dbenterprise copy (JOE)UPDATES/= ON SYSPACK to "d:\hostfiles\test" from mcpvlan port 5000

In some cases, Enterprise Server infers default values even when no user command history exists.

If a Windows user has never specified FROM/VIA or PORT values, Enterprise Server uses the DBServer addresses and port numbers that are associated with configured sources in Enterprise Server.

If the COPY command does not specify BINARY or TEXT mode, Enterprise Server does the following to determine the mode:

If Enterprise Server
Copying from MCP Uses the MCP file attribute FILEKIND. If FILEKIND is set to DATA, Enterprise Server examines the first record of the file. If it only contains printable characters, TEXT mode is used. If it contains any nonprintable characters, BINARY mode is used.

Some files, such as COBOL source files, are transferred in TEXT mode by default.
Copying from Windows If the first 4096 bytes contain nonprintable characters Enterprise Server copies the files in BINARY mode. Otherwise it uses TEXT mode.