Using file IDs for a Query for iSeries query
File IDs are used when you select more than one file. Although Query assigns a file ID value to each file
selection, you can specify your own identifier.
Note: When you are creating a query, the File ID prompt is not shown for your first file selection.
However, if you select more than one file, you will see that Query has assigned the value T01 as
the file ID of your first file. You will have to go back and change the file ID if you want to assign
your own file ID values.
The file ID allows you to uniquely identify fields that have the same name but are in different files. You can
specify from one to three characters; the first character must be alphabetic, $, #, or @, and the last two
can be alphabetic, numeric, or $, #, or @. Examples of valid identifiers are: A, B, B03, AEX, and $99.
Note: If you are creating queries that are distributed to other systems or are used in a multilingual
environment, use only A-Z and 1-9.
If you do not specify a file ID (that is, you do not change the value *ID in the File ID prompt), Query
resolves the value *ID to the number of the file selection, if not already used, or to the lowest possible
value that is available in the range of Tnn, where nn is a number from 1 to 32.
Although file IDs are assigned to each file on the Specify File Selections display, you do not have to use
them in other parts of the query definition unless you need to use a field that has the same name in more
than one of the files in the query. You must use file IDs every time for identical field names, to ensure that
the correct field is used from the files. For all the other field names, (that is, those that occur in only one
file in the query definition), you do not need to use the file IDs.
If you decide to change a file ID, Query keeps any definition values already assigned for field selection,
sort field selection, and so on. (You must change the ID, if used, for join tests, result field expressions,
record selection values, and break text.) However, if you move a file ID to a different selection group, all
the definition values you specified are lost, even if all of the names in the from and to file selections are
the same.
Confirming your options for a Query for iSeries query
When you are creating a query definition, you see a message that asks you to verify the values you just
defined. This message appears when you press the Enter key after defining file selection values. You
should verify your choices made thus far, then either continue selecting files or end the file selection
process after confirming your choices. To end file selection, press the Enter key again.
When you are changing an existing query definition, you see a different message when you press the
Enter key, and the values that you changed are shown in reverse image. Again, you should verify your
changes and then press the Enter key a second time to actually have them changed in the definition. You
do not have to press the Enter key twice if you make no changes or if you change only member names.
Removing a option for a Query for iSeries query
Whether you are creating or changing a definition, if you decide you do not want to keep one of the files in
the definition, you can remove it by blanking out the File prompt. When you press the Enter key or F5,
F10, or F13, that file selection is removed.
By removing a file selection, you may cause an error elsewhere in your definition. This occurs if the file
you removed was used in a join test or a field from a removed file was used to define a result field.
Handling errors on the Query for iSeries Specify File Selections
display
An error message is shown when you press the Enter key, F5, F10, or F13.
v If you did not type a file name
36 Query for iSeries Use V5R2