Previous | Contents | Index |
INCLUDE FOUND structure_name |
INCLUDE FOUND invoice |
INCLUDE FOUND tells GQL that you want to work ONLY with records where the relationship between two structures exists.
For example: If CUSTOMER is related to INVOICE and only CUSTOMER records with INVOICE records are to be included, "INCLUDE FOUND INVOICE" must be used or the CUSTOMER records without INVOICE records will also be included.
INCLUDE PARTIAL cond_expr |
INCLUDE PARTIAL customer(zipcode) = "920" INCLUDE PARTIAL customer(zipcode) = zip_920$ INCLUDE PARTIAL customer(zipcode) = control(zip_920) |
INCLUDE PARTIAL works like INCLUDE in that it tells GQL which records to include on the report. However, INCLUDE PARTIAL allows you to specify part of a field's contents.
When GQL reads the INCLUDE command, it evaluates the expression cond_expr. If the expression is TRUE, GQL will include the current record on the report.
When more than one INCLUDE expression is given, ALL expressions must be TRUE in order for the data to be included.
INCLUDE PARTIAL can be used as follows:
INCLUDE PARTIAL str_fld = "quoted_literal" INCLUDE PARTIAL str_fld = user_entered_variable$ INCLUDE PARTIAL str_fld = str_fld |
Example 6-13 Example of INCLUDE PARTIAL Command |
---|
OPEN VENDOR INCLUDE PARTIAL NAME = "BAR" SORT BY NAME PRINT NAME GO |
Example 6-14 Example of INCLUDE Command - Output |
---|
22-Jan-1999 Report on VENDOR Page 1 Full name ------------------------------ BARAJAS, ESTHERTE A. BARAJAS, MARLENE BARAJAS, MARTIN BARAJAS, RAMIRO BARAJAS, RUBY BARNES, MARC T. BARNETT, ERIN BARNHART, AMY E. BARRACK, JORDANA L. BARRACLOUGH, CHRISTY BARRICK, MELISSA S. BARRY, DAVID BARRY, JARROD C. BARRY, JOSEPH M. BARRYMORE, SAMANTHA M. |
[LINE] INPUT ['Prompt_text'] [, PROMPT str_expr] [, AT row, col] [, LENGTH num_expr] [, DEFAULT str_expr] [, VALID str_expr] [, TIMEOUT time_limit] : var |
INPUT 'Enter the account to print' : acct$ INPUT at 3, 10, valid 'number', prompt 'Account number: ' : acct$ |
INPUT allows data to be entered by a user.
The INPUT command allows the developer of the report to prompt the user for information necessary to process the report.
Any valid INTOUCH INPUT commands can be used. When the report is executed, the user will be prompted for data for all the INPUT commands. The data is available for use in the INCLUDE, EXCLUDE and PRINT commands.
In addition, a user-written validation routine can be specified. Please refer to SET INPUT ROUTINE for further information about validation routines.
The INPUT commands are processed in the order that they are entered to GQL. The user is given BACK and EXIT capabilities from all INPUT commands. The developer can enter a message to be displayed during each INPUT command to assist the user in entering the data. The SET INPUT MESSAGE command is used to enter input messages.
If the SET PROCEED option is set to TRUE, the user will be asked a "Proceed (Y/N)" question before the report is produced.
If the SET REPROMPT option is set to TRUE, the user will be reprompted for all inputs when finished printing the report.
For additional information on INPUT, please refer to the chapter, "Inputting Data," in the INTOUCH, A Guide to the Language manual.
Example 6-15 Example of INPUT Command |
---|
OPEN DETAIL INPUT 'Enter the product to be included' : PRODUCT$ INCLUDE PRODNBR = PRODUCT$ PRINT PRODNBR, LINEID, QTY, PRICE, EXTPRICE GO |
Example 6-16 Example of INPUT Command - Output Prompts |
---|
Report on DETAIL Enter the product to be included? 22600 Proceed (Y/N): Y___ |
Example 6-17 Example of INPUT Command - Output Report |
---|
22-Jan-1999 Report on DETAIL Page 1 Line Prod Item Order Selling Extended Nbr ID# Qty Price Price ----- --------- ------ ---------- ---------- 22600 10314-002 1 325.00 325.00 22600 10323-005 1 325.00 325.00 22600 10327-002 1 325.00 325.00 22600 10328-002 1 325.00 325.00 22600 10328-003 4 325.00 1,300.00 22600 10329-003 2 325.00 650.00 22600 10342-002 1 325.00 325.00 22600 10345-005 1 325.00 325.00 22600 10345-007 3 325.00 975.00 22600 10348-003 3 325.00 975.00 22600 10362-003 1 325.00 325.00 22600 10363-006 2 325.00 650.00 22600 10368-002 2 325.00 650.00 22600 10379-005 2 325.00 650.00 22600 10393-005 1 325.00 325.00 22600 10400-003 1 325.00 325.00 |
LET variable_name = expression |
LET extamt = qty * price PRINT extamt heading 'Extended,Amount' MASK '$##,###.##' |
The LET command allows you to assign a value to a user variable. LET sets up a variable, defined by the given expression. The variable can then be used in PRINT commands and in other expressions.
Variable names must start with a letter.
Example 6-18 Example of LET Command |
---|
OPEN DETAIL SORT BY LINEID PRINT LINEID, QTY, PRICE LET EXTAMT = QTY * PRICE PRINT EXTAMT HEADING 'Extended,Amount' MASK '$##,###.##' GO |
Example 6-19 Example of LET Command - Output |
---|
22-Jan-1999 Report on DETAIL Page 1 Line Item Order Selling Extended ID# Qty Price Amount --------- ------ ---------- ---------- 10301-001 1 2,495.00 $2,495.00 10301-002 2 375.00 $750.00 10301-003 1 299.00 $299.00 10301-004 1 375.00 $375.00 10301-005 1 595.00 $595.00 10301-006 2 375.00 $750.00 10301-007 2 1,495.00 $2,990.00 10301-008 8 2,495.00 $19,960.00 10301-009 2 249.00 $498.00 10302-001 3 149.00 $447.00 10303-001 1 1,495.00 $1,495.00 10303-002 3 299.00 $897.00 10303-003 2 795.00 $1,590.00 10304-001 1 2,095.00 $2,095.00 10304-002 2 1,495.00 $2,990.00 |
MAKE a REPORT MAKE an EXPORT file [with HEADINGS] MAKE an EXPORT STRUCTURE MAKE an EXPORT WORDPERFECT file |
MAKE an EXPORT file with HEADINGS SET OUTPUT oct_sales |
Use MAKE to control the type of output GQL produces.
This is the GQL default which creates a standard report that can be printed to the terminal, a printer port, or to one of the system printers. If you are creating a report, you do NOT need to use the MAKE command.
This command makes a comma-delimited, ASCII text, output file that is suitable for importing into spreadsheets or databases. All print expressions that produce string data are printed within quotes.
If you are making any kind of EXPORT file, you must use the SET OUTPUT command to specify the output file's name. Otherwise, a default name consisting of: structure_name.EXPORT + unique identifiers will be created in SYS$SCRATCH. |
MAKE an EXPORT file with HEADINGS
This command allows you to have the first line of the exported file be a line of "heading" information. Only one "heading" line is created. The headings will be taken from the input file's definition file. You can override the headings by specifying an alternate heading for the PRINT command. For example:
PRINT CHART(ACCOUNT_NBR) HEADING "Account" |
This command creates an INTOUCH structure. The data file for this structure is a standard RMS sequential file. Each field that is "printed" is placed into the data record.
An export structure is named with "_GQLEXP" appended to the output name. A structure consists of the following file types:
.STR --- a file that contains the definition and data file names
.DEF --- the structure definition file; contains field definitions
.DAT --- the data file
.FDL --- the OpenVMS File Definition Language file used to create the data file
All fields that are "printed" are added to the exported structure as fields. The default field name is "COL" plus a sequential number. For example, the first field "printed" is "COL001".
GQL creates the definition for each field with the attributes known at the time GQL is run. Column headings and print masks are used in the definition file. Field scale is determined from the print mask.
MAKE an EXPORT WORDPERFECT file
Makes a WordPerfect mail merge file.
Previous | Next | Contents | Index |