Remote Command Procedure Call

Calling procedures

Files or library elements of type J may contain command procedures. These procedures can be called by selecting the file or library element and executing the context menu action Remote Procedure Call With.

The sub-menu action Default call command for library elements is available for library elements of type J and performs the default command /CALL-PROC FROM-FILE=*LIB-ELEM(...).

The sub-menu action Default call command for simple files is available for simple files and performs the default command /CALL-PROC FROM-FILE=....

The /CALL command and the SYSOUT of the called procedure is logged to the command link Console view.

Call Procedure With Parameters

Files and all type library elements can be called using Call Procedure With Parameters context menu action:
contex menu action

It performs the command /CALL-PROC FROM-FILE=... PROCEDURE-PARAMETERS=(...) in the BS2000Terminal. Only one procedure can be running at the time. Terminal disconnects automatically, when the procedure ends.

The action displays pop-up where procedure parameters can be provided. Procedure call with parameters dialog allows to enter procedure parameters in two Input modes. Switching between modes is done using radio buttons on the top.

In the Plain text mode, the parameters may be provided as a text, following the pattern: param=value,param2=value2. Spaces and new line characters are allowed. The provided and confirmed output will be saved for further procedure calls. The last provided inputs are available from the Input history dropdown below.

Remote call procedure with parameters dialog

In the Parameters Table input mode, the procedure source code is parsed to find parameter declarations. All found parameters are placed to the table. Values of the parameters must be provided into the Value column cells. The input values are saved to the history. In the further parameter calls, recent values of the parameters will be suggested when started typing.

The greyed-out values represents the initial value of parameter. In the right panel there are printed all the details of selected parameter.

Remote call procedure with parameters dialog


The Convert Parameter Table values into Plan Text button placed in the top right corner is responsible for translating the values provided in the table into the standard parameters text. If the checkbox is checked, after switching to the Plain Text mode, values will be represented in the 'parameter=value,paramater2=value2' format. The inputs from table will be saved into history and will be available in the dropdown in plain text mode in the future.

You can alternatively use key shortcut CTRL + SHIFT + P to quickly select recently called procedures:

Call procedure with parameters selection

This dialog will additionally display currently selected procedure in BS2000 Explorer or opened in editor.

Typical usage

SDF procedures can be provided to build an entire product. For instance, they can recompile all sources belonging to the product, preferably make controlled so that only the modified sources are recompiled. They can also bind the generated LLM modules and do other work required to complete the build.

Furthermore procedures can be provided to run tests.

Defining customized procedure calls

In addition to the predefined default procedure calls customized call commands can be defined. This is done similarly to the definition of compile commands and compile rules, see Defining Compile Commands and Defining Compile Rules. To define customized procedure call commands open command link Window > Preferences > BS2000 Remote IDE > RemoteProcedure Call. Here is the default contents of the Remote Procedure Call preference page:

For a call command you can customize the Exit Codes in the Create/Edit Call Procedure Command page. With the Edit Exit Codes button you can specify

Together with the exit code this message is shown in the State and Exit Code column of the Remote BS2000 Procedure Calls view.

When the execution of a call command fails, in the Problems View a quick fix is available to add the received exit code to the list of Success Exit codes.