Calling a Subroutine From a Procedure

In this section:

You may call a ReportCaster API subroutine from a:

A procedure must reside in a path defined to the WebFOCUS Reporting Server. On Windows and UNIX, it must be located in EDAPATH. On OS/390, it must be in a partitioned data set (PDS) allocated to ddname EDARPC.


Top of page

x
Calling an API Subroutine Using -SET

How to:

Reference:

You can call an API subroutine using a -SET Dialogue Manager command. For more information about Dialogue Manager, see the Developing Reporting Applications manual.



x
Syntax: How to Call an API Subroutine Using -SET

A ReportCaster API subroutine passes a required set of arguments in a specified order and supplies a return code to the calling procedure. You can change the Dialogue Manager variable names (amper variables), or replace them with coded values. The following variable names used are samples.

Note: This is the general syntax for all subroutines. For more information about the syntax for each subroutine, see the specific sections that describe the DSTBULK, DSTMEM, and DSTRUN subroutines.

-SET &var_name=API_subrtn_name(srv_userid,srv_userid_length,
-  'srv_userpass',srv_userpass_length,
-  'hostname_port',hostname_port_length,
-  'input7',
-  'input8',
.
.
.
-  'httpuser/pswd',httpuser/pswd_length, 
[-  'tcpiplevel',]
-  'I4');

where:

&var_name

Is the variable that will contain the return code.

API_subrtn_name

Is the API subroutine, which can be DSTBULK, DSTMEM, or DSTRUN.

srv_userid

Is a valid Execution ID. It must match the user ID stored in the ReportCaster Repository with the job information.

srv_userid_length

Is the length of the Execution ID.

srv_userpass

Is a valid password for the Execution ID. It must match the password of the user ID stored in the ReportCaster Repository with the job information.

srv_userpass_length

Is the length of the password for the Execution ID.

hostname_port

Is the host name (or IP address) and port number of the Web server on which the WebFOCUS Client is installed. The maximum character length is 30.

If the port number is 80 (the default), you may omit the colon and port number. For example,

'hostname',

If the port number is not 80, use a colon as a delimiter and then specify the port number. The maximum character length is 10. For example,

'hostname:81',

Note: Since there is no longer a specific ReportCaster web application, you must provide information so that the interface is explicitly directed to go to the WebFOCUS application context root. For example, the following method can be used to correctly pass the hostname parameter:

<host>:<port>/ibi_apps:ibi_apps',&LEN,

The hostname parameter is the third parameter passed to DSTBULK. Be sure to substitute the actual hostname for <host> and port number for <port>. After the slash (/) delimiter, this is followed by the name of the default context root for the WebFOCUS Web Application (which is ibi_apps in most cases), followed by a colon delimiter (:). Next, indicate the name of the ReportCaster web application which in release 77 and higher is always the same as the WebFOCUS web application. For example: serv01:8080/ibi_apps:ibi_apps',&LEN, provided that serv01 is the hostname of the box where your application server resides and 8080 is the port it is listening on. In addition, this assumes that you are using the default context root for WebFOCUS of ibi_apps if not substituted accordingly. Finally, &LEN should contain the length in digits of the string of this parameter.

hostname_port_length

Is the length of the host name and port number. This is only the length of the host name if the port number is omitted.

input7,input8, ...,

Are the input arguments (the values required by the subroutine). These arguments are different for each subroutine.

httpuser/pswd

Is a valid user ID and password for the Web server, separated by the character /. A user ID and password are required if the Web server is running with security on.

httpuser/pswd_length

Is the length of the Web server user ID and password, including the character /.

tcpiplevel

Required only if the WebFOCUS Reporting Server runs on OS/390. This argument is the method the ReportCaster API uses for securing sockets from TCP/IP, based on a specific SAS/C library. Valid values are:

1 which resolves special connectivity problems.

0 which indicates that there are no special connectivity problems.

'I4'

Is the format of the return code. For more information, see ReportCaster API Subroutine Messages.



x
Reference: Requirements for Coding an API Subroutine Using -SET

When you code a ReportCaster API subroutine:

Note:



x
Reference: Identification Arguments for ReportCaster API Subroutines

The ReportCaster API provides a pair of identification arguments as input to certain subroutines.

You can identify a job to the ReportCaster API with either the jobdesc or the scheduleid argument.

Note: The ReportCaster Administrator can determine a schedule ID for a job by running the report from the ReportCaster Console. Both administrators and users can determine a schedule ID by using the Log File icon on gray toolbar of the ReportCaster Interface.



x
Syntax: How to Code an HTML Form That Calls a Procedure

You can call a procedure from an HTML form. The following sample HTML code calls a procedure, which in turn calls a ReportCaster API subroutine. For more details on coding syntax, see your the Developing Reporting Applications manual, and the HTML files residing on /ibi_html/broker/.

<FORM ACTION="/cgi-bin/ibi_cgi/ibiweb.exe" METHOD="get">
<INPUT NAME="IBIF_ex" VALUE="procedure_name" TYPE="hidden">

where:

procedure_name

Is the name of the procedure to run. It contains the call to the ReportCaster API subroutine. A procedure must reside in a path defined to the WebFOCUS Reporting Server. On Windows and UNIX, it must be located in EDAPATH. On OS/390, it must be in a partitioned data set (PDS) allocated to ddname EDARPC. Do not specify the file name extension in the VALUE= field.


WebFOCUS