YOPRMDLLST (Operate on a Model Object List) Command

This command allows a user to perform set operations on two input model object lists and to optionally direct the resulting output to a third list. The target list may or may not exist. If it exists, it can be added to or replaced by taking the appropriate option on the LSTOPT parameter.
ca2e87
This command allows a user to perform set operations on two input model object lists and to optionally direct the resulting output to a third list. The target list may or may not exist. If it exists, it can be added to or replaced by taking the appropriate option on the LSTOPT parameter.
Contents
Required
YOPRMDLLST-Required
Optional
YOPRMDLLST-Optional YOPRMDLLST-Optional YOPRMDLLST-Optional YOPRMDLLST-Optional YOPRMDLLST-Optional YOPRMDLLST-Optional
Parameters
The following are parameters for the YOPRMDLLST command.
MDLLSTA
The qualified name of the model object list that is the first operand list involved in the operation. Values for these parameters are as follows:
  • list name
    -- (default) The first model object list name must be entered.
  • *ALLOBJ
    -- Special value meaning that a model object list is not used, but that all model objects are used as input to the command.
  • *MDLPRF
    -- Special value meaning that the model object list name is retrieved from the user profile extension record for the current user in the specified model library. The change list value is retrieved.
  • *USER
    -- Special value meaning that the model object list name is the same as the name of the current user.
  • *SELECT
    -- Special value meaning that the model object list is selected using an interactive display function.
  • *MDLLIB
    -- (default) Special value meaning that the first model library found in the user's current library list is used as the model library for the first list.
  • library name
    -- The model library name for the first list.
LSTOPR
The operation to be performed on the two lists (sets). See the notes that follow for more details. Values for these parameters are as follows:
  • *SUB
    -- (default) Subtract the contents of MDLLSTB from MDLLSTA.
  • *DIFF
    -- Calculate the difference between the two input lists.
  • *INTERSECT
    -- Calculate the intersection of the two input lists.
  • *UNION
    -- Calculate the union of the two input lists.
MDLLSTB
The name of the model object list that is the second operand list involved in the operation. Values for these parameters are as follows:
  • *MDLPRF
    -- (default) Special value meaning that the model object list name is retrieved from the user profile extension record for the current user in the specified model library. The change list value is retrieved.
  • *ALLOBJ
    -- Special value meaning that a model object list is not used, but that all model objects are used as input to the command.
  • *USER
    -- Special value meaning that the model object list name is the same as the name of the current user.
  • list name
    -- The second model object list name must be entered.
TOMDLLST
The qualified name of the model object list that is the target list involved in the operation. Values for these parameters are as follows:
  • *MDLLSTA
    -- (default) Single value meaning that the target list of the operation is the first input list.
  • *MDLPRF
    -- Special value meaning that the model object list name is retrieved from the user profile extension record for the current user in the specified model library. The outlist value is retrieved.
  • *USER
    -- Special value meaning that the model object list name is the same as the name of the current user.
  • list name
    -- The target model object list name.
LSTOPT
This parameter specifies the action taken if the list already exists in the target model. Values for these parameters are as follows:
  • *REPLACE
    -- (default) The existing model object list is replaced with the output from this command.
  • *ADD
    -- The existing model object list is augmented with the output from this command.
OPRTYPE
Operation method. Values for these parameters are as follows:
  • *OBJNAM
    -- (default) The list entries are compared by object name.
  • *OBJSGT
    -- The list entries are compared by object surrogate number. This method of comparison may be useful when comparing lists containing objects that have been renamed since the list was created, and the developer does not wish to refresh the list entry prior to the comparison.
IGNCRTDTE
This parameter specifies that create dates on the records are ignored when comparing list entries. This parameter is intended for use when comparing objects from different models. Values for these parameters are as follows:
  • *YES
    -- (default) Ignore create dates when comparing objects.
  • *NO
    -- Do not ignore create dates when comparing objects.
IGNCHGDTE
This parameter specifies that change dates on the records are ignored when comparing list entries. Although possible when comparing lists within a particular model, this parameter is most useful when comparing lists of the same objects between different models. Values for these parameters are as follows:
  • *YES
    -- (default) Ignore change dates when comparing objects.
  • *NO
    -- Do not ignore change dates when comparing objects.
Notes
The model library specified must be a valid model library.
  • A value other than *MDLLIB for MDLLST may result in the library list being changed. If the user is currently editing a model, the switching of the library list will not occur and the command will fail. If changed during processing, the library list is changed back after execution.
  • Both MDLLSTA and MDLLSTB must exist prior to running the command.
  • The MDLLSTA and MDLLSTB lists cannot be the same.
  • List operations are as follows:
    • This diagram illustrates the entries of the two intersecting lists:
YOPRMDLLST-Notes
The results of the list operations are:
Operand 1
LSTOPR
Operand 2
TOMDLLST
MDLLSTA
MDLLSTA
MDLLSTA
MDLLSTA
*UNION
*DIFF
*INTERSECT
*UNION
MDLLSTB
MDLLSTB
MDLLSTB
MDLLSTB
Area: X,Y and Z
  • The LSTOPT parameter is ignored if the target list does not already exist.
Examples
To output a model object list WRKLST to contain all objects from input list INLSTA that are not in input list INLSTB:
YOPRMDLLST MDLLSTA( *MDLLIB/INLSTA ) + 
LSTOPR( *SUB ) MDLLSTB( INLSTB ) TOMDLLST +
 ( WRKLST )  LSTOPT( *REPLACE )
To combine two model object lists to the first input list:
YOPRMDLLST MDLLSTA( *MDLLIB/INLSTA ) +
LSTOPR( *UNION ) MDLLSTB( INLSTB ) +
TOMDLLST ( *MDLLSTA )
To compare list entries between two models to detect whether objects have been changed in one of the models:
YCPYMDLLST FRMMDLLST(YOURMDL/WRKLST)+
TOMDLLST( MYMDL/*USER ) LSTOPT(*REPLACE)
YOPRMDLLST MDLLSTA( MYMDL/*USER ) +
LSTOPR( *DIFF ) MDLLSTB( *ALLOBJ )+
TOMDLLST( *MDLLSTA ) IGNCHGDTE( *NO )