IBM ISERIES SC41-5210-04 User Manual

Page 99

Advertising
background image

Chapter 6. Selecting and sequencing fields in Query for
iSeries

This chapter describes how you select fields that you want to include in your query output and how you
indicate in what sequence the fields are to appear. They appear in a query report from left to right based
on the sequence number that you enter for each field. Query gives you the opportunity to select fields from
all your selected files and from all the result fields defined in your query.

Letting Query for iSeries select and sequence fields

If you did not type a 1 next to the Select and sequence fields option on the Define the Query display,
Query selects and sequences up to the first 500 fields available in your query. If the file(s) you have
selected contains only a few small fields that would all easily fit in 132 positions (the standard width of
printed output) and you do not care about the sequence of the output, letting Query select and sequence
fields for you makes good sense and may save you some time. Selecting only the fields you want in your
query may, however, improve the performance when the query is run.

The Select and Sequence Fields display is shown during query definition if you typed a 1 next to the
Select and sequence fields option on the Define the Query display. You can press F12 (Cancel) to return
you to the previous display if you have changed your mind and now want Query to select and sequence
fields for you. (Anything you typed on the display is ignored.)

Selecting fields and specifying their sequence in Query for iSeries

The Select and Sequence Fields display is shown below with some sample fields from a customer master
file shown in the Field column.

Select and Sequence Fields

Type sequence number (0-9999) for the names of up to 500 fields to

appear in the report, press Enter.

Seq

Field

Seq

Field

____ ACCTNUMBER

____ PASTDUE

____ COMPANY

____ DATELASTPD

____ FIRSTNAME

____ CURRENTDAT

____ MIDDLEINIT

____ YEAR

____ LASTNAME

____ MONTH

____ STREETADDR

____ CITY

____ STATE

____ ZIPCODE

____ TELENUMBER

____ CRLIMIT

____ BALDUE

Bottom

F3=Exit

F5=Report

F11=Display text

F12=Cancel

F13=Layout

F20=Renumber

F21=Select all

F24=More keys

You make your selections by specifying a sequence number from 0 through 9999 in front of each field you
want to select. Use the numbers in ascending sequence. The lowest numbered field is positioned on the
far left of your output (or is the first field in your database file). If you change your mind about the fields
you have selected, you can delete a field from the output by removing the number you specified in front of
it. To change the sequence of the selected fields, just change the numbers.

© Copyright IBM Corp. 2000, 2002

87

Advertising