Tuesday 30 July 2013

Easytrieve Basic Report Field Defination

Field Definition Statement

A field definition specifies data fields within a record on a file.
  • Four parameters are always required: field-name, start-location, field-length, and data-type.
  • Additional parameters include the number of decimal positions for quantitative fields, HEADING and MASK.
Syntax

Field-name      start-location         field-length    data-type    +
[ decimal-positions]         [HEADING ‘literal’ ]                          +
[ MASK { [letter] [BWZ] [‘literal’] } ]

Field-name
You create a field-name or adapt the field name in a record layout for your EASYTRIEVE PLUS program.
  • Field-names must be unique within a file.
  • The name can be 1 to 40 alphanumeric characters.
  • Special characters can be used, but not delimiters.
Start-location
The start location is the beginning location of a field in the record relative to the first position.
  • Start location can be explicitly defined based on position one of the record:

   NAME                   17        16         A
   ADDRESS            37        39         A
   PAY-NET              90         4          P      2
Field-length
You specify the length of a field in bytes (characters and / or spaces).

Data-type
You describe the type of data a field contains by coding the letter for that type after the field-length. There are five data-types.

              Type                               Max. Length ( bytes )

A          Alphanumeric                     32,767
N          Numeric                                 18
P          Packed                                   10
U          Unsigned Packed                     9
B          Binary                                      4
Decimal-positions
By specifying decimal-positions, you:
  • Identify a field to EASYTRIEVE PLUS as being quantitative.
  • Identify the field(s) to be automatically totaled when specified in a CONTROL report.
  • Allow for proper placement of commas and decimals with leading zeros suppressed when the field is printed.
Four types of data can have decimal positions:
                 N                    Numeric
                 P                    Packed
                 B                    Binary
                 U                    Unsigned Packed
Specify the decimal-positions by coding an integer (0 through 18) after the data-type. For example,
AMOUNT                40        5       N      2

Is a five-byte numeric field with two decimal positions.


No comments:

Post a Comment

New In-feed ads