Syntax
RUN literal [ device ] [ TRACE ] [ LA expression ] [ PA expression ]
Parameters
literal
A string expression naming the report class to run, an attribute which contains the alias of the report to be run, or a string expression containing the name. For example, where “Customer” is the name of a report to run, and “Cust” is the alias name, valid values are:
Run "Customer" Run "Cust" Run Customer Move "Cust" RunReport Run RunReport In MCP systems this cannot be a national string.
device
The device to direct output to, as listed below in Device Types.
TRACE
TRACE can be abbreviated as TR. Forces trace output to be written (if Trace property of the class in which it appears is set to true). Trace is included for backwards compatibility only and does not trace the report.
LA expression
Specifies the initial language for the report. In MCP systems this cannot be a national string.
If this command option is not specified, or if the specified language is not valid (the language is validated when the report is initiated), the report defaults to the current station language.
This command option is ignored for single language reports (reports with their Generate to all Languages property set to false).
PA expression
Passes parameter data to the report. The specified expression can be text or numeric and is limited to a maximum length of 254 characters. If a numeric value is used, it will be converted to text. In MCP systems this cannot be a national string.
Description
For Windows
The Run logic command initiates a report from ispec, report, or Messenger logic. It is interpreted as if a :RUN system command is issued to the runtime application.
After the report is initiated, it is not dependent on the completion of the ispec logic.
If the output device is specified as VD and input is from a terminal, the report is attached to that terminal. Otherwise the report is run as an unattached report.
For unattached reports, the report is run in background, and requests for input in response to Accept logic commands causes the report to terminate. To avoid using Message and Accept logic statements in reports, parameter information can be passed using variables, as described in Parameter Passing below.
Report Messages Sent to Client
Report Messages Sent to Client is a segment configuration property which determines whether reports executed via the Run logic command sends messages back to the initiating client session. It is used to allow users to choose whether messages sent from Reports that are run via ispec logic (using the Run logic command) are displayed on the status line (or Console window) or not.
Two types of messages are referred to here:
Messages output using the Message logic command.
The “Begin of Job” (BOJ) and “End of Job” (EOJ) messages. The BOJ message is created when a report starts and the EOJ message is created when the report ends.
This behaviour varies for different platforms (MCP, Windows).
For example, with CLR there are two options:
“No Messages” – none of these messages are displayed on the client. That is, the report runs, but the messages will not be sent back to the client from which the report was run.
“All Messages” – all report messages are sent back to the client and displayed on the status line or Console window.
For MCP
After the Report is initiated, it runs asynchronously and is not dependent on the completion of the logic of the Ispec.
The destination of the Report output is determined by the setting of the output device type and by the value of the attribute Glb.Stn.
If the output device type is VD, and input is from a terminal, the Report is attached to that terminal. If input is from External Automatic Entries (HUB), GLI, or OFFLINE, the Report will not be initiated. If the device type is RP, TP, or LP, and input is from a terminal, GLI, HUB, or OFFLINE, the Report is unattached.
The ROC system recognizes EX as a valid device type and write the output to a standard system data file. The name of this file will be derived from the Destination Station value held in Glb.Stn. You can specify a longer name if required.
When running an unattached Report, any messages are ignored, and requests for Accept command input from that Report causes it to go to end-of-job. Instead of using Message and Accept commands in Reports, you can pass parameters, as described in Parameter Passing below.
The chargecode that applies to your Report run is dependent on the values of the :COD System command and the Glb.Chargecode System attribute.
Note: Timeout for LSS to respond to a START and RUN request is now configurable through the use of the MAXWAIT task attribute associated with the LINCSUPPORT library. When the wait time has exceeded the value set or up to the current default of 60 seconds, GLB.STATUS is set to TOUT meaning timeout.
Refer to the Agile Business Suite Runtime for ClearPath MCP Administration Guide for more information.
For OLTP
When your application is processing an OLTP transaction, the following restrictions apply to the Run command:
The Run command initiates the associated Report in batch mode.
The initiated Report will not participate in the current OLTP transaction.
Messages from and replies to the initiating station are not possible.
Video output to the initiating station is not possible.
Default exception processing is invoked within the Report to provide a valid destination.
Device types
The following table lists device types and their availability to each target host.
Device | Description | Windows | MCP |
---|---|---|---|
AT | Video (attached report) | NO | NO |
EX | Extract file (standard system data file) | YES | YES |
LP | System or user-defined line printer | YES | YES |
RP | Remote printer, via Prints/Reprints | NO | YES |
TP | User-defined terminal printer (ROC alias) | YES | YES |
VD | The attached user terminal (temporary file) | YES | YES |
Attached reports
Attached reports return messages to the user interface from which the ispec executing the Run logic statement was initiated. Any messages appear on the status line of the terminal issuing the Run logic statement. The current screen display is overwritten, and replies can only be entered from the same terminal. Each terminal can only have one active attached report at a time.
To run an attached report, specify the output device type command parameter as VD.
Parameter passing
Parameter information can be passed to the report using one of the following methods:
Use Message and Accept logic statements to obtain runtime information from user input.
In ispec logic, store information in the database for the report to read. This method must be used if the parameter information exceeds 254 characters in length.
Specify the PA command option with the Run logic statement. Before generating the report, specify a variable on the Report Options dialog box that contains the parameter data. Refer to the Agile Business Suite Developer User Guide for more information. This is the simplest method of passing parameters to a report, but is limited to parameter information that does not exceed 254 characters in length.
The following restrictions apply to parameter passing:
The value of the report parameter is undefined if a report parameter is defined in the report, but the Run logic command does not pass the parameter.
The parameter is ignored, without raising an error, if the Run logic statement passes a parameter, but the parameter is not defined in the report.
If the report goes into recovery, the initial value of the report paramater is recovered, regardless of any changes made to the contents of segment or transient attributes in the report logic.
A Wake logic statement in the report or ispec logic can send a maximum of 254 bytes of information to the report.
Report status
When the Run logic command is executed, the Glb.Status built-in segment attribute is set to one of the values listed in the following table.
Glb.Status | Description |
---|---|
ACTIV | The terminal already has an attached report. |
BUSY | The maximum number of reports are already running; or the report has already been initiated by the same user. |
INVAL | The report name is invalid or not locatable. |
spaces | The report has been initiated. |
NOFIL | Could not open Glb.Param file for the report |
NOWRI | Could not write to Glb.Param file for the report |
Note: There might be instances due to a system limitations where a report does not run, even if it might seem to have started satisfactorily with no error status being returned. For example, the maximum number of processes that the operating system can handle might have been exceeded.
Restrictions
Refer to Parameter Passing for more information on restrictions related to parameters.
Examples
Run "CashFlo" LP Run "CashFlo" VD