Substring function


The character substring function is provided to allow you to extract portions of a character string. It uses the form:

(character-descriptor,length,starting-position)

where:

character-descriptor

Represents a character DD or Job Descriptor.

length

Is the number of characters to be used.

starting-position

Is the starting position of the character string within the Descriptor. If this operand is omitted, the default value is 1.

Note that substring functions can only be used in the definition section of DAL or JAL, however. Restricting substring functions to the definition section has the benefit of eliminating complex character string constructions in the logic section.

Let's look at our example. We want to extract the third, fourth, and fifth characters of the RACF userid. We therefore "request" JAL to extract 3 characters from the RACF userid, starting at position 3 by coding:

($RACFU,3,3)

If the RACF userid field was 'MMPAY90', the resulting string would be 'PAY'. In our example, we now want to use this extracted string to match against the first three characters of the jobname. Two questions immediately arise:

  1. Where do I code the substring function?
  2. How do I see to the extracted string?

The answer to both of these questions becomes clear when we examine the definition statement PATTERNDEF, described in the next section.




 

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