Using the RPG Interface to VPLUS [ HP RPG/iX Reference Manual ] MPE/iX 5.0 Documentation
HP RPG/iX Reference Manual
Using the RPG Interface to VPLUS
To use VPLUS in an RPG program, perform the following steps (each of the
steps is explained in detail in the following sections in this chapter):
1. Create the VPLUS forms file using the VPLUS utility, FORMSPEC.
2. Specify screen-related options using the Header Specification.
3. Specify screen-related options and define the VPLUS forms file
using File Description Specifications. Optionally, you can use
this specification to define VPLUS batch and trace files.
4. Enter Input Specifications to describe the records that VPLUS uses
to report the results of screen operations to the program.
5. Enter Calculation Specifications to initiate VPLUS actions and to
return the results of these actions. (Use Calculation
Specifications with demand files only.)
6. Enter Output Specifications that describe the records that you use
to initiate VPLUS screen operations.
When you use VPLUS, define one or more input records for VPLUS to use in
communicating the results of its actions. You normally enter a separate
input record for each result (event) that you expect for the screen
functions that VPLUS performs. Actions direct VPLUS to perform some
screen function such as displaying a form. To initiate an action, place
an action code and, depending on the action, other information in the
WORKSTN output record. If the WORKSTN file is a demand file, you must
perform exception output to execute the action. To illustrate how action
and events work, the following steps show how you commonly use a VPLUS
form to read terminal data:
General screen procedure: Action/event that performs the procedure:
Display an empty form. Action: Get next form to display.
Action: Display a form with initial data
values.
Read input entered by the terminal Action: Read input from the terminal.
operator.
Event: What was entered?
Perform VPLUS data edits. Action: Perform VPLUS edits.
Event: Did VPLUS edit errors occur?
Transfer data to the program buffer. Action: Transfer data from the VPLUS
buffer to the program buffer.
Event: What is the data that was read?
You can perform input editing in the program or you can have VPLUS edit
according to the edits entered when the VPLUS forms file was created by
FORMSPEC (see the next section). When VPLUS edits data, it uses the
VPLUS buffer. If you're doing the editing yourself, substitute your own
edits for the VPLUS edits in Step 3 above.
Using FORMSPEC
Before you can use VPLUS to process data from the terminal, you must
create the VPLUS forms file. The forms file defines the data fields on
the screen and constants such as field names. Create the forms file
using the VPLUS utility, FORMSPEC. FORMSPEC is described in the Data
Entry and Forms Management System VPLUS/3000 manual.
Entering the Header Specification
The next two sections describe the Header Specification facilities
(run-time errors and the Error Dump) that function differently when used
with the RPG interface to VPLUS.
Handling Run-Time Errors.
Normally, you determine how run-time errors are handled by your entries
in the Error Log Field (column 55) and the Error Response Field (columns
56-71) of the Header Specification. When you're using the RPG interface
to VPLUS, however, error messages are displayed in the message window and
the terminal operator selects a response by pressing the appropriate
function key. The function keys and their corresponding responses are
shown in Table 10-1 .
Table 10-1. Entering Error Responses Using the Function Keys
--------------------------------------------------------------------------------------
| | |
| Function Key | Response |
| | |
--------------------------------------------------------------------------------------
| | |
| f1 | Continue execution. |
| | |
| f2 | Skip the input record containing the error and continue |
| | execution. |
| | |
| f3 | Terminate the program by executing the normal termination |
| | code. |
| | |
| f4 | Terminate the program immediately. |
| | |
| f5 | Terminate normally and print an error dump. |
| | |
| f6 | Terminate immediately and print an error dump. |
| | |
--------------------------------------------------------------------------------------
Requesting an Error Dump.
The Error Dump is normally written to the standard list device, $STDLIST.
When using VPLUS, the terminal is in session mode and $STDLIST is the
terminal.
Since the Error Dump is of limited use when displayed on the terminal,
you may want to direct it to a file. Enter the name of the file in Error
Dump File Name Field (columns 7-14) of the Header Specification.
Entering File Description Specifications
The next six sections explain how to define VPLUS files and how RPG
screen-related options work with the RPG interface to VPLUS.
Defining VPLUS Files.
To use VPLUS in an RPG program, you must define a terminal WORKSTN file.
(You can use only one WORKSTN file in a program.) Use this file for all
communication with VPLUS.
To define a WORKSTN file, enter a file type of update in the File Type
Field (column 15) of the File Description Specification. Describe the
records as variable in the Logical Record Length Field (columns 24-27).
Enter WORKSTN in the Device Class Name Field (columns 40-46) for the
file.
Usually, a VPLUS WORKSTN file is a demand file, but you may define it as
a primary file in the File Designation Field (column 16) of the File
Description Specification. Primary files are processed by the RPG logic
cycle. An update primary file may be used to advantage, for example,
when processing is limited to a single cycle that includes displaying a
form, reading data from it and writing data to it. You may find it more
convenient and flexible to define the WORKSTN file as an update
demand file. In this case, processing is performed by Calculation
Specifications which use demand READs and exception output.
There are two other files that you may use with a WORKSTN file: a batch
file and a trace file. (These files are optional.) You can use batch
files for saving screen data; data is automatically written to the batch
file from the VPLUS buffer, one record per form. You can use the
reformatter facility (REFSPEC) of VPLUS to rearrange the form fields so
that the batch file can be used by other applications. To use a batch
file, enter a BATCH File Description Continuation line (BATCH in the
Option Type Field, columns 54-59). Trace files are handy for finding
program errors. Each action and event (see the "VPLUS Action Codes" and
"VPLUS Event Codes" sections) causes at least one record to be written to
the file. You can examine the trace file to find errors. Run-time error
messages are written to the trace file and are displayed at the terminal.
If the trace file becomes full, the program continues although tracing
stops. To use a trace file, enter a TRACE File Description Continuation
line for it.
Specifying the Error Message Display Interval.
Run-time error messages are displayed on the terminal for 3 seconds. You
can change this interval by entering a number from 0-9 (0 suppresses the
message) in the Interface Control Field (column 51) of the File
Description Specification. The display interval applies only to WORKSTN
errors. It does not apply to RPG errors, VPLUS edit checking errors or
to messages placed directly in the window by the PUTMSG and SHOMSG
actions (see the "VPLUS Action Codes" section).
Enabling the BREAK Key.
On some terminals, the BREAK key is physically positioned near the ENTER
key. As a result, it is easy to press BREAK by accident. Since it is
difficult to recover from a break, the BREAK key is disabled when a
WORKSTN file is being used.
If you need to use the BREAK key, enable it by entering a B in the
Interface Control Field (column 52) of the File Description Specification
for the WORKSTN file.
Enabling the Function Key Labels.
You can define eight function key labels for a VPLUS form. To display
the labels at run time, enable them by entering an L in the Interface
Control Field (column 50) of the File Description Specification.
Downloading VPLUS Forms.
When using terminals that allow forms storage, you can download VPLUS
forms. This greatly improves the speed with which screens are displayed.
Normally, only one form can be downloaded. You can increase this number
by entering a FORMDL File Description Continuation line that specifies
this number.
You can download forms in one or more of the following ways:
Preload The form is displayed using the SHOW action (with the
preload option specified). If the form is not already in
terminal memory, it is placed there. If you use SHOW
without the preload option, the form is displayed
directly to the terminal.
You cannot download forms with the SHODTA action;
instead, enter a PUTDTA action followed by a SHOW action
with the preload option specified.
Look-ahead The next form, named in the forms file or in a GETNXT
action, is loaded before or after the current form is
read depending on the data communications in use. If
point-to-point is used, the next form is loaded before
the current form is read. If multipoint is used, the
next form is loaded after the current form is read.
Nothing happens when the form is already in memory.
This downloading method is always in effect unless you
enter N for the look-ahead option of the RDTERM action.
Load-forms The LOADFM action loads the forms contained in the array
named in the LOADFM File Description Continuation line.
Use LOADFM before entering a SHOW or SHODTA action.
Forms are loaded in the order specified by the array,
until no more terminal memory is available. When this
happens, remaining forms are ignored.
Using the STATUS Array.
The STATUS array (declared in a STATUS File Description Continuation
line) is predefined as a 6-element, 10-digit array with zero decimal
places. VPLUS returns the error status in the first element of the
array. This status comes from the first word of the VPLUS COMAREA. When
you use the LOADFM action, the number of downloaded forms is returned in
the second element of the array.
Example
Figure 10-2 shows how to enter a File Description Specification and
its Continuation lines to define a VPLUS forms file and the options
relating to it. The File Description Specification indicates that the
WORKSTN file (TRANSFIL) is an update demand file and that the function
keys are used as well as the BREAK key. The FORMS File Description
Continuation line (line 2) names the VPLUS forms file to be processed.
The BATCH Continuation line (line 3) names the file (BATCHB) that
contains data entered from the terminal. The TRACE Continuation line
(line 4) names the file (TRACEFL) that logs VPLUS actions, events, and
run-time errors. The STATUS Continuation line (line 5) names the array
that contains the VPLUS status information. The FORMDL Continuation line
(line 6) specifies that there are 3 forms to download into terminal
memory. The LOADFM Continuation line (line 7) names the array that
contains the form names.
___________________________________________________________________________________
| |
| 1 2 3 4 5 6 7 |
| 678901234567890123456789012345678901234567890123456789012345678901234|
| _______________________________________________________ |
| |
| 1 FTRANSFILUD V 80 WORKSTN L5B |
| 2 F KFORMS FORMA |
| 3 F KBATCH BATCHA |
| 4 F KTRACE TRACEFL |
| 5 F KSTATUSSARRAY |
| 6 F KFORMDL3 |
| 7 F KLOADFMFMARRAY |
| |
| |
___________________________________________________________________________________
Figure 10-2. Entering VPLUS File Description Specifications
Entering Input Specifications
When VPLUS performs an action, it places the outcome of the action in an
input record. Each outcome has a unique event code. You can examine
this code and direct processing accordingly. The next two sections
describe the VPLUS event codes and the input record formats for each of
them.
VPLUS Event Codes.
When the VPLUS Interface reports an event, it places the event code in
the first field of the WORKSTN input record.
Event codes 00-08 indicate that the terminal operator pressed a function
key. Event code 00 indicates that the operator entered data and pressed
ENTER. In response to events 01-08, you must enter an action. Event
codes 09-12 are responses to previous actions in the program. (These
actions use the VPLUS data buffer and normally take full advantage of the
VPLUS data handling features.)
Table 10-2 lists all of the event codes that are returned by the RPG
VPLUS Interface.
Table 10-2. VPLUS Event Codes
-----------------------------------------------------------------------------------------------
| | | |
| Event | Description | Returned in Response to |
| Code | | this Action Code |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| 00 | The terminal operator pressed ENTER. Data is returned in | 54 (RDTERM) |
| | the record. | |
| | | |
| 01 | The terminal operator pressed f1. No data is returned | 54 (RDTERM) |
| | unless F is used with the RDTERM action. | |
| | | |
| 02 | The terminal operator pressed f2. No data is returned | 54 (RDTERM) |
| | unless F is used with the RDTERM action. | |
| | | |
| 03 | The terminal operator pressed f3. No data is returned | 54 (RDTERM) |
| | unless F is used with the RDTERM action. | |
| | | |
| 04 | The terminal operator pressed f4. No data is returned | 54 (RDTERM) |
| | unless F is used with the RDTERM action. | |
| | | |
| 05 | The terminal operator pressed f5. No data is returned | 54 (RDTERM) |
| | unless F is used with the RDTERM action. | |
| | | |
| 06 | The terminal operator pressed f6. No data is returned | 54 (RDTERM) |
| | unless F is used with the RDTERM action. | |
| | | |
| 07 | The terminal operator pressed f7. No data is returned | 54 (RDTERM) |
| | unless F is used with the RDTERM action. | |
| | | |
| 08 | The terminal operator pressed f8. No data is returned | 54 (RDTERM) |
| | unless F is used with the RDTERM action. | |
| | | |
| 09 | Read the number of fields that failed VPLUS or user | 59 (EDITS) or 61 |
| | edits. | (NUMERR) |
| | | |
| 10 | Read data from the VPLUS data buffer (data is included | 64 (GETDTA) |
| | in the record). | |
| | | |
| 11 | Return the record number of the current batch record, | Any action (or no |
| | the mode of operation (0= collect, 1= browse), the | action) except 54, 59, |
| | repeat/append status, the freeze/append status the next | 61, 64, and 74. |
| | form name. | |
| | | |
| 12 | Return the length and contents of a particular field in | 74 (GETFLD) |
| | the VPLUS data buffer. | |
| | | |
-----------------------------------------------------------------------------------------------
VPLUS Input Record Formats.
Depending on the event, input records have one of four possible formats
(as shown in Table 10-3 ). Each of them contains a unique code for
the event and the current form name in the first two fields. (The
current form name lets you associate the data with the form in which it
is entered.)
Table 10-3. VPLUS Input Record Formats
-----------------------------------------------------------------------------------------------
| | | |
| Event Code | Input Field | Input Field Description |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| 00-08, 10 | Event code | 00-08 and 10. |
| | (1-2) | |
| | | |
| | Current form name | |
| | (3-17) | |
| | | |
| | Data length | The total number of characters required by all |
| | (18-21) | fields in the current form. |
| | | |
| | Data | This field is separated into sections according |
| | (22-end of record) | to the definition of the current form. Only |
| | | events 0 and 10 use this field. |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| 09 | Event code | 09. |
| | (1-2) | |
| | | |
| | Current form name | |
| | (3-17) | |
| | | |
| | Number of errors | The total number of fields containing errors. |
| | (18-22) | The errors are detected either by VPLUS (using |
| | | FORMSPEC edit checks) or by edits in the |
| | | program. |
| | | |
| 11 | Event code | 11. |
| | (1-2) | |
| | | |
| | Current form name | |
| | (3-17) | |
| | | |
| | Batch record number | When returned at the beginning of a program, |
| | (18-22) | this number is the end-of-batch +1. It is |
| | | useful in determining what the upper bounds is |
| | | for an existing batch file. |
| | | |
| | Mode | 0 Collect mode. |
| | (23) | |
| | | 1 Browse mode (the mode of operation that |
| | | allows data in the batch file to be |
| | | examined and modified; new batch records |
| | | cannot be added). |
| | | |
| | Repeat/Append | This field is 0, 1, or 2. |
| | (24) | |
| | | |
| | Freeze/Append | This field is 0, 1, or 2. |
| | (25) | |
| | | |
| | Next form name | |
| | (26-40) | |
| | | |
| | Number of non-deleted | |
| | batch records | |
| | (41-45) | |
| | | |
-----------------------------------------------------------------------------------------------
Table 10-3. VPLUS Input Record Formats (cont.)
-----------------------------------------------------------------------------------------------
| | | |
| Event Code | Input Field | Input Field Description |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| 12 | Event code | 12. |
| | (1-2) | |
| | | |
| | Current form name | |
| | (3-17) | |
| | | |
| | Field number | This field contains a unique identifier for the |
| | (18-22) | field being retrieved. It does not change if |
| | | the field position in the form changes. |
| | | |
| | Field length | |
| | (23-26) | |
| | | |
| | Data | This field contains the data in the returned |
| | (27-end of record) | record. |
| | | |
-----------------------------------------------------------------------------------------------
Example
Figure 10-3 shows how to define an input record for event 09 which
reads the number of fields that failed the VPLUS edits.
___________________________________________________________________________________
| |
| 1 2 3 4 5 6 7 |
| 678901234567890123456789012345678901234567890123456789012345678901234|
| _______________________________________________________ |
| |
| I*** NUMBER OF EDIT ERRORS (09) |
| I CC 19 1 C0 2 C9 |
| I 3 17 FORMB |
| I 18 220NUMERR 01 |
| |
| |
___________________________________________________________________________________
Figure 10-3. Entering VPLUS Input Specifications
Entering Calculation Specifications
For demand WORKSTN files, you display a VPLUS form and read the data
entered into it at the terminal by entering Calculation Specification
operations. Initiate a VPLUS action by placing its action code or
mnemonic in a WORKSTN output record, then perform exception output to
execute the action. When an action results in more than one VPLUS
response, you must retrieve the event code for them in an input record.
The next two sections explain how to return an event and how to start an
action.
Initiating VPLUS Actions.
To perform a VPLUS action (see the action codes in Table 10-4) place the
action code or mnemonic in the first positions of the WORKSTN output
record then perform exception output.
Example
Figure 10-4 shows how to perform the VPLUS edits (EDITS (59) action)
specified in FORMSPEC. (Alternatively, "59 " could be moved to ACTION in
line 1 instead of "EDITS ".)
___________________________________________________________________________________
| |
| 1 2 3 4 5 6 7 |
| 678901234567890123456789012345678901234567890123456789012345678901234|
| _______________________________________________________ |
| |
| 1 C 10 MOVEL"EDITS " ACTION |
| C 10 SETON 35 EDITS - 59 |
| C 10 EXCPT |
| |
| |
___________________________________________________________________________________
Figure 10-4. Initiating a VPLUS Action Using Calculation Specifications
Returning VPLUS Events.
You learn of an event by performing a READ Calculation Specification
operation for the WORKSTN file. The data returned for the event is
either from the terminal or is returned in response to a previous action
code. Data that is returned is placed in an input record defined for the
WORKSTN file.
Example
Figure 10-5 shows how to return the number of edit errors encountered
by VPLUS during an EDITS (59) action (see Figure 10-4 ).
___________________________________________________________________________________
| |
| 1 2 3 4 5 6 7 |
| 678901234567890123456789012345678901234567890123456789012345678901234|
| _______________________________________________________ |
| |
| C 10 READ TRANSFIL H0 |
| |
| |
___________________________________________________________________________________
Figure 10-5. Returning a VPLUS Event Using Calculation Specifications
Entering Output Specifications
The next two sections describe the VPLUS action codes and how to define
the output records used with them.
VPLUS Action Codes.
The first field in the WORKSTN output record is the VPLUS action code (or
action mnemonic). Table 10-4 lists all of the action codes that you
can use with the RPG VPLUS Interface.
If you're doing your own input editing (not using VPLUS FORMSPEC edits),
you only need to use actions 50-57. If you want VPLUS to perform input
editing, or if your screen application is more complex, you can exercise
the full capabilities of VPLUS by using any of the actions codes listed
in Table 10-4 .
Table 10-4. VPLUS Action Codes
-------------------------------------------------------------------------------------------------
| | | | |
| Action | Mnemonic | Description | Corresponding |
| Code | | | VPLUS |
| | | | Intrinsic |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 50 | CHGNXT | Specify the next form name and whether the | None |
| | | form is repeat/append, freeze or normal. | |
| | | | |
| 51 | GETNXT | Get the next form from the forms file, and | VGETNEXTFORM |
| | | set repeat/append and freeze/append status. | |
| | | If repeat mode is set, the form is not | |
| | | retrieved. Follow this action by SHOW | |
| | | (action 53) to display the form at the | |
| | | terminal. | |
| | | | |
| 52 | PUTMSG | Specify a message (and any enhancements) to | VPUTWINDOW |
| | | display in the error/status line of the | |
| | | terminal. The message is displayed only | |
| | | when SHOW (action 53) is executed. | |
| | | | |
| 53 | SHOW | Display the current form, any initial data | VSHOWFORM |
| | | and any message on the terminal screen. | |
| | | | |
| 54 | RDTERM | Read terminal input into the VPLUS data | VREADFIELDS |
| | | buffer. Follow this action by a READ | VGETBUFFER |
| | | Calculation Specification operation to | |
| | | transfer the data to your program. (The | |
| | | returned record will be one of the event | |
| | | types 00-08.) If VPLUS performs input | |
| | | editing, follow RDTERM with EDITS (action | |
| | | 59).[REV BEG] Note that a form must be | |
| | | displayed before RDTERM will wait for a | |
| | | user response.[REV END] | |
| | | | |
-------------------------------------------------------------------------------------------------
Table 10-4. VPLUS Action Codes (Continued)
-------------------------------------------------------------------------------------------------
| | | | |
| Action | Mnemonic | Description | Corresponding |
| Code | | | VPLUS |
| | | | Intrinsic |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 55 | SHOMSG | Display a message in the program (with any | VPUTWINDOW |
| | | enhancements) in the error/status line of | VSHOWFORM |
| | | terminal. If data in the VPLUS buffer has | |
| | | changed, the new data is displayed. This | |
| | | action is a combination of PUTMSG (action | |
| | | 52) and SHOW (action 53). | |
| | | | |
| 56 | CORERR | Identify the field that failed user edits. | VSETERROR |
| | | The output record contains the field number | VSHOWFORM |
| | | and a message to display. The terminal | VREADFIELDS |
| | | user's response is read. Follow this | VGETBUFFER |
| | | action with RDTERM (action 54) to read the | |
| | | user response (event types 00-08). This | |
| | | action is a combination of BADFLD (action | |
| | | 62), SHOW (action 53), and RDTERM (action | |
| | | 54). | |
| | | | |
| 57 | SHODTA | Display data from the program buffer to | VPUTBUFFER |
| | | fields on the screen. This action is a | VSHOWFORM |
| | | combination of PUTDTA (action 63) and SHOW | |
| | | (action 53). | |
| | | | |
| 58 | INIT | Initialize fields in the current form | VINITFORM |
| | | according to defaults specified in | VERRMSG |
| | | FORMSPEC. If there are errors, move a | VPUTWINDOW |
| | | message to the window. | |
| | | | |
| 59 | EDITS | Perform the edits for the fields in the | VFIELDEDITS |
| | | current form. If there are any errors, | VERRMSG |
| | | display a message in the terminal window | VPUTWINDOW |
| | | for the first error. Follow this action | |
| | | with a READ Calculation Specification | |
| | | operation. The record that is returned | |
| | | (event 09) contains the number of fields | |
| | | the failed the edit. | |
| | | | |
| 60 | PRINT | Print the current form (with its data) on | VPRINTFORM |
| | | the line printer. Before you this action, | |
| | | read the form with GETNXT (action 51). | |
| | | | |
| 61 | NUMERR | Return the error status. Follow this | None |
| | | action by a READ Calculation Specification | |
| | | operation to access the status. The record | |
| | | returned (event 09) contains the number of | |
| | | fields that failed the edits. | |
| | | | |
| 62 | BADFLD | Indicate that a field failed a user edit. | VSETERROR |
| | | The output record contains the number of | |
| | | the field and a message for the window. | |
| | | | |
-------------------------------------------------------------------------------------------------
Table 10-4. VPLUS Action Codes (Continued)
-------------------------------------------------------------------------------------------------
| | | | |
| Action | Mnemonic | Description | Corresponding |
| Code | | | VPLUS |
| | | | Intrinsic |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 63 | PUTDTA | Replace the data in the VPLUS data buffer | VPUTBUFFER |
| | | with the data that you specify. The output | |
| | | record contains the new data for the VPLUS | |
| | | buffer and the length of that data. | |
| | | | |
| 64 | GETDTA | Move the data in the VPLUS data buffer to | VGETBUFFER |
| | | the program buffer. Follow this action by | |
| | | a READ Calculation Specification operation | |
| | | to access the data (event 10). | |
| | | | |
| 65 | FINISH | Perform the final processing specified for | VFINISHFORM |
| | | the finish phase of the form. If there are | VERRMSG |
| | | errors, move a message to the window. | VPUTWINDOW |
| | | | |
| 66 | WRTBAT | Move the contents of the VPLUS data buffer | VWRITEBATCH |
| | | to the batch record corresponding to the | |
| | | current record number. If collect mode is | |
| | | in effect the current record number is | |
| | | incremented by one. If in browse mode, the | |
| | | current record number is unaffected. | |
| | | | |
| 67 | PREV | Read data from the previous batch record to | VREADBATCH |
| | | the VPLUS data buffer. Place the program | |
| | | in browse mode, if it is not already in | |
| | | that mode. Save the current location in | |
| | | the batch file and the current form name. | |
| | | | |
| 68 | REREAD | Move the data from the current batch record | VREADBATCH |
| | | into the VPLUS data buffer. The program | |
| | | must be in browse mode (this mode is set by | |
| | | PREV, action 67). | |
| | | | |
| 69 | NEXT | Read data from the next batch record into | VREADBATCH |
| | | the VPLUS data buffer. The program must be | |
| | | in browse mode (this mode is set by PREV, | |
| | | action 67). | |
| | | | |
| 70 | RESUME | Return from browse mode to collect mode | none |
| | | (PREV, action 67, must have been used | |
| | | previously). The next form name and the | |
| | | location in batch file are restored. | |
| | | | |
| 71 | DELETE | Delete the current batch record. The | None |
| | | program must be in browse mode (see PREV, | |
| | | action 67). | |
| | | | |
-------------------------------------------------------------------------------------------------
Table 10-4. VPLUS Action Codes (Continued)
-------------------------------------------------------------------------------------------------
| | | | |
| Action | Mnemonic | Description | Corresponding |
| Code | | | VPLUS |
| | | | Intrinsic |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 72 | RDBTNU | Read the batch record identified by its | None |
| | | record number. | |
| | | | |
| 73 | CLRMSG | Clear the message window and, optionally, | VPUTWINDOW |
| | | the message buffer. | VSHOWFORM |
| | | | |
| 74 | GETFLD | Locate the specified field in the VPLUS | VGETFIELD |
| | | data buffer. Follow this action by a READ | |
| | | Calculation Specification operation. The | |
| | | returned record (event 12). contains the | |
| | | field and its length. | |
| | | | |
| 75 | PUTFLD | Transfer data from the program buffer to | VPUTFIELD |
| | | the specified field in VPLUS data buffer. | |
| | | | |
| 76 | LOADFM | Download forms to terminal memory. | VLOADFORM |
| | | | |
| 77 | UNLDFM | Unload (remove) the named form from the | VUNLOADFORM |
| | | "form storage directory", thus releasing | [REV BEG] |
| | | space in terminal memory. | |
| | | | |
| 78 | CHMODE | Set terminal to character mode without | VTURNOFF |
| | | affecting the screen display. Useful for | |
| | | writing escape sequences to slaved printers | |
| | | on MPE/iX systems. | |
| | | | |
| 79 | BLMODE | Set terminal to block mode (restore | VTURNON |
| | | original environment after CHMODE). | [REV END] |
| | | | |
-------------------------------------------------------------------------------------------------
VPLUS Output Record Formats.
The output records for actions must contain the action code (or action
mnemonic). Depending on the action that you use, you may need to enter
other fields as well. The output record formats and the fields used with
them are described in Table 10-5 .
Table 10-5. VPLUS Output Record Formats
----------------------------------------------------------------------------------------------
| | | |
| Action Code | Output Field | Output Field Description |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 50(CHGNXT) | Action code/Mnemonic | 50 in columns 1-2 or CHGNXT in columns 1-6. |
| | (1-6) | |
| | | |
| | Next form name (7-21) | |
| | | |
| | Repeat/Append(22) | "0" - Normal sequence. "1" - Repeat current |
| | | form. "2" - Append current form to self. |
| | | |
| | Freeze/Append(23) | "0" - Clear screen. "1" - Append next form to |
| | | current form. "2" - Freeze current form and |
| | | append next form to it. |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 52(PUTMSG) | Action code/Mnemonic(1-6) | 52 or 55 in columns 1-2; or PUTMSG or SHOMSG in |
| 55(SHOMSG) | | columns 1-6. |
| | | |
| | Message length (7-8) | This field specifies the number of characters |
| | | in the message. |
| | | |
| | Enhancement code (9) | This field specifies the display enhancement |
| | | for the field: |
| | | |
| | | @, A-0 See WINDOWENH in the Data Entry and |
| | | Forms Management System V PLUS/3000 manual. |
| | | |
| | | zero No enhancement. |
| | | |
| | | blank Do not change existing enhancement. |
| | | |
| | Message (10-end of | |
| | record) | |
| | | |
----------------------------------------------------------------------------------------------
Table 10-5. VPLUS Output Record Formats (Continued)
----------------------------------------------------------------------------------------------
| | | |
| Action Code | Output Field | Output Field Description |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 53(SHOW) | Action code/Mnemonic | 53 in columns 1-2 or SHOW in columns 1-6. |
| | (1-6) | |
| | | |
| | Preload option (7) | P If the form is not already loaded into |
| | | terminal memory, it is loaded before |
| | | being displayed. |
| | | |
| | | blank The form is not loaded into terminal |
| | | memory before being displayed. |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 54(RDTERM) | Action code/Mnemonic | 54 in columns 1-2 or RDTERM in columns 1-6. |
| | (1-6) | |
| | | |
| | Function key options (7) | F Return screen data with events 01-08 |
| | | when a function key is pressed. Data is |
| | | always returned with event 00 (when |
| | | ENTER is pressed). |
| | | |
| | | blank Return screen data with event 00, but |
| | | not with events 01-08. |
| | | |
| | Look-ahead options (8) | N Disable the forms downloading |
| | | look-ahead option. |
| | | |
| | | blank Enable the forms downloading |
| | | look-ahead option. |
| | | |
----------------------------------------------------------------------------------------------
Table 10-5. VPLUS Output Record Formats (Continued)
----------------------------------------------------------------------------------------------
| | | |
| Action Code | Output Field | Output Field Description |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 56(CORERR) | Action code/Mnemonic | 56 or 62 in columns 1-2; or CORERR or BADFLD in |
| 62(BADFLD) | (1-6) | columns 1-6. |
| | | |
| | Field number (7-11) | This field identifies the field in error so |
| | | that you can enhance it. |
| | | |
| | Message length (12-13) | This field specifies the number of characters |
| | | in the message which is to be displayed in the |
| | | message window. The length should not exceed |
| | | 79 displayable characters. |
| | | |
| | Enhancement code (14) | This field specifies the display enhancement |
| | | for the field in error: |
| | | |
| | | |
| | | @,A-0 See SINDOWENH in the Data Entry and |
| | | Forms Management System V PLUS/3000 |
| | | manual. |
| | | |
| | | zero No enhancement. |
| | | |
| | | blank Do not change existing enhancement. |
| | | |
| | Message (15-end of | |
| | record) | |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 57(SHODATA) | Action code/Mnemonic | 57 or 63 in columns 1-2; or SHODTA or PUTDTA in |
| 63(PUTDTA) | (1-6) | columns 1-6. |
| | | |
| | Data length (7-10) | The total number of characters required by all |
| | | fields in the current form. |
| | | |
| | Data (11-end of record) | This field is separated into sections according |
| | | to the definition of the current form. The |
| | | program buffer may contain data from a previous |
| | | action or event. To clear the buffer before |
| | | using this action, enter ADD in columns 16-18 |
| | | of the first Output Specification for this |
| | | action. Also enter A in column 66 of the File |
| | | Description Specification for the WORKSTN file. |
| | | |
----------------------------------------------------------------------------------------------
Table 10-5. VPLUS Output Record Formats (Continued)
----------------------------------------------------------------------------------------------
| | | |
| Action Code | Output Field | Output Field Description |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 60(PRINT) | Action code/Mnemonic | 60 in columns 1-2; or PRINT in columns 1-6. |
| | (1-6) | |
| | | |
| | Print control (7) | Y Underline the data field. |
| | | |
| | | blank Do not underline the data field. |
| | | |
| | Page control (8) | + Do not space a line. |
| | | |
| | | - Triple space. |
| | | |
| | | 0 Double space. |
| | | |
| | | 1 Skip to the next page. |
| | | |
| | | % Use the control code in columns 9-11. |
| | | |
| | | |
| | | R No CCTL; release FORMLIST for printing |
| | | immediately after this PRINT action. |
| | | |
| | | blank Single space. |
| | | |
| | Carriage Control Codes | Enter an octal code (from %0-%377). These |
| | (9-11) | codes are described under FWRITE in the MPE/iX |
| | | Intrinsics Reference Manual. |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 72(RDBTNU) | Action code/Mnemonic | 72 in columns 1-2 or RDBTNU in columns 1-6. |
| | (1-6) | |
| | | |
| | Batch record number | |
| | (7-11) | |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 73(CLRMSG) | Action code/Mnemonic | 73 in columns 1-2 or CLRMSG in columns 1-6. |
| | (1-6) | |
| | | |
| | Clear buffer option (7) | I Clear the message from the screen and |
| | | also from the message buffer. |
| | | |
| | | |
| | | |
| | | blank Clear the message from the message |
| | | buffer. |
| | | |
----------------------------------------------------------------------------------------------
Table 10-5. VPLUS Output Record Formats (Continued)
----------------------------------------------------------------------------------------------
| | | |
| Action Code | Output Field | Output Field Description |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 74(GETFLD) | Action code/Mnemonic | 74 or 75 in columns 1-2; or GETFLD or PUTFLD in |
| 75(PUTFLD) | (1-6) | columns 1-6. |
| | | |
| | Field number (7-11) | This field identifies the field to read or |
| | | write. The number is assigned by FORMSPEC and |
| | | does not change even when the field is moved to |
| | | another position on the screen. |
| | | |
| | Field length (12-15) | This field specifies the number of characters |
| | | in the field. |
| | | |
| | Data (16-end of record) | For PUTDTA, this field contains the data record |
| | | to be written to the VPLUS buffer. |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 76(LOADFM) | Action code/Mnemonic | 76 in columns 1-2 or LOADFM in columns 1-6. |
| | (1-6) | |
| | | |
| | Number of forms (7-9) | This field contains the number of forms to load |
| | | into terminal memory from the LOADFM File |
| | | Description Continuation line array. The |
| | | number should not exceed the number declared in |
| | | the FORMDL File Description Continuation line. |
| | | Forms are loaded in the order specified in the |
| | | LOADFM array until terminal memory is |
| | | exhausted; then excess forms are ignored. |
| | | |
| | or | RPG creates the LOADFM array as an unsequenced |
| | | alphanumeric compile-time array with an element |
| | | length of 16 (15 characters for the form name |
| | | and a blank). The number of elements is |
| | | determined by the FORMDL line. If you want to |
| | | enter the form names at run time, rather than |
| | | at compile time, enter an ** line for the array |
| | | at the end of the source program. Instead use |
| | | Input or Calculation Specifications to load the |
| | | names. |
| | | |
| | | If you're using the STATUS array with VPLUS, |
| | | the second element in it contains the actual |
| | | number of forms loaded. |
| | | |
| | Form name (7-21) | This field names the form to be loaded into |
| | | terminal memory. If you're using the STATUS |
| | | array with VPLUS, the second element in it |
| | | contains the actual number of forms loaded. |
| | | |
----------------------------------------------------------------------------------------------
Table 10-5. VPLUS Output Record Formats (Continued)
----------------------------------------------------------------------------------------------
| | | |
| Action Code | Output Field | Output Field Description |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 77(UNLDFM) | Action code/Mnemonic | 77 in columns 1-2 or UNLDFM in columns 1-6. |
| | (1-6) | |
| | | |
| | Form name (7-21) | This field names the form to be removed from |
| | | the forms storage directory. This releases |
| | | space in terminal memory. (Forms that have not |
| | | recently been used are automatically removed to |
| | | make room for new ones.) |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Other | Action code/Mnemonic | 51 in columns 1-2 or GETNXT in columns 1-6. 58 |
| actions | (1-6) | in columns 1-2 or INIT in columns 1-6. 59 in |
| | | columns 1-2 or EDITS in columns 1-6. 60 in |
| | | columns 1-2 or PRINT in columns 1-6. 61 in |
| | | columns 1-2 or NUMBERR in columns 1-6. 64 in |
| | | columns 1-2 or GETDTA in columns 1-6. 65 in |
| | | columns 1-2 or FINISH in columns 1-6. 66 in |
| | | columns 1-2 or WRTBAT in columns in 1-6. 67 in |
| | | columns 1-2 or PREV in columns in 1-6. 68 in |
| | | columns 1-2 or REREAD in columns 1-6. 69 in |
| | | columns 1-2 or NEXT in columns 1-6. 70 in |
| | | columns 1-2 or RESUME in columns 1-6. 71 in |
| | | columns 1-2 or DELETE in columns 1-6.[REV BEG] |
| | | 78 in columns 1-2 or CHMODE in columns 1-6. 79 |
| | | in columns 1-2 or BLMODE in columns 1-6.[REV |
| | | END] |
| | | |
| | | For NEXT and PREV, if you try to read past |
| | | either end of a batch file, the read is not |
| | | actually executed. The current record number |
| | | is set to out-of-bounds (end of batch + 1 for |
| | | NEXT and - 1 for PREV). Aside from the current |
| | | record number, the program has no other |
| | | indication of an out-of-bounds condition. |
| | | |
----------------------------------------------------------------------------------------------
Example
Figure 10-6 shows how to enter an output record to start the PUTDTA
action (63).
___________________________________________________________________________________
| |
| 1 2 3 4 5 6 7 |
| 678901234567890123456789012345678901234567890123456789012345678901234|
| _______________________________________________________ |
| |
| O E 37 |
| O 6 "PUTDTA" |
| O DATALN 10 |
| O DATA 67 |
| |
| |
___________________________________________________________________________________
Figure 10-6. Entering VPLUS Output Specifications
MPE/iX 5.0 Documentation