Was this helpful?
accept explist;
The accept statement is the "output statement" that causes a row (or record) containing the values of the expression list to be written to a data file by the Map Designer.
Syntax
accept ("recordname") <"fieldname" > <length> expr, < "fieldname" > <length> expr;
The values returned can be a list of variable names, or complex expressions. The string constant fieldname between angle brackets is optional and provides the Map Designer column header for the values of the variable it precedes. If the fieldname is not provided, a default field name is provided, e.g., Field1, Field2, etc…
The string variable recordname is optional and provides the name of the record type for multiple record type scripts. If there is only one record type (one accept statement) in the script, the recordname can be omitted. If there is more than one record type in the script, the recordname must be included for each accept statement.
The integer length between angle brackets is also optional and provides a default display width for the fields in the associated column. Although it is optional, if length is specified for one field, it must be specified for all fields in the accept statement. Specifying a length only sets the initial length of the field. It can still grow if longer data is encountered.
The special case accept $* causes all the fields of the input line as determined by the IFS variable to be written as a single record to the Map Designer.
Example 1
# this accept statement will output address, city, state and zip code with column
# headings to the Address record type
accept ("Address") <"Street"> addr, <"City"> city, <"State"> st, <"Zipcode">zip;
Example 2
# this accept statement will output name and address with default display lengths of
# 30 and 50. The column headings will be defaulted and there is only one record type.
accept <30> name, <50>address;
Example 3
# this accept statement writes all of the fields of the current input line to the Map Designer.
accept $*;
The column labels and default display field lengths are optional for each field. The field can have a column label and not a default display length, or have a default display length and not a column label, or both, or neither.
Last modified date: 12/03/2024