Data definition items (formerly known as attribute definition items) define the attributes, that is, the characteristics of the data in a file. They specify the format and the type of processing required to generate English reports.
You can set up any number of data definition items in the file's dictionary. A data definition item is associated with an attribute in a data file item by specifying the appropriate Attribute Mark Count (AMC) in attribute 2 of the data definition item. This definition then refers to that attribute (also known as a 'line' or 'field') within items in a data file.
You can set up data definition items to:
Attribute 1 D/CODE. Defines the item as an attribution definition. Use one of the following codes:
A Marks the item as a data definition item that is to be used whenever an English statement references the attribute either explicitly or implicitly.
S Like A, but suppresses default column heading when attribute 3 of the data definition item is blank. This is obsolescent as a backslash in attribute 3 now gives 'null' heading.
X Marks the item as a data definition item that is to be used exactly like an A code item except when the attribute is part of an implied output specification. When so used, an X D/CODE item is skipped. See Default Output Specification.
Attribute 2 A/AMC (Attribute/Attribute Mark Count). This must be a number or null. A number refers to the corresponding attribute, or line, in an item except that the following numbers have special meanings:
0 Item-id.
9998 Ordinal number of item.
9999 Size of item.
For more information, see Special Attribute Mark Counts.
You can leave A/AMC null if attributes 7 or 8 have only function codes, which reference attribute numbers directly.
Attribute 3 Column heading text, null, or backslash followed by text. Detailed information is provided in Column Headings.
Attribute 4-6 Not used and reserved.
Attribute 7 V/CONV. Conversion codes to be used for processing 'input' data (that is, values specified in an English sentence), or following sort and selection processing before output. Codes specified in this attribute are known as input/output conversions. Valid conversion codes that can be used in this or in the next attribute are described in detail in Conversion Codes.
Multiple conversion codes, each separated by a value mark (CTRL+]), can be entered in this and the next attribute. Multiple codes are processed from left to right.
Attribute 8 V/CORR. Conversion codes to be used for processing the data before sort and select operations and before conversions in attribute 7 are processed. Codes specified in this attribute are known as pre-processor codes.
Attribute 9 V/TYP. Specifies the positioning of the data in the columns. Valid codes are as follows:
L Left aligned. If the data exceeds the column width specified in attribute 10, the data is broken at column width without respect to blank spaces.
I Indented text. Like T but all lines after the first line are indented by one space.
R Right align. If the data exceeds the column width specified in attribute 10, overwrites left column boundary. Should always be used for numeric data (including dates in internal format) to give correct sorting.
T Text (left aligned). Where possible, a RETURN to the left end of column is performed when a blank space is encountered so as not to split words between lines.
U Unlimited. Data is output on one line ignoring column boundaries.
Attribute 10 V/MAX. Numeric (decimal) value to specify the column width for the data.
If the number of characters in the column heading (attribute 3) is greater than the number entered here, English uses the number of characters in the column heading.
Various data definition items can specify different column widths for defining the output format for the same physical data.
Note: A column width of zero allows an attribute to be used for, for example, control breaks, without being output in a report.
Column headings are not displayed if an English statement contains a COL-HDR-SUPP output modifier or C command option. You specify column headings in attribute 3 of the data definition item, which can contain one of the following:
If attribute 1 of the data definition item contains an S and attribute 3 is null, English treats the item as though it had an A in the first attribute and a backslash followed by null in the third. The S D/CODE is an older form that is still used in some systems.
English allows you to set up data definition items that the system uses if an English statement does not include any specification of attributes to be output. The data definition items must be named by number (1, 2, 3, and so on). These numbers represent the order in which headings and the associated data are to be output. They need not follow the sequence of the attributes in the file's items.
When English processes a statement that does not have any output specification, it looks in the dictionary for a data definition item named 1, then for an item named 2, then 3, and so on until it no longer finds an item with the next higher number. If the data definition item has an A D/CODE, the heading and data for that attribute are output. If the data definition item has an X D/CODE, however, English skips that attribute and looks for the next higher number.
So, when you set up a series of implied data definition items, put an A in the first attribute of each one. If you later wish to skip one or more of these items, change their first attribute to X. Remember that English stops looking for items when it does not find a number in sequence: if you delete an item in the middle of a series, English stops looking for any higher numbers.
A data definition item with an X D/CODE is skipped only when the output specification is implied. A data definition item with a number for a name can be used explicitly in the output specification clause or in any other clause where an attribute is appropriate. When used this way, a data definition item with an X D/CODE is treated exactly like a data definition item with an A D/CODE.
Assume a PERSONNEL file with the employee badge number as item-id, last name in attribute 1, first name in attribute 2, and the title of the position in attribute 7 of each item. The data definition items for the automatic display of the column header and the associated data contain the following data:
1 2 3 Item Name 001 A 001 A 001 A Heading code 002 l 002 2 002 7 Attribute No. 003 Last Name 003 First Name 003 Title Heading text 004 004 004 005 005 005 006 006 006 007 007 007 008 008 008 009 L 009 L 009 L Alignment 010 20 010 15 010 15 Column width
:LIST PERSONNEL PAGE 1 11:19:56 11 MAY 1994 PERSONNEL. Last Name........ First Name ..... Title...... 0023 Brown Charles Programmer 0024 Clarkson Lydia Secretary 0025 Wood Laurence Manager 3 ITEMS LISTED
If you were to change attribute 1 of data definition item 2 from A to X, that attribute would not be displayed:
:LIST PERSONNEL PAGE 1 11:19:56 11 MAY 1994 PERSONNEL. Last Name........ Title......... 0023 Brown Programmer 0024 Clarkson Secretary 0025 Wood Manager 3 ITEMS LISTED
The next example uses the ROOMS file to illustrate a heading on two lines. Note that attribute 3 has a value mark (CTRL+]) indicating where the heading break should be.
ROOM-CODE 001 A Heading option 002 l Attribute number 003 Room]Code Heading text 004 005 006 007 008 G0,l Group extraction - G Code 009 L Alignment 010 4 Column width
The group extraction - G Code - in attribute 8 is used to display only the bed code in the ROOMS file. Attribute 1 in that file contains both the bed code and the room code.
:SORT ROOMS BY ROOM-CODE ROOM-CODE PAGE 1 10:17:15 04 MAY 1994 ROOMS..... Room Code 117 D 119 D 194 D 142 D 144 D 194 D 211 DL . . 444 ST 478 ST 600 ST 30 ITEMS LISTED
The next example uses the same data definition item as the previous example but attribute 3 is changed to illustrate the use of the backslash to suppress the heading.
ROOM-CODE 001 A Heading option 002 l Attribute number 003 \ Suppress heading 004 005 006 007 008 G0,l G code 009 L Alignment 010 4 Column width
:SORT ROOMS BY ROOM-CODE ROOM-CODE PAGE 1 10:19:15 04 MAY 1994 ROOMS..... .... 117 D 119 D 194 D 142 D 144 D 194 D 211 DL . . 444 ST 478 ST 600 ST 30 ITEMS LISTED
English recognizes three special attribute mark counts (A/AMC): 0, 9998, and 9999. When attribute 2 of a data definition item contains 0, the system returns the item-id. When it contains 9998, the system returns a line count equal to the number of lines so far in a report produced by LIST or SORT. When it contains 9999, the system returns the item size.
Instead of using numbers 9998 or 9999, you can use function operators within an A or F conversion code in attribute 7 or 8 of the data definition item. Function code operand NI yields the same value as the 9998 AMC. Operand NL yields the same value as the 9999 AMC.
A data definition item can be set up to define an item-id attribute to allow a LIST or SORT operation to list the item-ids in a column other than the first, and to use any column heading.
Typically, when using such an attribute, you would use the ID-SUPP modifier or the I command option to suppress the item-id in the first column.
Assume a PERSONNEL file with the employee badge number as item-id, last name in attribute 1, and first name in attribute 2.
The data definition items to display last names, first names and badge numbers could contain the following data:
NAME FIRST.N BADGE Item Name 001 A 001 A 001 A Heading code 002 l 002 2 002 0 Attribute No. 003 Last Name 003 First Name 003 Badge Heading text . . . 009 L 009 L 009 L Alignment 010 17 010 14 010 % Column width :SORT PERSONNEL BY NAME FIRST.N BADGE (IH) Last Name........ First Name..... Badge Brown Charles 1023 Clarkson Lydia 0573 Wood Laurence 5068 3 ITEMS LISTED
A data definition item can be set up to define an attribute that allows a LIST or SORT operation to number each line of output. If you set the A/AMC (second attribute) to 9998, English returns the current line count. The function code operand NI returns the same value.
A data definition item specifying item count allows an English sentence similar to the following to be used:
ENTRYNUM 001 A 002 9998 Count specification 003 Entry]No. Column heading 004 005 006 007 008 009 R Alignment 010 5 Column width :LIST STOCK ENTRYNUM HDR-SUPP STOCK..... Entry No. 23060 1 35085 2 32080 3 23075 4
A data definition item can be set up to define an item size attribute. If you set the A/AMC (second attribute) to 9999, English returns the size of the item including the item-id, all attribute marks in the item, and the segment mark at the end of the item body. The size does not include the item header nor any pad. The function code operand NL returns the same value.
A data definition item specifying item size allows an English sentence similar to the following to be used:
SIZE 001 A 002 9999 Size specification 003 Size Column heading 004 005 006 007 008 009 R Alignment 010 6 Column width :SORT STOCK BY SIZE WITH SIZE > "300" SIZE HDR-SUPP STOCK..... Size.. 23060 396 35085 404 32080 518 23075 519
Predefined data definition items are automatically loaded into the MD when an account is created. Additional items can be created or the existing items can be customized. However, any changes may be overlaid by subsequent upgrades.
If appropriate data definition items are not included in a file's dictionary, a report can be generated using the data definition items in the account's MD. Data definition items provided with each new account include items 1 through 11 and *A1 through *A13.
Predefined definition items 1 to 11 define the corresponding AMCs as shown in the table below.
Predefined definition items *A1 to *A13 contain the data indicated in the last row of the table below, where n is a number in the range 1 to 13.
Item | AMC | Heading | Align | Width |
---|---|---|---|---|
1 | 1 | D/CODE | L | 8 |
2 | 2 | A/AMC | L | 10 |
3 | 3 | S/NAME | L | 10 |
4 | 4 | S/AMC | R | 2 |
5 | 5 | L/RET | L | 10 |
6 | 6 | L/UPD | L | 10 |
7 | 7 | V/CONV | L | 15 |
8 | 8 | V/CORR | L | 10 |
9 | 9 | V/TYP | L | 2 |
10 | 10 | V/MAX | L | 3 |
11 | 11 | V/MIN | L | 3 |
*An | n | *An | L | 10 |
Note: Attribute 11 is not currently used, but is reserved for future extensions.
The following predefined definition items are also provided:
Item | Description |
---|---|
DPTR | Returns 1 if the item is a D-pointer; otherwise 0. |
Dictionary item contents are automatically listed under the headings for predefined definition items 1 to 11 if the English sentence does not contain an output specification:
:LIST DICT INV.HQ PAGE 1 10:05:25 05 MAY 1994 INV.HQ : INV.HQ D/CODE DL attr. 1 - D-Pointer A/AMC ACCOUNTS/INV.HQ.INV.HQ attr. 2 - Control data S/NAME B3 301,1 attr. 3 - Control data V/TYP L attr. 9 - Alignment V/AMX lO attr. 10 - Column width INV.HQ : INV.LGB D/CODE DL . . .
If there are no data definition items in a file's dictionary, a report can be generated under the predefined headings as follows:
:SORT PERSONNEL 1 2 3 PAGE 1 10:46:30 05 MAY 1994 PERSONNEL. D/CODE.. A/AMC... S/NAME 0023 Brown Charles 22 Sycamore Dr. 0024 Clarkson Lydia 1001 South St. 0025 Wood Laurence 168 Belsize Ave.
An enquiry using *An within the output specification is as follows:
:SORT PERSONNEL *A1 *A2 *A3 PAGE 1 10:46:30 05 MAY 1994 PERSONNEL. *A1....... *A2....... *A3....... 0023 Brown Charles 22 Sycamore Dr. 0024 Clarkson Lydia 1001 South St. 0025 Wood Laurence 168 Belsize Ave.