Chapter 4. Specifying and selecting files for a Query for iSeries query
55
Handling missing fields during file selection process of a Query for iSeries query
While you were changing a query, or were defining a new query that already had file selections specified, you chose the Specify file selections option on the Define the Query display. Then, on the Specify File Selections display, you selected a file or format that does not have all of the report fields that your first selection contained. As a result, this display was shown with the missing fields.
For this situation, when you press F12 or the Enter key, you return to the Specify File Selections display without affecting your previous file (and format) selections. Once there: you can still confirm the file selections and continue by pressing the Enter key (even though Query found fields missing in the current file selections); you can specify a different file on the display and then press Enter; or you can press F12 to leave the file selections unchanged and then leave Query to go do something about the file (or format) definitions.
If you choose to press the Enter key as soon as you return to the Specify File Selections display, confirming that you want to use the current file selections, Query uses as much of the file, format, and field information as it can for the file selections now in this query. It removes all the missing fields from the query definition for some of the definition steps, such as Select and sequence fields and Select sort fields. When you select a logical file for use with Query or DB2 UDB for iSeries programs without specifying any sort fields, unpredictable results may occur. For example, you may not receive the logical view of the physical file.
After Query has done all it can, it shows the Specify How to Join Files display if the query uses multiple files and there are errors caused by missing fields; otherwise, it continues with the definition steps selected on the Define the Query display, or it returns you to the Define the Query display. On the Define the Query display, any other field-related definition steps affected by the missing fields are shown in reverse image. You must select each of these definition steps, such as Define result fields and Select records, and correct the problems caused by the missing fields. On the definition displays for the affected steps, the expressions or selection tests that use fields that are now missing are highlighted.
Handling missing fields when starting to change or display a Query for iSeries query
When you started to change or display an existing query (by specifying option 2 or 5 on the Work with Queries display), one of the following occurred:
v Query determined that one or more report fields are no longer in a file or format used by the query; the fields have been removed since the query was defined or was last changed.
v Query found a file that was unusable (for example, the query may have been migrated from another system but a file containing the fields was not) and showed the Change File Selections display. On that display, you selected a different file to correct that problem, but its record format does not have all of the fields that your first selection contained.
For these two situations, when the Fields Missing from File Definition display is shown, you can either press F12 or press the Enter key:
v If you choose to press the Enter key, you might see the Fields Missing from File Definition display again if there are additional missing fields to be displayed for this or another file. If not, Query uses as much of the file, format, and field information as it can for the file selections now in this query. It removes all the missing fields from the query definition for some of the definition steps, such as the Select and sequence fields and Select sort fields steps. When you select a logical file for use with Query or DB2 UDB for iSeries programs without specifying any sort fields, unpredictable results may occur. For example, you may not receive the logical view of the physical file.
After Query has done all it can, it shows the Define the Query display. On it, other field-related definition steps affected by the missing fields are shown in reverse image. You must select each of these definition steps, such as Specify file selections, Define result fields, and Select records, and correct the
Page 67
Image 67
IBM SC41-5210-04 manual