SELECT section

The SELECT section is an optional section that is used to specify the criteria that is used for RUNMODE(EXTRACT).

This section can contain record selection conditions used to define the subset of records that are to be extracted.

Record selection conditions must use the following syntax:
SELECT:
	 WHERE condition1 [WHERE condition2] ... [WHERE conditionN]
Each condition must be a syntactically valid SQL WHERE clause using only those fields defined for the target object type. If multiple conditions are used, then two adjacent clauses must be separated by a space character or by a newline.
Note: The order of conditions in the record selection defines the order for results in the output file (DD:BJTDATA). The extract of condition1 will go first, extract of condition2 will go second, and so on. Sample of SELECT section:
WHERE NAME LIKE 'John%'
WHERE DEPARTMENT LIKE 'QA%'
WHERE DEPARTMENT LIKE 'IT%'

If you want to select all the objects of the specified OBJTTYPE, then you can do one of following:
  1. Omit the SELECT section entirely
  2. Specify an empty SELECT section
Sample of SELECT section:
	SELECT:
		WHERE NAME LIKE 'MY%' OR
		      NAME LIKE 'YOUR%'
When using UBU-native syntax (see the SYSIN_SELECT_SYNTAX section of OPTIONS section for syntax descriptions), and cross-table key fields are represented in the selection criteria, you must reference the named value from the link table as it is present in the flat file. For example, to extract all selector rules that are referred to archive attribute with NAME='ArchAttr55' and ROWID=55. Then SELECT section must be:
SELECT:
		WHERE ATTRIBUTE_ID = 'ArchAttr55'
However, if SQL-native syntax is specified, the SELECT section for the same example must be:
SELECT:
		WHERE ATTRIBUTE_ID = 55

When you specify sub-criteria for the TARGET_ID field of the SELECT section while extracting DISTRIBUTION_LIST object types, UBU extracts occurrences of Recipient Entries (ROWTYPE='R' record) where this sub-criteria is met. This allows you to extract all appearances of the specified recipient from distribution lists.

In the following example, UBU will extract appearances of the recipient with the name “John Johnson” in Distribution Lists starting with “DL”:
WHERE SUBSTR(DNAME,1,2)=‘DL' AND 
				TARGET_ID='John Johnson'
Note: To omit the SELECT section, use dashes (--) to comment it out. The following is an example of the SELECT section for modification:
-- SELECT: 
-- WHERE NAME LIKE ‘MY%' OR
--		 NAME LIKE ‘YOUR%'