Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Substring search for INCLUDE and OMIT z/OS DFSORT: Getting Started SC23-6880-00 |
|
Suppose you want to select only the books for the Biology, History,
Business and Psychology departments. Based on what you learned earlier,
you can select those books using this INCLUDE statement:
But the more departments you want to include, the more typing you
have to do. Instead, you can use one of the substring search capabilities
of INCLUDE and OMIT to write the statement in a simpler form as:
With substring search (SS format), you only write the field once and write the character constant so it includes all of the strings you want to search for. If the value in the field matches any of the strings (for example, "BUSIN"), the record is included. If the value in the field does not match any of the strings, the record is omitted. The length of each string must match the length of the field. Because the Department field is 5 characters, you must add a blank at the end of "BIOL" and "HIST", which are each four characters, but not for "BUSIN" and "PSYCH", which are each five characters. The other way to use substring search is by searching for a constant
within a field. For example, if you wanted to select only the books
with "INTRODUCTION" in their Title, you could use the following INCLUDE
statement:
The books selected for output would be:
|
Copyright IBM Corporation 1990, 2014
|