FOR_EACH_OBJECT

LANSA Composer

FOR_EACH_OBJECT

This is an iterator activity that iterates for each object matching specified criteria in a named IBM i server library.  The processing sequence directives nested beneath the activity are repeated for each matching object found.  This activity is supported only on IBM i servers.

INPUT Parameters:

LIB : Required

This parameter must specify the name of the library containing the objects to be iterated.

You may also specify one of the special values *ALL, *ALLUSR, *CURLIB, *LIBL, *USRLIBL.

You should be very careful if you specify some of these special values that will enumerate more than one library, especially the *ALL or *ALLUSR values, as the request may take a considerable time to process.

OBJ : Optional

This parameter specifies which objects in the specified library or libraries are to be iterated.  You may use the default value *ALL or you may specify the name or generic name of the objects required.  A generic name is specified as a character string that contains one or more characters followed by an asterisk (*).  For example, the value ABC* selects all objects whose names begin with the characters 'ABC' that exist in the specified library or libraries and that also match the object type specified by the OBJTYPE parameter.

OBJTYPE : Optional

This parameter specifies the object type of the objects in the specified library or libraries that are to be iterated.  You may use the default value *ALL or you may specify a particular IBM i object type such as *PGM, *FILE etc.

OUTPUT Parameters:

OBJOUT

Upon each iteration, this parameter will contain the name of the current object.

LIBOUT

Upon each iteration, this parameter will contain the name of the library containing the current object.  In most cases, this will be the same value as specified on the LIB input parameter, unless you used one of the special values on the LIB parameter that do not identify a particular library name such as *ALL or *ALLUSR.

OBJTYPEOUT

Upon each iteration, this parameter will contain the object type of the current object – for example, *PGM or *FILE.

OBJATTROUT

Upon each iteration, this parameter will contain the attribute of the current object – for example, an object of type *FILE might have one of several possible attributes including PF, LF or SAVF.

OBJSIZEOUT

Upon each iteration, this parameter will contain the size of the current object.

OBJTEXTOUT

Upon each iteration, this parameter will contain the text description of the current object.