DITGEN's Role
In order to efficiently and accurately accomplish the ASCII / EBCDIC translations, MAGEC must have current definitions (cont.)
for the data. Those definitions are taken from the ELT file records which define Elements. As a normal part of the data (cont.)
definition process the Database Administrator executes the DITGEN function. Refer to your *Programmer's Reference* (cont.)
manual, Database Administration section for more detailed information regarding data definition, or access the online (cont.)
help tutorials from GUI MAGEC.
The principal duty of the DITGEN function is to generate the Cobol copybook defining an Element. As of MAGEC release (cont.)
3.0, the DITGEN function has an added task: it generates a highly compressed table of conversion parameters which (cont.)
control the ASCII / EBCDIC (and vice-versa) translation. This table of parameters is stored in the ELT record for each (cont.)
Element. When required, the MAGEC I/O module passes this information to the MGCLIENT subroutine so that it can (cont.)
accomplish the translations.
Users of older versions of MAGEC likely have numerous definitions of Elements for which DITGEN was not recently (cont.)
executed. These Element definitions do not include the table of translation parameters. If MAGEC were to do the (cont.)
translation for the data defined by these Elements it would default to assuming that the entire Element is alphanumeric (cont.)
data and translate it accordingly. This will likely be less than perfect.
In order to obtain best results you should execute the DITGEN function (using MAGEC 3.0 or later) for every Element of every Data Class which *might *need ASCII / EBCDIC translation services.
##
KYF's Role
Since MAGEC supports a set of I/O commands which return only a found key value (the LOCxx commands), it is necessary to (cont.)
also be able to intelligently translate the key value returned. This is accomplished via the definitions found on the (cont.)
KYF file for each key and its component fields. From this definition MAGEC discerns which bytes of the key are (cont.)
alphanumeric, packed, binary, or signed zoned-decimal. Obviously this means that accurate definitions on the KYF file (cont.)
are important to achieving best results.
##
Remote Execution
With MAGEC's TCP/IP networking facility installed, a Client machine can invoke a jobstream or program to be executed at (cont.)
another (Host) machine. This facility works simarly to the "API Call" facility included with MAGEC's GUI option, except (cont.)
that the request is passed to a Host and the API call is done from MAGEC's Host processor on the Host machine. For a (cont.)
discussion of the special considerations regarding executing a process on a MVS or VSE mainframe, read this topic and (cont.)
also the topic Mainframe Sub-Tasks later in this chapter.
One possible use for this feature is to establish one or more Host machines which are configured optimally to perform (cont.)
some particular set of tasks, such as generating and compiling programs (i.e. MMPCREAT and MBPCREAT). Development (cont.)
personnel could submit their MMPCREAT requests to be run on the Host(s) while they continue doing other work on their (cont.)
workstations without suffering any degradation caused by having many large tasks concurrently (cont.)
active.
Since this facility uses the standard Windows API feature, any program or jobstream which can be executed from Windows (cont.)
could be executed from a remote Client. To execute a DOS batch file you would set up a .PIF file which executes the (cont.)
.BAT. You would execute the .PIF by specifying as the program name "xxxxxxxx.PIF", just as with the GUI API Call (cont.)
feature.
Programs generated using the standard MAGEC MODELMMP will automatically include the proper request area for executing a remote job. It is:
03 REMOTE-XQT-REQUEST...
05 RXQT-MSG-TYPE PIC X(8).
88 RXQT-REQUEST VALUE '$XQT'.
05 RXQT-GATEWAY-NAME PIC X(16).
05 RXQT-GATEWAY-ADDR PIC X(16).
05 RXQT-PORT PIC 9(5).
05 RXQT-MAGEC-RELEASE PIC X(3).
05 RXQT-NR-OF-BYTES PIC S9(4) COMP.
05 RXQT-COMMAND PIC X(128).
A Named Proforma is provided with MAGEC to help you to properly fill in and use this request area. The Proforma is named: REMOTE/XQT. It looks like this:
MOVE '$XQT' TO RXQT-MSG-TYPE
MOVE 'xxxxxxxxxxxxxxxx' TO RXQT-GATEWAY-NAME
MOVE 'nnn.nnn.nnn.nnn' TO RXQT-GATEWQY-ADDR
MOVE nnnnn TO RXQT-PORT
MOVE '&REL' TO RXQT-MAGEC-RELEASE
MOVE 'xxxxxxxx.EXE parms '
TO RXQT-COMMAND
CALL 'MGCLIENT' USING TWA REMOTE-XQT-REQUEST.
In this request, the literal $XQT identifies this as a remote execution request to MGCLIENT. The Gateway Address is (cont.)
given in its "dotted" format which MGCLIENT will convert into the actual 4-byte address used by TCP/IP. This is the (cont.)
address of the Host at which the task is to be executed.
You can determine the address of any Host by accessing MAGEC Table #248. The Gateway Name is the code value, the (cont.)
address is in the description. You can view Table #248 online using the function code: 248LOC. No key value is needed (cont.)
for this function. You can also access Table #248 from within your program. As with all MAGEC LookupTables, the actual (cont.)
file key is 19 bytes long and consists of the 3-digit Table# (248) followed by the 16-character code value. The (cont.)
copybook TBL01-C defines the contents of all tables. Table #248 contains, for each Gateway Name, a one-character Port (cont.)
ID, as well as the IP Address. Refer to the topic Gateways & PortIDs later in this chapter.
The 5-digit TCP/IP port number used by a given Gateway can be determined by accessing Table #243 using a key value or: 243TCPIP-PORTn where N = the one-character Port ID.
The symbolic '&REL' will be resolved at program generation time. It will contain the MAGEC release number. This helps (cont.)
MAGEC to verify that a version mismatch between the MGCLIENT program and your program is avoided.
The command is the actual executable (path and) file name, followed by any desired parameters. For example, 'MMPCREAT.PIF 600' or 'C:\WINDOWS\PBRUSH.EXE POLICE.BMP', et cetera.
##
Remote File Access
In order to access a file which is located on a different computer from the one on which the application is executing, (cont.)
you must tell MAGEC on which machine that file is located. The computer which contains, or controls access to, the file (cont.)
is called the Host machine. The computer on which the application is executing is called the Client (cont.)
machine.
**
NOTE:
**
Remember, any computer in the network can be both a Host and Client at the same time, if you wish. This means that (cont.)
Machine A can be accessing a file located on Machine B while Machine B is accessing a file on Machine A. This permits (cont.)
you to distribute database accesses across many machines to balance workload and to better utilize disk capacity in (cont.)
your network.
Every computer which will ever serve as a Host machine must be defined to Table #248, which is used to associate a (cont.)
mnemonic, unique name (up to 16 characters long) with the unique IP address of that machine. Refer to Defining a Host (cont.)
earlier in this section.
Terminals, or nodes of the network are defined to MAGEC's repository via the DVC (Device) definitions which include a "Home" Gateway name.
Data files are defined to MAGEC's repository using the DCL, KYF, ELT, and DIT entities. The DCL definition specifies (cont.)
high-level parameters for the Data Class (file), including its "Gateway" machine name. The Gateway machine is the Host (cont.)
machine which contains and "owns" this file. This is how MAGEC's I/O module knows whether this file is local (accessed (cont.)
using ordinary read's and write's) or remote (accessed by passing the request to the Gateway machine for (cont.)
servicing).
Since all applications in MAGEC call the MAGEC I/O module for all their file accesses, the I/O module automatically (cont.)
determines whether the file to be accessed is local or remote by comparing the Gateway name specified on the DCL (cont.)
definition to several values.
First, if the Gateway name from the DCL definition is "LOCAL", or is blank, MAGECIO assumes that the file is local and (cont.)
therefore issues ordinary read/write commands to access it. If the Gateway name from the DCL definition matches the (cont.)
name specified in the MAGHOST environment variable, MAGECIO also assumes the file is local. If the Gateway name from (cont.)
the DCL definition matches the Home Gateway name from this terminal/node's DVC definition, MAGECIO also assumes that (cont.)
the file is local. If the Gateway name specified on the DCL does not match any of the above, MAGECIO assumes that the (cont.)
file is remote and passes the request on to the address associated (in Table #248) with that Gateway (cont.)
name.
To illustrate how this works, let us take an example using a network consisting of two users (JOHN and MARY), each (cont.)
having one computer, plus one NOS server which is accessed by both users. Most of the files used by both users are on (cont.)
the server's disks; however, there is one file on MARY's computer (the MRY Data Class) which is accessed by both JOHN (cont.)
and by MARY, and one file on JOHN's computer (the JON Data Class) which is accessed by both of them as (cont.)
well.
The two users' computers will be called (in Table #248) MARYS-COMPUTER and JOHNS-COMPUTER. Since the NOS makes all (cont.)
files on the server accessible to either of the users, it is not necessary to define it to Table #248--but it is all (cont.)
right to do so, if you wish. Let's define it to Table #248 with the name NETWORK-SERVER, for this (cont.)
illustration.
The MAGEC DVC file is located on the NOS server's disk and is shared by both users. As each user logs onto MAGEC, (cont.)
he/she is assigned a terminal ID. There is a record on the DVC file for each terminal ID used. Each DVC record (cont.)
specifies "NETWORK-SERVER" as its Home Gateway. This tells MAGECIO that any Data Class (file) whose Gateway Name (cont.)
specifies "NETWORK-SERVER" is actually local to this terminal/node.
The DCL, KYF, and other repository entities associated with data definition also reside on the shared NOS server.
Most of the DCL definitions specify either "LOCAL", or "NETWORK-SERVER", or blanks for their Gateway Names. All of (cont.)
these are accessed as local files by both the user computers since the NOS makes them virtually (cont.)
local.
The MRY Data Class specifies "MARYS-COMPUTER" as the Gateway Name in its DCL definition, and the JON Data Class specifies "JOHNS-COMPUTER".
Both of the users' computers must serve as Client machines for their respective users, and as Host machines for each (cont.)
other. Therefore, both computers are running MGHOST as well as MAGEC's applications. Each machine must also have a (cont.)
WinSock-compatible "stack", as well.
MARY's computer has the environment setting: MAGHOST=MARYS-COMPUTER. JOHN's computer has the environment setting: MAGHOST=JOHNS-COMPUTER.
Whenever MARY executes an application which accesses the MRY Data Class, it treats it as a local file (which it is) (cont.)
because the Gateway Name of the MRY Data Class matches her MAGHOST environment setting. Similarly, whenever JOHN (cont.)
accesses the JON Data Class it is recognized as a local file.
Whenever MARY accesses the JON Data Class, it is treated as a remote file and the request is passed to JOHNS-COMPUTER, (cont.)
since that is the Gateway Name specified in the DCL definition for the JON Data Class. Whenever JOHN accesses the MRY (cont.)
Data Class MAGECIO similarly knows to pass the request to MARYS-COMPUTER.
When either of them accesses any other Data Class which is specified with a Gateway name of "LOCAL", or blanks, MAGECIO (cont.)
uses normal local file accesses. Also, if the Data Class' Gateway Name specifies "NETWORK-SERVER", it will be treated (cont.)
as local since that matches the Home Gateway Name specified on their DVC profiles.
*
Next, let's add another node to our network. This time it will be a mainframe computer running MVS/CICS with MAGEC (cont.)
installed. All of the necessary hardware and software for TCP/IP is installed and generated on the mainframe, so it can (cont.)
be plugged into your Token Ring or Ethernet network. The mainframe has an IP address just like any other computer and (cont.)
it is defined in Table #248 with the Gatetway Name of "BIG-IRON".
There are several large VSAM and Datacom/DB data files on the mainframe's disks which are used by mainframe programs (cont.)
(both MAGEC-generated, and older legacy systems). MARY and JOHN would like to be able to access those files from their (cont.)
applications running in a Windows environment.
For each of these files to be so shared, the DCL definition specifies "BIG-IRON" as the Gateway Name. The DCL (cont.)
definitions on the mainframe's repository and on the NOS server MAGEC repository are identical, since the Database (cont.)
Administrator has used the APUNLOAD/APLOAD utilities to synchronize the repositories.
Now, when either MARY or JOHN accesses these Data Classes, MAGECIO recognizes them as being remote and passes the (cont.)
request to the IP address specified for "BIG-IRON" in Table #248. The MAGEC I/O module executing on the mainframe (cont.)
processes the request and sends the results back to the requesting computer.
Since MAGEC-generated applications are portable, the applications being executed in the Windows environment can also be (cont.)
migrated to the mainframe MAGEC system and executed there. They can access the same files without requiring any (cont.)
duplication of data. Thus, the same application programs can be executed on the mainframe or PC / LAN and can (cont.)
concurrently be accessing the same set of files, some of which reside on the mainframe, some on the NOS server, and (cont.)
some on individual nodes' disk drives throughout the network.
If the Database Administrator decides, for whatever reason, to migrate one or more of the files from one computer to (cont.)
another, no programming changes need be made and no re-compiles need be done. The specification of where each file (cont.)
resides is contained solely in the MAGEC repository definitions which can be updated by the Administrator (cont.)
online.
When the application running in Windows accesses data from a Data Class which resides on the mainframe, an EBCDIC to (cont.)
ASCII (and vice-versa) conversion automatically is done as appropriate so that the data always appears in the expected (cont.)
format. This conversion is, as we have said before, controlled by the actual field-level data definition from the DIT (cont.)
file (part of the MAGEC repository).
The Database Administration section of your Programmer's Reference* manual discusses the importance of current data definitions as regards proper ASCII / EBCDIC conversions.
*
##
SHUTHOST
To "manually" shut down a MAGEC host, you execute the SHUTHOST program. SHUTHOST.EXE is a Windows application which (cont.)
issues a TCP/IP message to any running host (machine on which MGHOST is executing). The message is a command to MGHOST (cont.)
to shut down and clean up all open connections and/or VTAM logical units.
SHUTHOST is normally executed in either of two ways, 1) directly from a Windows icon, or 2) via an API call from the MAGEC online function, **HOST. In either case the command is:
SHUTHOST iii.iii.iii.iii//ppppp
-or-
SHUTHOST nnnnnnnnnnnnnnnn
where iii.iii.iii.iii is the IP address of the host you wish to shut down, and ppppp is the desired port# to be shut (cont.)
down, preceded by two slashes. In the second format, nnnnnnnnnnnnnnnn is the Gateway Name as specified in MAGEC Table (cont.)
#248. In that case SHUTHOST will interrogate Table #248 to get the IP address and Port ID, then Table #243 to get the (cont.)
range of Port numbers.
SHUTHOST.EXE is a Windows program and cannot be run from a DOS prompt. The computer on which SHUTHOST is executed must (cont.)
be configured as any MAGEC client machine would be, indeed, it normally will be a client machine in the (cont.)
network.
From within MAGEC's online system you can execute the **HOST function code which lists all the host machines defined to (cont.)
the system. It does not distinguish between those which are currently active and those which are not. To invoke (cont.)
SHUTHOST from this screen simply point the cursor to the host you wish to shut down and press PF4. The **HOST function (cont.)
will issue an API call to execute SHUTHOST with the IP address of the selected host machine as its command-line (cont.)
parameter. SHUTHOST can be used to shut down a Host whether it is a mainframe or PC Host.
##
CICS Hosts
MAGEC supports TCP/IP connectivity to IBM mainframes in conjunction with either of two connectivity providers, (cont.)
Interlink Computer Sciences, or OpenConnect. Interlink's solution is restricted to the MVS enviroments while (cont.)
OpenConnect's connectivity supports both MVS and VSE.
The mainframe programs involved in MAGEC interfaces are:
MMP6H1 Interlink Listen pgm
**MMP6H2 Interlink message processor
MMP6H3 OpenConnect supervisor pgm
MMP6H4 OpenConnect Listen & message processor
MMP6H5 OpenConnect dynamic system monitor
A CICS PCT entry must be provided to invoke either MMP6H1 or MMP6H3, as appropriate, to start MAGEC's TCP/IP Host (cont.)
processing on the mainframe, or if desired, a CICS PLT entry can invoke MMP6H1 or MMP6H3 at CICS startup time. A PCT (cont.)
next: network03.md.txt