Transferring Window Files

In this section:

If you use FOCUS in more than one operating environment, you can transfer an existing window file from one environment to be used in another environment. For example, if you have a fully-developed window application in PC/FOCUS, and you want to develop a similar application in mainframe FOCUS, you can transfer the PC/FOCUS window file to mainframe FOCUS.

You can transfer a window file to a new environment in four simple steps:

  1. Create a transfer file from the original window file using Window Painter.
  2. Transfer the new file to the new environment using FTP.
  3. Edit the transferred file in TED, if necessary.
  4. Compile the transferred file using the WINDOW COMPILE command.

These steps are described in the following topics.


Top of page

x
Creating a Transfer File

The window files that you design in Window Painter are compiled files; before a window file can be transferred to another environment, a user-readable source code version must be created. This user-readable file is called a transfer file, and is created using the transfer file option of Window Painter.

To convert a window file to a transfer file, go to the Window Painter Utilities Menu and select:

Create a transfer file

You are prompted for the name of the new transfer file. Enter a member name; it can have the same name as the window file, or an entirely new name.

Note that you should not give the transfer file a name already assigned to a window documentation file. Also, you should not give the transfer file a name already assigned to an existing transfer file unless you want to merge the two files. See the appropriate operating environment topic in the Overview and Operating Environments manual for more information about duplicate window transfer and window documentation file names.

You are asked to select which window(s) you want to transfer. Select

All

to transfer all of the windows in the current window file, or select any single window in the file. This is the last step in creating a transfer file.

Note that you can merge transfer files: if a transfer file already exists for your window file, and you only need to add a new window to it, you can give the new transfer file the same name as the old one, and select the new window. Window Painter merges the source code for the new window into the existing file, so that you have a single complete transfer file.


Top of page

x
Transferring the File to the New Environment

Once the transfer file exists, it can be transferred to the new environment using FTP.


Top of page

x
Editing the Transfer File

In this section:

Window facility features introduced in one FOCUS release may not be fully supported in earlier releases. Because different operating environments may be running different releases of FOCUS, the transfer file created by the FOCUS Window facility in one environment may contain features not fully supported by the Window facility in another environment.

If your transfer file contains Window facility features not fully supported in the new environment, you may need to remove or fine-tune those features. If the new environment supports features are not supported in the original environment, you can add those features to the transfer file. Adding, removing, and fine-tuning features can be done by simply editing the transfer file.



x
The Format of the Transfer File

The transfer file is a user-readable source code listing of all of the windows and features that were included from the original window file. You can remove or fine-tune an unsupported feature by simply editing or deleting the appropriate line in the transfer file. You can accomplish this by using TED or any other editor.

Each transfer file contains:

If any attribute is not specified in the transfer file, it defaults to a value of zero or blank (depending on whether the value is normally numeric or alphanumeric).









x
Operating Environment Considerations

When you transfer a window file to a mainframe operating environment from a different environment, differences in hardware and operating software may require that you make changes to the file. These changes are discussed below.

PC or UNIX Extension

Mainframe ddname

.FEX

FOCEXEC

.MAS

MASTER

.ERR

ERRORS



Example: Sample Transfer File

To illustrate the transfer file format, part of the transfer file for the SAMPLE window file is shown below (SAMPLE is described in the tutorial). The MAIN and EXECNAME windows from the file are included in the example.

FILENAME=SAMPLE
DESCRIPTION='Sample file for windows tutorial'
WINDOWNAME=MAIN,TYPE=1
COMMENT='User can report, graph, or exit.'
ROW= 6,COLUMN=23,HEIGHT= 7,WIDTH=38,WINDOW= 7,POPUP= 0,BORDER= 
2,HEADLEN=28
RETURN=0
MULTI=0
HEADING='Would you like to:'
DATA='   '
$
DATA='         Create a report?'
GOTO='EXECTYPE',VALUE='RPT '
$
DATA='   '
$
DATA='         Create a graph?'
GOTO='EXECTYPE',VALUE='GRPH'
$
DATA='   '
$
DATA='         Exit?'
GOTO='        ',VALUE='XXIT'
$
DATA='   '
$
DISPLAY=BORDER   ,$
DISPLAY=BANNER   ,$
WINDOWNAME=EXECNAME,TYPE=5
COMMENT='Select an existing FOCEXEC from list.'
ROW= 4,COLUMN=11,HEIGHT=11,WIDTH=57,WINDOW=11,POPUP= 0,BORDER= 
2,HEADLEN=55,
RETURN=0
MULTI=0
HEADING='Select the request you want to execute and press ENTER:'
DATA='   '
GOTO='        ',VALUE='* FOCEXEC'
$
DISPLAY=BORDER,$
HIDE=BANNER,$
HIDE=MAIN,$
HIDE=EXECTYPE,$

Top of page

x
Compiling the Transfer File

How to:

The transfer file can be executed in its current format, but it may execute slowly, and uses a large amount of memory. You can make your window application more efficient, requiring less time and memory for execution, by compiling it.

You can compile a transfer file using the WINDOW COMPILE command. This produces a new compiled window file, in the same format as the window files produced by Window Painter.

Note that before you can issue this command, a PDS with LRECL 4096 and RECFM F must have already been allocated to ddname FMU. However, you do not need to create this PDS if you are only going to use the transfer file during the current FOCUS session: Window Painter temporarily allocates the PDS.



x
Syntax: How to Compile a Transfer File
WINDOW COMPILE windowfile

where:

windowfile

Is the name of the transfer file.

This must be a member name of a member of a PDS allocated to ddname TRF.

The command creates a new member of the PDS allocated to ddname FMU, with the same member name specified in the command.

When a Dialogue Manager -WINDOW command is encountered in a FOCEXEC, FOCUS searchs for a compiled window file (an FMU file) with the specified file name. If the compiled file is not found, the transfer file (TRF file) with the same file name is used.

Note that if you compile a transfer file and later make changes to it, you need to recompile the updated transfer file: otherwise, FOCUS continues to use the older, unchanged compiled file.


Information Builders