MNTCON EX

In this section:

How to:

Reference:

You use the MNTCON EX command to run an uncompiled Maintain procedure.

This command is outside the Maintain language, but is described in this content for your convenience.

Syntax: How to Use the MNTCON EX Command

To run an uncompiled Maintain procedure (with either a .mnt or .fex extension, or a MAINTAIN or FOCEXEC file type or ddname), use the following syntax

MNTCON EX [dirname/]procname [-v  parm1 ,  ... parmn] 

where:

dirname

Is the directory name on the Reporting Server where the Maintain procedure is located. This is optional.

procname

Is the name of a Maintain procedure. First, the MNTCON EX command looks for a Maintain procedure with a .mnt extension or a MAINTAIN file type or ddname. If it does not find one, it looks for a Maintain procedure with a .fex extension or a FOCEXEC file type or ddname.

-v

Is the flag that indicates parameters will be passed to the Maintain procedure. This is optional.

parm1 ... parmn

Can be either positional parameters or parm="value" keyword parameters. Parameter types can be mixed within the same MNTCON EX command line. The maximum number of parameters you can pass is 128. You should separate all parameters using commas (,). You should use single quotation marks (') or double quotation marks (") to enclose values containing spaces or commas (,). Use with Sys_mgr functions (Sys_Mgr.Get_NameParm, Sys.Mgr.Get_InputParams_Count and Sys_Mgr.Get_PositionParm) to retrieve the values. If any of these functions are unsuccessful, FOCERROR is set to -1.

For more information, see SYS_MGR.

Reference: Commands Related to MNTCON EX

  • MNTCON COMPILE. Compiles Maintain procedures.
  • MNTCON RUN. Executes compiled Maintain procedures.

Invoking Maintain Procedures: Passing Parameters

How to:

You can issue MNTCON EX or MNTCON RUN with the flag –v to pass input parameters from the command line when invoking Maintain applications, in a manner similar to passing parameters to FOCEXECs. This method bypasses the requirement of importing the webbase2 file and coding web client variable retrieval. You can use this syntax in a FOCEXEC (.fex) or from within a backend server edastart –t session.

Positional and key-matching parameters are supported, and you can use both together in the same Maintain EX or RUN command. Parameters are defined as A0. The maximum number of parameters you can pass is 128. You may include Dialogue Manager commands in a FOCEXEC when invoking MNTCON EX or RUN with the –v option.

Syntax: How to Use the MNTCON EX Command to Pass Parameters

MNTCON [EX|RUN] procname –v  "parm1value" ... "parmnvalue"

where:

procname

Is the name of a Maintain procedure.

parm1value ... parmnvalue

Can be either positional parameter values in single quotation marks (') or double quotation marks ("), or a parm="value" key-matching parameter. You can mix positional and key-matching parameters.

The target Maintain procedure uses Maintain SYS_MGR function subcommands to retrieve the values.

Sys_mgr.get_positionParm
Sys_mgr.GET_inputparams_count
Sys_mgr.get_nameParm

If any of these SYS_MGR functions is not successful, FOCERROR is set to -1.

For more information on SYS_MGR functions, see SYS_MGR.

Example: Passing and Retrieving Parameters

MNTCON EX START1 –v abc, '24 Houston Center' , ADDR='Cape Canaveral", 
COUNTRY=USA

Target Maintain procedure START1 could include:

Parm1/a0=sys_mgr.get_positionParm(1);

to get the first positional parameter. Here it returns value abc for Parm1.

Posvar/i2=sys_mgr.GET_inputparams_count();

to return the total number of positional parameters. Here it returns 2 for Posvar.

Address/a0=sys_mgr.get_nameParm('ADDR');

to return value for key-matching parameter ADDR. Here it returns Cape Canaveral for Address.

Note: Sys_mgr.get_nameParm is case-sensitive. Use the same case for the parameter when retrieving the value as you use when passing it.

For more information on SYS_MGR functions, see SYS_MGR.