Using TMSGRW, how can I compare for the high level qualifier of a DSN?

Document ID : KB000027995
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:

How can I compare the DSN for a specific high level qualifier, or other character field for just the first couple of characters?

Environment:

CA 1 12.6 and 14.0

Answer:

Define the high level qualifier as a character field in the CONTROL-SECTION.
Example: DEFINE MYDSN CH 'SYS1'
In the PROCESS-SECTION of your code use the WHEN statement with your field as the first operand. The first operand determines the length of the compare.
Example: WHEN MYDSN EQ DSN
LIST