Skip to content

MDVRAUTOB - Repository Lookup by Library or Folder

MDVRAUTOB (MDVRAUTOB.sqlrpgle) tells MDCMS which MDiQ repositories are associated with a library or IFS folder.

MDCMS calls it with a path and type. The path identifies an IBM i library or IFS folder, and the type identifies whether the lookup is for an object library or a source location. MDVRAUTOB joins MDVDREPL to MDVDREPD, keeps the rows that match the path and type, and returns the repository names that are eligible for automatic build.

MDCMS then uses those repository names when calling MDVREFOBJ for the objects or source members being promoted.

MDVRAUTOB only resolves repository names; it does not update repository content.


Parameters

MDCMS calls MDVRAUTOB with two parameters.

Parameter Description
PATH Library or folder, in Unix format.
TYPE S or O, matching the type stored in MDVDREPL.

PATH

PATH identifies the library or folder being looked up.

Location PATH format Example
IBM i library /QSYS.LIB/ + library name + .LIB /QSYS.LIB/MDRTST14.LIB
IFS folder IFS directory path /home/stuart/mysrc/programs

TYPE

TYPE determines which MDVDREPL entries are considered.

TYPE MDVDREPL entries
O Object libraries
S Source libraries and IFS source folders

If a library is defined as both an object library and a source library, MDCMS performs two separate lookups: one with TYPE = O and one with TYPE = S.


Return Value

MDVRAUTOB returns an array of repository names from the join of MDVDREPL and MDVDREPD where the MDVDREPL entry matches the supplied PATH and TYPE, and the repository is eligible for automatic build.

A path can belong to multiple repositories, so the array can contain multiple repository names.

If no matching eligible repository exists, the array is empty and MDCMS does not call MDVREFOBJ for that location.

Automatic build filter

MDVDREPL stores the library or folder. MDVDREPD stores the repository definition, including AUTOBLD.

The lookup excludes a repository when MDVDREPD.AUTOBLD = N. The default value of AUTOBLD is blank or Y, and both of those values are included.

MDVDREPD.AUTOBLD Returned
blank Yes (default)
Y Yes (default)
N No

A repository is returned when its MDVDREPL path and type match and the joined MDVDREPD.AUTOBLD value is blank or Y.


How MDCMS Uses the Result

The lookup and repository update happen at different levels:

  1. MDVRAUTOB is called once for each unique path/type combination.
  2. It returns the repositories associated with that location.
  3. MDVREFOBJ is then called for each promoted object or source member, using the applicable repository name.

Therefore, MDVRAUTOB avoids repeatedly searching MDVDREPL/MDVDREPD for every individual object while MDVREFOBJ still processes each object or source member separately.


Example

An RFP promotes 1,500 objects into five object libraries:

PATH TYPE
/QSYS.LIB/LIBA.LIB O
/QSYS.LIB/LIBB.LIB O
/QSYS.LIB/LIBC.LIB O
/QSYS.LIB/LIBD.LIB O
/QSYS.LIB/LIBE.LIB O

Source for some of those objects is promoted from an IFS folder:

PATH TYPE
/home/stuart/mysrc/programs S

This results in six MDVRAUTOB lookups—one for each unique path/type combination.

Each lookup returns the repositories associated with that location. MDCMS then uses those results when calling MDVREFOBJ for the 1,500 objects and the applicable source members.