POST (Post)
POST (Post)
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:
- Open Feedback Information for the file Information for the file OR Get Attribute Information
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 Information. Use either a character field of length 10 or less, a character literal, or a character named constant. If program-device is 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.
- If you do not specify an INFDS name, the INFDS associated with this file using the INFDS keyword in the file specification will be used.
- If you do not specify an INFDS name in traditional syntax, you must specify the data structure name that has been used in the INFDS keyword for the file specification in the result field; information from the associated file in the file specification will be posted.
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
- The presence of a POST operation with no program-device specified for a file defined on a global File specification will affect the the module.
- The presence of a POST operation with no program-device specified to the INFDS for files defined in subprocedures.
- The presence of a POST operation with no program-device specified for a locally-defined file will only affect the implicit posting of files, or for other files defined in that subprocedure. is passed as a parameter is determined by the module in which the file is defined. A POST operation with no program-device specified always posted to that file’s INFDS.
- If a global file is passed as a parameter to another procedure in the same module, and that procedure does a POST operation to its parameter, that POST operation will not be considered to be a POST operation to a global file.
Usually, the INFDS is updated at each input and output operation or block of operations. However, if the presence of a POST then RPG IV updates the I/O Feedback Information area and the Device 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 (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, 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 information after every input/output operation, you may be able to improve performance by using the POST operation only when you require
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.