In this section: |
Remote execution allows users to transmit local FOCUS requests to a remote host for execution. In this operating mode, a request built on the client is shipped to the server for execution. On completion, the server returns the output to the client, which displays it in Hot Screen. The server does all data processing, while the client handles request generation and data presentation. Remote execution also supports server-based requests (Remote Procedures), through Remote Procedure Calls (RPCs).
Before sending a request to a remote server, you must connect to it by either:
or
Note: All data sources supported by servers can be accessed using remote execution.
How to: |
To have FOCUS automatically log you on to a server, create a FOCEXEC containing the REMOTE DESTINATION, REMOTE USERID, and REMOTE PASSWORD commands.
REMOTE DEST[INATION] = server
where:
Is the server name from the client configuration file. It must match the SERVICE attribute in the server configuration file (allocated to the EDASERVE ddname).
The following server configuration file contains the attribute SERVICE=IBIEDA:
***************************************************************** ** SERVICE for CS/3 Communications ** ***************************************************************** SERVICE = IBIEDA PROGRAM = TSCOM3 NUMBER_READY = 0 MAXIMUM = 50 *IDLELIM = 20 SERVINIT = *,++ AUTOSTART = NO ...
The client configuration file that provides access to this server contains the attribute NODE=IBIEDA:
NODE = IBIEDA BEGIN ; TRACE = 31 PROTOCOL = TCP CLASS = CLIENT HOST = IBIMVS ; DNS NAME OF HOST SERVICE = 2386 ; TCP/IP PORT THAT SERVER IS LISTENING ON END
To connect to the server in a FOCEXEC, issue the following command:
REMOTE DEST = IBIEDA
REMOTE USERID = serveruserid
where:
Is your user ID.
This user ID remains in effect until you reissue the REMOTE USERID command.
REMOTE PASSWORD = serverpassword
where:
Is your password.
This password remains in effect until you reissue REMOTE PASSWORD.
Note: By not specifying the REMOTE USERID and/or REMOTE PASSWORD commands, the security ID and password used for your mainframe session (z/OS user ID) are used to sign on onto the server.
How to: |
You can send FOCUS requests to the server for execution as follows:
When the server returns report output, FOCUS displays the report in Hot Screen.
Issue the following command at the FOCUS Session prompt:
REMOTE EX focexecname
where:
Is the name of a FOCEXEC stored on the client that is to be executed on the server. Note that Dialogue Manager amper variables in the FOCEXEC will be expanded on the client before the request is shipped to the server.
Important: A request executed this way may not contain the commands -REMOTE BEGIN and -REMOTE END. REMOTE EX issues those commands automatically.
The following sample FOCEXEC (EDHOURS) is executed at the FOCUS Session prompt with the REMOTE EX command.
The following code is stored on the client as FOCEXEC EDHOURS:
TABLE FILE EMPLOYEE HEADING CENTER "SUMMARY REPORT OF EMPLOYEE CLASSROOM HOURS" " " SUM ED_HRS BY EMP_ID END
To execute this procedure on the server, issue the following command:
>> REMOTE EX EDHOURS
How to: |
Another way to execute report requests against remote data is to begin the FOCEXEC that you want executed on the server with the command -REMOTE BEGIN, and follow the END command with -REMOTE END. Then execute the FOCEXEC.
Using -REMOTE BEGIN and -REMOTE END provides the following advantages:
Keep the following restrictions in mind:
The following example demonstrates the use of a Dialogue Manager amper variable (&1) with FOCUS commands in a FOCEXEC named MARGIN. The request executes a JOIN and report request on the server. The numbers on the left refer to the notes that follow.
1. -REMOTE BEGIN 2. JOIN PROD_CODE IN &1 TO PROD_CODE IN PROD AS AJOIN TABLE FILE &1 PRINT UNIT_SALES AND COMPUTE MARGIN/D8.2= RETAIL_PRICE - UNIT_COST; BY STORE_CODE BY PROD_CODE END 3. -REMOTE END
Execute MARGIN and provide the name of the target data source as an argument on the command line. For example, to obtain the margin report for the SALES data source, issue the following command at the FOCUS prompt:
EX MARGIN SALES
SALES is substituted for the Dialogue Manager variable &1 in the JOIN and TABLE commands, and the commands then execute on the server. The resulting report is returned by the server and displayed in Hot Screen on your terminal.
In addition to making data available to the client, a server can also hold remote or stored procedures that can be executed from FOCUS.
To execute a procedure that resides on the server, use the following syntax:
>> REMOTE EX focexec
where:
Is a FOCEXEC on the client that contains a command that executes a procedure on the server.
FOCEXECL resides on the client, and FOCEXECS resides on the server.
FOCEXECL contains the following command:
EX FOCEXECS
To execute FOCEXECS, issue the following command:
REMOTE EX FOCEXECL
Another way to do this is to issue the following commands:
-REMOTE BEGIN EX FOCEXECS -REMOTE END
You can use the -INCLUDE command in a FOCEXEC to call another FOCEXEC stored on the client.
This example downloads data from a host to a FOCUS Client and updates the EMP data source.
-REMOTE BEGIN TABLE FILE EMPLOYEE PRINT EMP_ID SALARY START_DATE ON TABLE HOLD AT CLIENT AS LD END -REMOTE END -INCLUDE FOCEXECL
FOCEXECL contains the following commands:
MODIFY FILE EMP FIXFORM FROM LD DATA ON LD END
Note: If you use remote execution to execute a FOCEXEC on the server that uses a -INCLUDE command, the FOCEXEC named must reside on the server and the -INCLUDE command must precede the -REMOTE END command.
How to: |
All FOCUS and system messages returned by the server are displayed, as are error messages resulting from remote execution.
FOCUS places the error message numbers in the Dialogue Manager variable &FOCERRNUM, which can then be tested in FOCEXECs.
? nnnn
where:
Is the error message number.
How to: |
The REMOTE FIN command logically terminates a FOCUS session with a server. It should be issued at the conclusion of remote data access. The server must be available when you issue this command.
Note: Issuing a FIN command in native FOCUS closes all active sessions.
REMOTE FIN server
where:
Must match the server name in the configuration file.
How to: |
The ? REMOTE command displays all remote session parameters in effect. Issue it at any time in your FOCUS session.
? REMOTE
The output is:
Remote Destination --> IBIEDA Remote User ID --> USER1 Remote User Password --> ........ Conversations exist with : IBIEDA (EDA5.2)
|
Information Builders |