RPG/400 Help

POST (Post)

*---------*---------------*-----------------*----------------*---------------*
|   CODE  |    FACTOR 1   |     FACTOR 2    |     RESULT     |  INDICATORS   |
|         |               |                 |      FIELD     |               |
*---------*---------------*-----------------*----------------*---------------*
| POST    | Program       | File name       | INFDS          |    _ ER _     |
|         | device        |                 | name           |               |
*---------*---------------*-----------------*----------------*---------------*

The POST operation puts information in an INFDS (file information data structure). The information is either on the status of a specific program device or I/O feedback associated with a file.

In factor 1, you can specify a program device name to get information about that specific program device. Use either a character field of length 10 or less, a character literal, or a character named constant. If you leave factor 1 blank, you get I/O feedback information.

In factor 2, specify the name of a file. Information for this file is posted in the INFDS associated with this file. If you specify a program device in factor 1, the file must be defined as a WORKSTN file.

If you specify a file in factor 2, you can leave the result field blank. The INFDS associated with this file will be used. You can specify a file in factor 2 and its associated INFDS in the result field. If you leave factor 2 blank, you must specify an INFDS in the result field; information from the file associated with this INFDS will be posted.

In positions 56 and 57, you can specify an indicator that is set on if there is an error. If no indicator is specified, control passes to your INFSR subroutine (if you have specified one) or the default error/exception handler when an error/exception occurs.

Even when a POST operation code is not processed, its existence in your program can affect the way the RPG/400 language operates. Usually, the INFDS is updated at each input and output operation or block of operations. However, if anywhere in your program, you have specified a POST operation with factor 1 blank, then RPG/400 updates the I/O Feedback Information area and the Device Dependent Feedback Information area in the INFDS of any file only when you process a POST operation for that file (except for the area *STATUS which is always updated). To ensure that the DUMP operation code provides up-to-date information in this case, issue a POST operation before the DUMP operation.

If a program has no POST operation code, or if it has only POST operation codes with factor 1 specified, the INFDS is updated with each input/output operation or block of operations. If RPG is blocking records, the information in the INFDS will be valid for the last block of records processed. If you require more accurate information, do not use record blocking. If you do not require feedback information after every input/output operation, you may be able to improve performance by using the POST operation only when you require the feedback information.

When a POST operation is processed, the associated file must be open. If you specify a program device on the POST operation, it does not have to be acquired by the file.


[ Top of Page | Previous Page | Next Page | Table of Contents ]