跌打滚爬中的小菜鸟...
分类: 其他UNIX
2013-01-17 10:43:17
使用STRQRY或者WRKQRY可以进入的Query操作界面, 这里手把手示例创建一个Query
这个是定义Query的菜单
Define the Query
Query . . . . . . : QRY01 Option . . . . . : CREATE
Library . . . . : C745335 CCSID . . . . . . : 65535(注:这里可以看到是Create一个C745335/QRY01的query)
Type options, press Enter. Press F21 to select all.
1=Select
Opt Query Definition Option
1 Specify file selections
Define result fields
Select and sequence fields
Select records
Select sort fields
Select collating sequence(注:前6项是定义Query本身,包括要使用的files, fields,以及相当于where条件的select records)
Specify report column formatting
Select report summary functions
Define report breaks(注:这3项定义report的外观,including which columns are to be summarized and using report breaks)
Select output type and output form(注:定义report的输出格式)
Specify processing options(注:定义数字型field的计算处理,以及字符型field在conversion时的一些要点)
F3=Exit F5=Report F12=Cancel
F13=Layout F18=Files F21=Select all
关于这些Option, 更详细的说明如下:
建议在定义query时, 按照指定的顺序来填写这些option, 除了第一个option是必须的之外, 其余option都是可选的.
Specify file selections
This option is required, and you use it to specify the file or files from which you want your query to
obtain information. If you specify more than one file, you are shown the displays on which you
specify how you want the files joined. 指定query使用的file, 如果多于一个file则需要指定Type of Join.
Define result fields
Use this option to define fields that do not exist in your files but you want to use in your query. For
example, your selected file(s) contains a field representing the number of weeks, but it does not
contain a field representing the number of days, and you want your report to show days, not
weeks. You can define a result field that will hold the results of a calculation that uses the number
of weeks to determine the number of days. 定义新的字段,可以是现有字段的计算结果
Select and sequence fields
Use this option to select the fields (from your selected file(s) and your result fields) that you want
to appear on your report. You also specify in what order you want them to appear. 选择要输出的字段(可以是自己新定义的字段,也可以是file现有的字段),并排序.
Select records
Use this option to select records, from your selected file or files, if you only want particular records
to be included in your report. 相当于where语句, 对结果进行进一步筛选.
Select sort fields
Use this option to specify what fields to sort on so that your output records appear in a particular
order (such as alphabetically or in descending or ascending order). 指定某些字段的排序方式,A升序,D降序.
Select collating sequence
Use this option to select a collating sequence for your query. The collating sequence you select
can affect many different things in your query, including record selection and the order of records
when they are sorted. The collating sequence usually relates to your country’s language. You can
also specify a different language for a particular query. You can set your collating sequence
defaults while defining your first query and thereby never have to change the collating sequence
again.
Specify report column formatting
Use this option to change the column headings, column spacing, numeric editing, length, and
decimal positions for fields that appear in your report.
Select report summary functions
Use this option to specify one or more (or all) of the types of summary functions for each field in
your report: total, average, minimum value, maximum value, and count.
Define report breaks
Use this option to specify how to break your report into groups of records.
Select output type and output form
Use this option to specify if you want your output to be displayed, printed, or sent to a database
file. If you want your output printed, you also specify printer attributes. You also use this option to
specify whether you want detailed or summary-only output.
Specify processing options
Use this option to specify if you want the results of your query calculations to be truncated or
rounded, if you want decimal data errors ignored, or if you want to ignore character substitution
warnings during conversion.
You can specify one, several, or all of the options shown. To select all of them, press F21.
强烈建议记住以下建议!!!!!!