POST (Post)

Free-Form Syntax POST{(E)} {program-device} file-name
Code Factor 1 Factor 2 Result Field Indicators
POST (E) program-device file-name INFDS name _ ER _

The POST operation puts information in an INFDS (file information data structure). This information contains the following:

The program-device operand specifies a program device name to get information about that specific program device. If you specify a program device, the file must be defined as a WORKSTN file. If program-device is specified, then the INFDS will contain Get Attribute Information following the Open Feedback Information. Use either a character field of length 10 or less, a character literal, or a character named constant. If program-device is not specified, then the INFDS will contain Input/Output Feedback Information and Device Dependent Feedback Information following the Open Feedback Information.

Specify the name of a file in the file-name operand. Information for this file is posted in the INFDS associated with this file.

In free-form syntax, you must specify a file-name and cannot specify an INFDS name. In traditional syntax, you can specify a file-name, an INFDS name, or both.

To handle POST exceptions (file status codes greater than 1000), either the operation code extender 'E' or an error indicator ER can be specified, but not both. For more information on error handling, see File Exception/Errors.

Even when a POST operation code is not processed, its existence in your program can affect the way the RPG IV language operates. The presence of a POST operation with no program-device specified can affect the posting of feedback to one or more files.

Usually, the INFDS is updated at each input and output operation or block of operations. However, if the presence of a POST operation affects the posting of feedback to the INFDS of a file, then RPG IV updates the I/O Feedback Information area and the Device Dependent Feedback Information area in the INFDS of the file only when you process a POST operation for the file. The File Dependent Information in the INFDS is updated on all Input/Output operations. If you have opened a file for multiple-member processing, the Open Feedback Information in the INFDS will be updated when an input operation (READ, READP, READE READPE) causes a new member to be opened.

Note that DUMP retrieves its information directly from the Open Data Path and not from the INFDS, so the file information sections of the DUMP do not depend on POST.

If a program has no POST operation code, or if it has only POST operation codes with program-device specified, the Input/Output Feedback and Device Dependent Feedback section is updated with each input/output operation or block of operations. If RPG is blocking records, most of the information in the INFDS will be valid only for the last complete block of records processed. When doing blocked input, from a data base file, RPG will update the relative record number and key information in the INFDS for each read, not just the last block of records processed. If you require more accurate information, do not use record blocking. See File Information Data Structure for more information on 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.

For more information, see File Operations.



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