Selecting members by name


File-AID can select a member for processing based on its name using either the MBRNAME, MEMBER, MEMBERS or MBRMASK parameters.

File-AID can exclude a member from processing based on its name using either the MBRNAMX or MEMBERX parameters.

The MEMBER parameter selects a specific member within a PDS for processing when coded as follows:

MEMBER=name

The value for name can be up to eight characters. You can specify more than one member per control card by separating each member name with a comma and enclosing the names in parentheses. If you specify only one member name, it is recommended that you do not enclose it in parentheses. Examples 1 and 2 show coding for single- and multiple-member selection.

Example 1
$$DD01 COPY MEMBER=MEM1

This example copies only member MEM1 to the output file labeled DD01O.

Example 2
$$DD01 COPY MEMBER=(MEM1,MEM2,MEM3)

This example copies members MEM1MEM2, and MEM3 to the output file labeled DD01O.

The MEMBERS parameter can be used to select groups of members from a PDS. A mask field is used to search the PDS directory for any member names that contain the characters in the mask. The mask field can contain up to eight characters. Any insignificant character in the string is ignored by coding a hyphen ( - ) in the appropriate location. The MEMBERS parameter is coded:

MEMBERS=mask-field

The following examples show the use of the MEMBERS parameter for member selection.

Example 3
$$DD01 LIST MEMBERS=ZA

This example lists any member in the input PDS with a name that begins with the characters ZA.

Example 4
$$DD01 PRINT MEMBERS=TEST---P

This example prints any member in the input PDS with a name that begins with the characters TEST and contains a letter in location 8. All other characters in the name are ignored.

Use the MEMBERX parameter to exclude groups of members from a PDS.

The following examples show the use of the MEMBERX parameter for member exclusion.

Example 5
$$DD01 LIST MEMBERX=ZA

This example lists any members in the input PDS excluding a name that begin with the characters ZA.

Example 6
$$DD01 PRINT MEMBERX=TEST---P

This example prints any member in the input PDS excluding a name that begins with the characters TEST and contains a letter in location 8. All other characters in the name are ignored.

The following example shows the use of the MBRNAME parameter for selecting a group of members based on a name range. (For more information, see MBRNAME-MBR.)

Example 7
$$DD01 LIST MBRNAME=(ABC,DEF)

This example lists any member in the input PDS with a member name that begins with the characters ABC through DEF.

The following example shows the use of the MBRNAMX parameter for excluding a group of members based on a name range. (See MBRNAMX-MNX.)

Example 8
$$DD01 LIST MBRNAMX=(ABC,DEF)

This example lists any member in the input PDS excluding a member name that begins with the characters ABC through DEF.

You can use the MBRMASK parameter to select groups of members from a PDS. A mask field is used to search the PDS directory for any member names that contain the characters in the mask. The mask field can contain up to eight characters. 

The following examples show the use of the MBRMASK parameter for member selection.

Example 9
$$DD01 LIST MBRMASK=*GE*

This example processes all member names that contain GE in any 2 consecutive positions.


Example 10
$$DD01 LIST MBRMASK=A*B*C

This example processes all member names that contain A in position 1, C in the last position, and B anywhere in between.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*