GLI Input

There are four valid types of input record. The GLI input (file) must supply records in the following order:

  1. Header records

  2. Ispec

  3. Data

  4. Finish records

Each record may contain up to 4150 characters. The first six characters of each record identify the record type.

If a header record or an ispec record is accepted, the message OK is returned. Refer to GLI Output for more information.

If there is an error in the header record or an ispec record, the message FATAL is returned and the program terminates. All data preceding the error will have been successfully loaded.

Note: When GLI input reaches ten or more validation errors, no additional input is recorded in the database. Moving spaces to Glb.Error does not prevent this from occurring.

Header Record

The header record defines the origin, destination, and source of the data, as well as various attributes detailing the handling of messages and errors.

A header record is mandatory and must be the first record supplied to the GLI program after execution.

The first six characters of the header record must be the word HEADER. The remaining positions contain header attributes and their operands. Header attributes can be included in any order separated by spaces. All header attributes except LOG; are mandatory. The header record may not be continued over multiple lines.

Valid header attributes and their abbreviations are detailed in the following table:

Header Attribute

Abbr.

Description

DESTINATION;

DES;

Specifies the name of the database to be updated.

ORIGIN;

ORI;

Specifies an alphanumeric string of up to eight characters for identification.

SOURCE;

SR;

Gives a description of the source of the input, for your documentation purposes.

REQD.ACK;

RQA;

Specifies whether you want an acknowledgment for each transaction to be passed back to the source of the input through standard output. Valid operands are YES (Y) and NO (N).

If YES is entered, acknowledgment messages are returned to the input source. Messages can have the following values: OK, NOT OK, and FATAL. A fatal error causes GLI to terminate immediately.

REQD.ACK;Y is required if ERROR.MSG;Y is specified.

ERROR.MSG;

ERM;

Specifies whether error messages are to be passed back to the source of the input (through standard output). Valid operands are YES (Y) and NO (N). REQD.ACK;Y is required if ERROR.MSG;Y is set.

If error messages are being returned to the input source, the end of each transaction is indicated by a single status message with a value of OK, NOT OK, or FATAL.

If a transaction incurs errors, all of the errors are returned to the source of the input. When all errors have been returned, the message NOT OK is returned. All error messages returned after an OK or NOT OK message and before the next NOT OK or FATAL message relate to a single transaction.

A FATAL message is returned if GLI encounters a severe error, and GLI terminates immediately.

LOG;

Optional attribute which specifies whether GLI produces a printed log of errors to standard error. Valid operands are YES (Y) and the default NO (N).

Example of a header record:

HEADER DES;XXXSYS SR;PROG ORI;ZZZSYS ERM;Y RQA;Y LOG;Y

Ispec Record

The ispec record specifies the ispec to be updated, and defines the format of the data in any later data records. Attributes are validated against the corresponding ispec in the application.

The data may be in one of two forms:

Defining an Ispec Record for Formatted Data

The first five characters of the ispec record must be the word ISPEC, and the sixth character must be a space.

EVENT; or COMPONENT; (COMP;) must identify the ispec. The ispec can not be usage output.

Include FORMATTED; (or BYPASS; or BY;) to bypass the conversion process. Nothing further is required in the ispec record.

Defining Ispec Records for Unformatted Data

The first five characters of each ispec record (including lines continued over more than one line) must be the word ISPEC, and the sixth character must be a space.

EVENT; or COMPONENT; (COMP;) must identify the ispec. The ispec can not be specified as usage output.

Several ispec records may be needed to define the data format for an ispec. Attributes must be defined in the correct sequence, using particular property names followed by their values.

Properties of ispec records are shown below:

Properties

Abbreviation

DATA;

DA;

LENGTH;

LE;

EDIT;

ED;

DECIMAL;

DE;

SETUP.DATA;

SD;

The following conditions apply to these properties:

Edit types are listed in the following table:

Edit

Description

A

Alphanumeric item

N

Unsigned numeric

S

Signed numeric item (negative DR)

C

Signed numeric item (negative CR)

+

Signed numeric item (shows + and -)

-

Signed numeric item (negative -)

D

Date item

Setup.Data

SETUP.DATA; can be used in the ispec record. This command defines an attribute that is to have the same literal value applied for all later GLI data records for that ispec. The following conditions apply to SETUP.DATA;:

Examples of formatted data in an ispec record:

ISPEC EVENT; SALE FORMATTED;

Examples of unformatted data in an ispec record:

ISPEC EVENT; SALE DA; CLIENT LE; 10 EDIT; A
ISPEC DATA; PRODUCT LENGTH; 5 ED; N DA; GLB.SPACES LE; 2
ISPEC DA; ANUMBER ED;   LE; 4 DE; 2 SD; ACTMTH (9904) LE; 4

In this example, the built-in attribute ActMth receives the value 9904 for all data records. Notice that all lines of the ispec record begin with ISPEC.

Data Records

Data records are passed by GLI to the application. The first five characters of the record must contain the name of an ispec previously defined in a GLI ispec record. The sixth character must be a space. The data for the ispec then follows, in the format defined by the ispec record.

A GLI data record can be included at any time after the ispec record with which it is associated. A particular ispec can occur in more than one ispec record and can have different definitions (for example, different LENGTH; and EDIT; values). Data records for an ispec use the last ispec record declared for that ispec.

Unformatted Data

For a copy class, supply data for each copy in a separate record.

Do not include a decimal character for numeric values.

Signed numeric values are assumed to have the sign specified by EDIT;. To indicate that the value has the opposite sign, replace the digit in the first numeric position, according to the following table:

Digit

Replace with

0

}

1

J

2

K

3

L

4

M

5

N

6

O

7

P

8

Q

9

R

Examples

To load a negative value of 56500 into an attribute of length 5 with EDIT; +, load

N6500

To load an attribute of length 8, load

}0056500

To load a positive value of 7634127 into an attribute of length 7 with EDIT; -, load

P634127

There are different considerations for unformatted data and formatted data.

Formatted Data

For a copy class, data for all copies must be supplied in one record.

Signed numeric values require a sign (+, -, DR, or CR) following the value.

Numeric values with decimals must not include a decimal character. Add a leading zero if the attribute in the application has DECIMAL.KEYED.

Numeric values must not include separator characters. Add a leading zero to allow for each separator character if the attribute in the application has SEPARATOR.

Examples of records for unformatted data:

ISPEC EVENT; SALE  DA; CLIENT LE; 12 EDIT; A
ISPEC DATA; PRODUCT LENGTH; 5 ED; N DA; GLB.SPACES LE; 2
ISPEC DA; ANUMBER ED; N LE; 4 DE; 2 SD; ACTMTH (9904) LE; 4
SALE  MR NO BODY  12345  0100
SALE  MS SOME BODY12345  }100
FINISH

Examples of records for formatted data:

ISPEC EVENT; SALE FORMAT;
SALE  9904MR NO BODY  1234500100
SALE  9904MS SOME BODY1234500100-

For both types of format, the results are the same. For the first data record, the attribute CLIENT takes the value MR NO BODY, PRODUCT 12345, ANUMBER 1.00, and ACTMTH 9904. For the second data record, CLIENT takes the value MS SOME BODY, PRODUCT 12345, ANUMBER - 1.00, and ACTMTH 9904.

Finish Record

The finish record indicates the end of input to the GLI program.

The first six characters of the record must be FINISH, and the remainder must be blank. No acknowledgment is returned.