In this section: |
The display commands LIST and PRINT list the individual values of the fields you specify in your report request. LIST numbers the items in the report. PRINT does not number the items.
You can easily display all of the fields in the data source by specifying an asterisk (*) wildcard instead of a specific field name, as described in Displaying All Fields.
For all PRINT and LIST requests, the number of records retrieved and the number of lines displayed are the same. In addition, there is no order to the report rows. The PRINT and LIST commands display all the values of the selected fields found in the data source in the order in which they are accessed. The order in which data is displayed may be affected by the AUTOPATH setting. For more information, see Optimizing Retrieval Speed for FOCUS Data Sources, and the documentation on SET parameters in the Developing Applications manual.
In general, when using PRINT or LIST, the order of the values displayed in the report depends on whether or not the field is a key field, as described in the Describing Data manual.
Alternatively, you can sort the values using the BY or ACROSS sort phrases. When LIST is used in a request that includes a sort phrase, the list counter is reset to 1 every time the value in the outermost sort field changes. For more information on sorting, see Sorting Tabular Reports.
PRINT * or PRINT SEG.* prints only the real fields in the Master File. To print virtual fields, explicitly reference them in the PRINT statement (PRINT * virtual field name). This is true even if the virtual field name is a re-defines of a real field.
For PRINT and LIST syntax, see How to Use Display Commands in a Request.
To display the values of individual fields, use the PRINT command. The following request displays the values of two fields, LAST_NAME and FIRST_NAME, for all employees.
TABLE FILE EMPLOYEE PRINT LAST_NAME AND FIRST_NAME END
The following shows the report output.
LAST_NAME --------- | FIRST_NAME ---------- |
STEVENS SMITH JONES SMITH BANNING IRVING ROMANS MCCOY BLACKWOOD MCKNIGHT GREENSPAN CROSS | ALFRED MARY DIANE RICHARD JOHN JOAN ANTHONY JOHN ROSEMARIE ROGER MARY BARBARA |
To number the records in a report, use the LIST command.
TABLE FILE EMPLOYEE LIST LAST_NAME AND FIRST_NAME END
The following shows the report output.
LIST ---- 1 2 3 4 5 6 7 8 9 10 11 12 | LAST_NAME --------- STEVENS SMITH JONES SMITH BANNING IRVING ROMANS MCCOY BLACKWOOD MCKNIGHT GREENSPAN CROSS | FIRST_NAME ---------- ALFRED MARY DIANE RICHARD JOHN JOAN ANTHONY JOHN ROSEMARIE ROGER MARY BARBARA |
You can easily display all of the fields in the left path of the data source by specifying an asterisk (*) wildcard instead of a specific field name. For additional information about Master File structures and segment paths, including left paths and short paths, see the Describing Data manual.
The following request produces a report displaying all of the fields in the EDUCFILE data source.
TABLE FILE EDUCFILE LIST * END
The following shows the report output.
LIST COURSE_CODE COURSE_NAME DATE_ATTEND EMP_ID ---- ----------- ----------- ----------- ------ 1 101 FILE DESCRPT & MAINT 83/01/04 212289111 2 101 FILE DESCRPT & MAINT 82/05/25 117593129 3 101 FILE DESCRPT & MAINT 82/05/25 071382660 4 101 FILE DESCRPT & MAINT 81/11/15 451123478 5 101 FILE DESCRPT & MAINT 81/11/15 112847612 6 102 BASIC REPORT PREP NON-PROG 82/07/12 326179357 7 103 BASIC REPORT PREP FOR PROG 83/01/05 212289111 8 103 BASIC REPORT PREP FOR PROG 82/05/26 117593129 9 103 BASIC REPORT PREP FOR PROG 81/11/16 112847612 10 104 FILE DESC & MAINT NON-PROG 82/07/14 326179357 11 106 TIMESHARING WORKSHOP 82/07/15 326179357 12 202 WHAT'S NEW IN FOCUS 82/10/28 326179357 13 301 DECISION SUPPORT WORKSHOP 82/09/03 326179357 14 107 BASIC REPORT PREP DP MGRS 82/08/02 818692173 15 302 HOST LANGUAGE INTERFACE 82/10/21 818692173 16 108 BASIC RPT NON-DP MGRS 82/10/10 315548712 17 108 BASIC RPT NON-DP MGRS 82/08/24 119265415 18 201 ADVANCED TECHNIQUES 82/07/26 117593129 19 203 FOCUS INTERNALS 82/10/28 117593129
How to: |
You can easily display all fields in a segment by adding the prefix "SEG." to any field in the desired segment.
seg.anyfield
where:
The following request produces a report displaying all of the fields in the segment that contains the QTY_IN_STOCK field.
TABLE FILE CENTINV PRINT SEG.QTY_IN_STOCK BY PRODNAME NOPRINT END
The following shows the report output.
Product Product Quantity Our Number: Name: In Stock: Price: Cost: ------- ------- --------- ------ ----- 1028 AR2 35MM Camera 8 X 11499 109.00 79.00 1026 AR3 35MM Camera 10 X 12444 129.00 95.00 1006 Combo Player - 4 Hd VCR + DVD 13527 399.00 289.00 1008 DVD Upgrade Unit for Cent. VCR 199 199.00 139.00 1030 QX Portable CD Player 22000 169.00 99.00 1032 R5 Micro Digital Tape Recorder 1990 89.00 69.00 1036 ZC Digital PDA - Standard 33000 299.00 249.00 1034 ZT Digital PDA - Commercial 21000 499.00 349.00 1024 110 VHS-C Camcorder 20 X 4000 349.00 249.00 1022 120 VHS-C Camcorder 40 X 2300 399.00 259.00 1020 150 8MM Camcorder 20 X 5961 319.00 240.00 1004 2 Hd VCR LCD Menu 43068 179.00 129.00 1018 250 8MM Camcorder 40 X 60073 399.00 320.00 1016 330DX Digital Camera 1024K P 12707 279.00 199.00 1014 340SX Digital Camera 65K P 990 249.00 199.00 1012 650DL Digital Camcorder 150 X 2972 899.00 710.00 1010 750SL Digital Camcorder 300 X 10758 999.00 750.00
When using display commands, it is important to understand the structure of the data source and the relationship between segments, since these factors affect your results. You can use the CHECK command PICTURE option to display a diagram of the data source structure defined by the Master File.
You can also display the retrieval order of a data source using the CHECK command PICTURE RETRIEVE option. It should be noted that retrieval is controlled by the minimum referenced subtree. For more information, see Understanding the Efficiency of the Minimum Referenced Subtree in the Describing a Group of Fields chapter in the Describing Data manual.
To display the retrieval order of the EMPLOYEE data source, which is joined to the JOBFILE and EDUCFILE data sources, issue the following command:
CHECK FILE EMPLOYEE PICTURE RETRIEVE
The following shows the command output that adds the numbers that display at the top left of each segment, indicating the retrieval order of the segments. A unique segment such as FUNDTRAN is treated as a logical addition to the parent segment for retrieval. FUNDTRAN and SECSEG are unique segments, and are therefore treated as part of their parents.
The following shows the retrieval order:
The following request produces a report displaying all of the fields on the left path of the EMPLOYEE data source.
TABLE FILE EMPLOYEE PRINT * END
The following shows a list of the output fields the previous request produces. Due to the size of the report, only the fields for which all instances will be printed are listed here. In the report, these fields would be displayed from left to right, starting with EMP_ID.
EMP_ID LAST_NAME FIRST_NAME HIRE_DATE DEPARTMENT CURR_SAL CURR_JOBCODE ED_HRS BANK_NAME BANK_CODE BANK_ACCT EFFECT_DATE DAT_INC PCT_INC SALARY JOBCODE JOBCODE JOB_DESC SEC_CLEAR SKILLS SKILL_DESC
Each field in this list appears in segments on the left path of the EMPLOYEE data source. To view the retrieval order structure of the EMPLOYEE data source, see Displaying the Retrieval Order of a Multi-Path Data Source.
Tip: In some environments, the following warning is displayed whenever you use PRINT * with a multi-path data source, to remind you that PRINT * only displays the left path:
(FOC757) WARNING. YOU REQUESTED PRINT * OR COUNT * FOR A MULTI-PATH FILE
Information Builders |