The DSN= parameter is probably the most frequently used of all parameters, and the one where the greatest degree of flexibility is usually required. CA Disk allows either full data set names or data set name patterns to be entered in the DSN= parameter or in any CA Disk table that contains a data set name field. A pattern name consists of the usual alphanumeric and national characters allowed in a data set name, but also the following:
|
Character |
Hex Value |
|---|---|
|
An asterisk (*) |
x'5C' |
|
A question mark (?) |
x'6F' |
|
A slash (/) |
x'61' |
|
An exclamation point (!) |
x'5A' |
The asterisk (*) can be used to represent any variable index level or simple name. It must be the last character in the code.
|
Example |
Result |
|---|---|
|
DSN=* |
Selects all single-level data set names. |
|
DSN=*.* |
Selects all two-level data set names. |
|
DSN=A.*.SOURCE |
Selects all three-level names that have A as their first index and SOURCE as the simple name, but any second-level index. |
|
DSN=A*.SOURCE |
Selects all data sets having data sets having a first-level index beginning with the letter A followed by any other characters, and a second-level index equal to the value SOURCE. |
The question mark (?) can be used to represent any variable character within an index level or simple name. Multiple occurrences can be used within each level or simple name.
|
Example |
Result |
|---|---|
|
DSN=? |
Selects all single-character data set names. |
|
DSN=A.TEST?? |
Selects all two-level data set names with a first-level index of A and a simple name six characters in length, the first four of which must be TEST; for example, TEST01, TEST02, TEST99, TEST1A, TESTXX, and so on. |
The slash (/) can be used to represent any variable character from that position to the end of the name. The portion of the name that precedes the slash is referred to as a PREFIX name. Examples of the Slash (/) Pattern in DSN= are listed in the following table.
|
Example |
Result |
|---|---|
|
DSN=A/ |
Selects all data sets that begin with the letter A. |
|
DSN=A.TEST/ |
Selects all data sets that begin with the character string A.TEST, with any following characters. |
|
DSN=A.*.C?./ |
Selects all data sets that begin with an index of A, followed by any second-level index, a two-character third-level index starting with C, and any following string. |
The exclamation point (!) can be used to represent any variable character up to the character string following the exclamation point; for example, the exclamation point defines the beginning of a character string (terminated by the next pattern character or the end of the data) that can be found anywhere within the name. The exclamation point (!) within an index level indicates that zero or more characters can occupy that position.
|
Example |
Result |
|---|---|
|
DSN=!TEST |
TEST selects all data sets that contain TEST somewhere in the name. |
|
DSN=A?.!DEPT21 |
Selects all data sets that have a two-character first-level index that starts with an A and contain DEPT21 somewhere in the remainder of the name. |
|
DSN=!TEST!LOAD |
Selects all data sets that contain TEST somewhere in the name and LOAD somewhere following TEST. |
|
DSN=TEST.L!AD |
Selects all data sets that start with TEST.L and have AD somewhere following. |
The exclamation point (!) character can also be used to find a pattern occurring only at the end of a string. This can be accomplished by placing an exclamation point at the end of the desired pattern as well as at the beginning, as in the following example:
|
Example |
Result |
|---|---|
|
DSN=!TEST!.LOAD! |
Selects all data sets that contain TEST somewhere in the name and which terminates with .LOAD. Therefore, the data set name LABS.TJP.TEST.LOAD would match the pattern, but LABS.TEST.LOADOLD would not. |
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|