Focal Point
Executing procedure on remote server

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1237077795

January 28, 2011, 05:12 PM
JBK
Executing procedure on remote server
I'm trying to use the EXEC command to run a procedure on a remote server. The [AT server] part of the syntax is being ignored, and the version of the focexec that resides on the local server is run, rather than the one on the remote server.

How might I get this to work?


WebFOCUS 7.6.11, Linux, HTML, PDF, AHTML, EXCEL
January 30, 2011, 03:41 PM
Waz
What code are you using ?
Can you post it ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 31, 2011, 12:13 PM
JBK
For testing, I'm using this in the main focexec:

  
EXEC EMPDATA AT server_name


I've tried both the IP address and the server name for server_name.


The EMPDATA procedure is:

  
TABLE FILE EMPDATA
    SUM
        SALARY
    BY DIV
    BY DEPT
END



WebFOCUS 7.6.11, Linux, HTML, PDF, AHTML, EXCEL
January 31, 2011, 01:06 PM
GamP
From the help-file:
quote:
You can call a procedure from another procedure with the EXEC command. The called procedure must be fully executable. It behaves as a completely separate procedure, with its own content. It cannot use any local variables (&variables) defined by the calling procedure (unless they are explicitly passed to the called procedure on the command line). However, the executed (called) procedure can use any global variables (&&variables) that have been defined in the calling procedure.
There is nothing that indicates that you can use it like you did to cause it to runon a different server. The way to do that is to use the -REMOTE command set.
The syntax you used is valid for MAINTAIN only...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 31, 2011, 01:22 PM
Jean-Claude CARRIERE
GamP is right stating EXEC AT is MAINTAIN syntax whereas in a WebFOCUS procedure you would do :
REMOTE DEST=
-REMOTE BEGIN
EX
-REMOTE END

In both case you need to have in the server communication configuration file (odin.cfg) [where your code is executing) the definition of the remote server. This is something that looks like (from memory)
NODE=
BEGIN
CLASS=CLIENT
HOST=ip_address_of_your_remote_machine
PORT=your_remote_server_port
END
You can configure this REMOTE Server from the adapter tab on your local server console.
January 31, 2011, 03:19 PM
j.gross
JBK --

You did not indicate the nature of the interaction you are trying to accomplish.
Do you need to pass local data to the remote server?
Do you need the remote server to pass back an answer-set to the local server?
February 01, 2011, 11:57 AM
JBK
j.gross,

I will need the focexecs on the remote servers to create hold files to be passed back to the local server for reporting.


WebFOCUS 7.6.11, Linux, HTML, PDF, AHTML, EXCEL
February 01, 2011, 04:07 PM
Waz
Is the call being done from MAINTAIN ?

Please check the previous posts.

Use REMOTE for FOCUS, and EXEC AT with MAINTAIN.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 01, 2011, 05:25 PM
JBK
The call is not being done in Maintain.


WebFOCUS 7.6.11, Linux, HTML, PDF, AHTML, EXCEL