DEFINE FIELD command

Used to define physical data fields in ACL table layouts.

Syntax

DEFINE FIELD field_name data_type start_position length
<NDATE> <decimals|date_format> <AS alternate_column_title> <WIDTH value>
<PIC format>

Parameters

field_name

Specifies the name of the field. It can contain up to 31 upper and lowercase alphanumeric characters, including the underscore character (_). To create a two-word name, insert an underscore between the words.

data_type

Specifies how you want ACL to interpret the data. For example, a field of transaction numbers might be stored as numeric values in the data source. If you do not want to perform calculations on these numbers because they represent invoice numbers, you can define the field as character data instead.

start_position

Specifies the byte position the field starts at.

length

Specifies the length of the field in bytes.

NDATE

Optional. Specify this keyword if the field needs to read date values from PACKED data.

decimals

Optional. Only applies to Numeric fields. Specifies the number of decimal places.

date_format

Optional. Only applies to Date fields. Specifies the date format found in the source data. If the source data includes symbols, you must include the symbols in the date_format parameter. For example, if the source field displays 12/31/11, you must enter the format as “MM/DD/YY”.

AS alternate_column_title

Optional. Specifies a column title that is different from the field name.

WIDTH value

Optional. Specifies the display width for the field. This value is used as the column size when displaying the contents of the field in ACL views and reports.

PIC format

Optional. This parameter only applies to Numeric fields. Specifies the formatting (separators, decimals, etc.,) to apply to numeric values. The format parameter must be a quoted string.

Example

a. Define a physical data field

The following example creates a physical data field called Transaction_date with a start position of 6, a length of 10 bytes, and a format of MM/DD/YYYY:

DEFINE FIELD Transaction_date DATE 6 10 MM/DD/YYYY

b. Define a physical data field that reads mainframe Packed data

The following example creates a physical data field that reads date values from a packed numeric field using the NDATE parameter. ACL cannot recognize a date in a number that is compressed into fewer bytes than one per digit and that displays no date format. Consequently, you must “unpack” the number with NDATE to obtain the full number of digits, then specify the date format with the PIC parameter. Use the same date format as that contained in the record layout to indicate which numbers represent the day, the month, and the year. ACL then reads a date such as 20110830 as August 30, 2011.

DEFINE FIELD date_field_name NUMERIC 1 8 0 NDATE PIC "YYYYMMDD"



(C) 2012 ACL Services Ltd. All Rights Reserved.