Process Help

TBLIN - input data using table driven flat-file method

 

Process Name

Menu Path

Link to Command Table

TBLIN

Command line only

Click here

 

Introduction

Table driven "flat-file" data input process.

How to use

Enters data of definable format from a system file or the keyboard. The names, types and locations of the input data fields are specified by EXDEF , an external definition file. The field layout organization of the input data can be defined with LAYOUT. The data may be filtered on input if required. Filtering is optional, and may be specified via fields in EXDEF or keywords in FILTER.

Note : All filter, end-of-data and page separator matching is case-insensitive. The input data is written to OUT. The data definition is controlled via PROTODD , FIELDLST and EXDEF as follows :-

If PROTODD is supplied, its data definition is used as a prototype for OUT.
If FIELDLST is supplied, it specifies a subset of the fields defined in EXDEF for creation in OUT.
If neither PROTODD nor FIELDLST are supplied, all fields defined in EXDEF are output.

Both PROTODD AND FIELDLST can not be used at the same time. Data records containing errors may be output to ERROR if desired. All files, EXDEF ,OUT ,ERROR ,FILTER ,PROTODD , FIELDLST if specified, must be different.


Notes

>TPLNAME> Name of template to use from EXDEF. Default is only template in EXDEF. Max 8 char, must exist if supplied.

>FILE DESCRIPTION> 60 char text comment for OUT. >PS > Optional page separator. Max 72 chars. Default is Page Feed character. For FINDPG>=1 only.

>SYSFILE> External file name (max 56 chars); blank for none. Organization as per LAYOUT.

>DATA > Data lines if no SYSFILE, in defined LAYOUT. ! or EOD terminates.

 


Files, Fields and Parameters

Input Files

Name

Description

I/O Status

Required

Type

EXDEF

External field definition table. Specifies names, types and locations of input data fields. Retrieval criteria, if any, operate on EXDEF. EXDEF must contain at least the following :- TPLNAME A8 External template name. FIELD A8 Logical name given to field in external file. START N Start position for char based layout (inclusive). END N End position for char based layout (inclusive). EXTFLDNR N External field number for field based layout. TYPE A1 Field type alpha/numeric {A,a,N,n} only. MIN N Check value < "MIN" , output to ERROR if true. MAX N Check value > "MAX" , output to ERROR if true. ALPHJST A1 Required justification for output string {L,l,R,r,N,n} ALPHWID N Required output field width. ALPHDEF A12 If input field empty or blank, set to "ALPHADEF" Optional filter fields for operations on numeric output fields:- ABSENT A12 Search for "ABSENT" and replace with '-'. TRACE A12 Search for "TRACE" and replace with 'TR'. CVTZERO A12 Search for zero value and replace with "CVTZERO". CVTBLANK A12 Search for "whitespace" and replace with "CVTBLANK" CVTNEG A12 Search for "-ve values" and replace with "CVTNEG" If "CVTNEG"=KEEP, make no conversion. If "CVTNEG"=RGCE, convert -ve values with the formula : RESULT=ABS(VALUE)/2 CONST N Add "CONST" to the input value. FACTOR N Multiply result by "FACTOR". SHIFT N Add "SHIFT" to result, and store this value.

Input

Yes

Undefined

FILTER

Optional input data filter table. Must contain at least the following fields :- FIELD A8 Name of field for filtering. USERIN A16 Value, key or pattern to search for in "FIELD" USEROUT A16 If "USERIN" matches, replace with "USEROUT" USERIN Keywords (reserved words entered in square brackets [] ):- [CVTZERO] : search for "0" and replace with USEROUT. [CVTBLANK] : search for "whitespace" and replace with USEROUT. [CVTNEG] : search for -ve values and replace with USEROUT. [CONST] : add "USEROUT" to input value (step 1) [FACTOR] : multiply "USEROUT" with input value (step 2) [SHIFT] : add "USEROUT" to input value (step 3) [char] : search for char,if present anywhere, replace with USEROUT. user string : match entire string (ignore leading and trailing blanks), and replace with USEROUT. USEROUT Keywords :- - : use Datamine Missing Value for USEROUT. TR : use Datamine Trace Value for USEROUT. [RGCE] : use formula USEROUT=ABS(input)/2 (Only with [CVTNEG]) user string : use the supplied value for USEROUT. Multiple USERIN/USEROUT pairs can be supplied for any field. If USERIN consists of the bracketed sequence [char], then any input data containing "char" will be replaced with "USEROUT". eg USERIN=[<],USEROUT=TR will replace <0.01 with TR. FIELD for USERIN=[char] or user string can specify a numeric or an alpha input field.

Input

No

Undefined

PROTODD

Optional prototype data definition. Selects fields to be created in OUT. If not supplied, data definition is created for all fields defined in EXDEF. Implicit fields defined in EXDEF are made explicit. Alpha field lengths are taken from EXDEF.

Input

No

Undefined

FIELDLST

Optional field subset list. Selects fields to be created in OUT. If not supplied, data definition is define for all fields in EXDEF. Maximum of one of PROTODD , FIELDLST can be specified. FIELDLST must contain at least the following field:- FIELD A8 Name of field for output. (must be subset of EXDEF)

Input

No

Undefined

Output Files

Name

I/O Status

Required

Type

Description

OUT

Output

Yes

Table

Output database file to be created.

ERROR

Output

No

Undefined

Optional output file for error records. If not supplied, data which is outside MIN...MAX limits is placed in OUT.

Parameters

Name

Description

Required

Default

Range

Values

LAYOUT

Input file organisation method. 1=Char Each field located by START, END. 2=Free Datamine standard "free" format. 3=Comma Fields separated by commas, no quotes 4=Single Fields sep. by commas, quote with ' 5=Double Fields sep. by commas, quote with " 6=White Fields separated by spaces/tabs 7=User Supply FS and/or DELIM explicitly

Yes

1

1,7

1,2,3,4,5,6,7

DELIM

Optional field delimiter. Max 4 chars.

No

Undefined

Undefined

Undefined

FS

Optional field separator. Max 4 chars.

No

Undefined

Undefined

Undefined

SKIPHD

>=1 Omit n lines of header (0).

No

0

Undefined

Undefined

FINDPG

>=1 Scan for "page breaks" and omit headers and footers from all pages (0).

No

0

0,1

0,1

EOD

Optional end of data string. Max 4 char.

No

Undefined

Undefined

Undefined

TRACE

>=1 Display each nth input record (0).

No

0

0,1

0,1


Example


Error and Warning Messages

Message

Description

Solution