ACQ (Acquire)

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

The ACQ operation acquires the program device specified by device-name for the WORKSTN file specified by workstn-file. If the device is available, ACQ attaches it to the file. If it is not available or is already attached to the file, an error occurs.

To handle ACQ exceptions (file status codes greater than 1000), either the operation code extender 'E' or an error indicator ER can be specified, but not both. If no error indicator or 'E' extender is specified, but the INFSR subroutine is specified, the INFSR receives control when an error/exception occurs. If no indicator, 'E' extender, or INFSR subroutine is specified, the default error/exception handler receives control when an error/exception occurs. For more information on error handling, see File Exception/Errors.

No input or output operation occurs when the ACQ operation is processed. ACQ may be used with a multiple device file or, for error recovery purposes, with a single device file. One program may acquire and have the device available to any called program which shares the file and allow the called program to release the device. See the section on "Multiple-Device Files" in the chapter about using WORKSTN files in the IBM Rational Development Studio for i: ILE RPG Programmer's Guide.

For more information, see File Operations.



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