*---------*---------------*-----------------*----------------*---------------* | CODE | FACTOR 1 | FACTOR 2 | RESULT | INDICATORS | | | | | FIELD | | *---------*---------------*-----------------*----------------*---------------* | FREE | | Program name | | _ ER _ | *---------*---------------*-----------------*----------------*---------------*
The FREE operation removes a program from the list of activated programs, frees static storage, and ensures program initialization (first cycle processing) the next time the program is called. It does not close files or unlock data areas.
Factor 2 contains the name of the program to be deactivated. It must contain the name of a field, named constant, literal, or array element that contains the name of the program to be deactivated. The entry in factor 2 must be character data; it can include a qualified name such as LIB/PGM. The name preceding the slash is the library that contains the program to be freed from the activated program list. Specify only the program name if you want to search the library list. The RPG/400 language uses the program name exactly as specified in the literal, field, or array element to determine the program to be called. (Lowercase characters are not shifted to uppercase, and a name enclosed in quotation marks (for example 'ABC') always includes the quotation marks as part of the name of the program to be freed.) *LIBL and *CURLIB are not supported (for example, '*LIBL/PROG').
You can specify any valid resulting indicator in positions 56 and 57 to be set on if FREE is not completed successfully. No error occurs if the program to be freed is not active (for example, the program does not exist).
See the CALL (Call a Program) operation for details on how program references are grouped.
Figure "CALL/FREE Operations" shows the FREE operation being used with the CALL operation.
Figure 30. CALL/FREE Operations
*...1....+....2....+....3....+....4....+....5....+....6....+....7... CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++ C* C* When the CALL operation is processed, the data in the result C* fields of the parameter list can be accessed by PROGA. The C* parameter list ends when the first calculation operation other C* than a PARM operation is encountered. C CALL 'PROGA' C PARM FLDA 30 C PARM FLDB 30 C PARM FLDC 50 C* C* When the FREE operation is processed, PROGA is removed from the C* list of activated programs. Removing it from the list ensures C* a fresh copy of all fields in PROGA the next time the program is C* called. Indicator 55 is set on if the FREE operation is not C* completed successfully. C* C FREE 'PROGA' 55 55 = NO SUCCESS
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.