IMPORT PRINT command

Creates an Analytics table by defining and importing a Print Image (Report) file.

Syntax

IMPORT PRINT TO table import_filename FROM source_filename <SERVER profile_name> character_set_value <code_page_number> {[record_syntax] [field_syntax] <...n>} <...n>
record_syntax ::=
RECORD record_name record_type lines_in_record transparent [test_syntax] <...n>
test_syntax ::=
TEST include_exclude match_type AT start_line,start_position,range logic text
field_syntax ::=
FIELD name type AT start_line,start_position SIZE length,lines_in_field DEC value WID bytes PIC format AS display_name

Parameters

General parameters

Name Description
TO table

The name of the Analytics table to import the data into.

Note

Table names are limited to 64 alphanumeric characters. The name can include the underscore character ( _ ), but no other special characters, or any spaces. The name cannot start with a number.

import_filename

The name of the Analytics data file to create.

Specify import_filename as a quoted string with a .FIL file extension. For example, "Invoices.FIL".

By default, the data file (.FIL) is saved to the folder containing the Analytics project.

Use either an absolute or relative file path to save the data file to a different, existing folder:

  • "C:\data\Invoices.FIL"
  • "data\Invoices.FIL"

FROM source_filename

The name of the source data file. source_filename must be a quoted string.

If the source data file is not located in the same directory as the Analytics project, you must use an absolute path or a relative path to specify the file location:

  • "C:\data\source_filename"
  • "data\source_filename"
SERVER profile_name

optional

The profile name for the server that contains the data that you want to import.
character_set_value

The character set used to encode the Print Image (Report) file. The following values are supported:

  • 0 – ASCII
  • 1 – EBCDIC
  • 2 – Unicode
  • 3 – Encoded text
code_page_number

optional

If you specified 3 (Encoded text) for character_set_value, you must also enter a code page number.

RECORD parameter

General record definition information.

Note

Some of the record definition information is specified using numeric codes that map to options in the Data Definition Wizard.

In scripts, specify the numeric code, not the option name.

Name Description

RECORD record_name

The name of the record in the Data Definition Wizard.

Specifying record_name is required in the IMPORT PRINT command, but the record_name value does not appear in the resulting Analytics table.

In the Data Definition Wizard, Analytics provides default names based on the type of record:

  • Detail
  • Headern
  • Footern

You can use the default names, or specify different names.

record_type

The three possible record types when defining a Print Image file:

  • 0 – detail
  • 1 – header
  • 2 – footer

Note

You can define multiple sets of header and footer records in a single execution of IMPORT PRINT, but only one set of detail records.

lines_in_record

The number of lines occupied by a record in the Print Image file.

You can define single-line or multiline records to match the data in the file.

transparent

The transparency setting for a header record.

Note

Applies to header records only.

  • 0 – not transparent
  • 1 – transparent

Transparent header records do not split multiline detail records.

If a header record splits a multiline detail record in the source Print Image file, which can happen at a page break, specifying 1 (transparent) unifies the detail record in the resulting Analytics table.

TEST parameter

The criteria for defining a set of records in the Print Image file. You can have one or more occurrences of TEST (up to 8) for each occurrence of RECORD.

Note

Some of the criteria are specified using numeric codes that map to options in the Data Definition Wizard (option names are shown in parentheses below).

In scripts, specify the numeric code, not the option name.

Name Description
TEST include_exclude

How to treat matching data:

  • 0 – (Include) data meeting the criteria is included in the set of records
  • 1 – (Exclude) data meeting the criteria is excluded from the set of records
match_type

The type of matching to perform:

  • 0 – (Exact Match) matching records must contain the specified character, or string of characters, in the specified start line, starting at the specified position
  • 2 – (Alpha) matching records must contain one or more alpha characters, in the specified start line, at the specified start position, or in all positions of the specified range
  • 3 – (Numeric) matching records must contain one or more numeric characters, in the specified start line, at the specified start position, or in all positions of the specified range
  • 4 – (Blank) matching records must contain one or more blank spaces, in the specified start line, at the specified start position, or in all positions of the specified range
  • 5 – (Non-Blank) matching records must contain one or more non-blank characters (includes special characters), in the specified start line, at the specified start position, or in all positions of the specified range
  • 7 – (Find in Line) matching records must contain the specified character, or string of characters, anywhere in the specified start line
  • 8 – (Find in Range) matching records must contain the specified character, or string of characters, in the specified start line, anywhere in the specified range
  • 10 – (Custom Map) matching records must contain characters that match the specified character pattern, in the specified start line, starting at the specified position
AT start_line, start_position, range
  • start_line the line of a record that the criteria apply to

    For example, if you create a custom map to match zip codes, and the zip codes appear on the third line of a three-line address record, you must specify 3 in start_line.

    Note

    For single-line records, the start_line value is always 1.

  • start_position the starting byte position in the Print Image file for the comparison against the criteria
  • range the number of bytes from the starting byte position in the Print Image file to use in the comparison against the criteria

    If you are using starting byte position only, without a range, specify 0 for range.

    Note

    non-Unicode Analytics1 byte = 1 character
    Unicode Analytics, extended ASCII (ANSI) data1 byte = 1 character
    Unicode Analytics, Unicode data2 bytes = 1 character

    For Unicode data, range must be an even number of bytes. For example, 50,59 (10 bytes). Specifying an odd number of bytes can prevent correct matching against criteria.

logic

The logical relations between criteria:

  • 0 – (And) the current and the next criteria are related with a logical AND
  • 1 – (Or) the current and the next criteria are related with a logical OR
  • 4 – (New Group > And) the current criterion is the last in a group of logical criteria, and the current group and the next group are related with a logical AND
  • 5 – (New Group > Or) the current criterion is the last in a group of logical criteria, and the current group and the next group are related with a logical OR
  • 7 – (End) the current criterion is the last in a group of logical criteria
text

Literal or wildcard characters to match against:

  • For Exact Match, Find in Line, or Find in Range specifies the character, or string of characters, that uniquely identifies the set of records in the Print Image file
  • For Custom Map specifies the character pattern that uniquely identifies the set of records in the Print Image file

    The Custom Map option uses the same syntax as the MAP( ) function.

For other match types, text is an empty string "".

FIELD parameters

Field definition information.

Name Description
FIELD name type

The individual fields to import from the source data file, including the name and data type of the field. To exclude a field from being imported, do not specify it.

For information about type, see Identifiers for field data types.

AT start_line, start_position
  • start_line the start line of the field in the record in the Print Image file

    For multiline records in a Print Image file, start_line allows you to start a field at any line of the record. start_line is always 1 if lines_in_record is 1.

  • start_position the starting byte position of the field in the Print Image file

    Note

    non-Unicode Analytics1 byte = 1 character
    Unicode Analytics, extended ASCII (ANSI) data1 byte = 1 character
    Unicode Analytics, Unicode data2 bytes = 1 character
SIZE length, lines_in_field
  • length the length in bytes of the field in the Analytics table layout

    Note

    non-Unicode Analytics1 byte = 1 character
    Unicode Analytics, extended ASCII (ANSI) data1 byte = 1 character
    Unicode Analytics, Unicode data2 bytes = 1 character

    For Unicode data, specify an even number of bytes only. Specifying an odd number of bytes can cause characters to display incorrectly.

  • lines_in_field the number of lines occupied by a single field value in the Print Image file

    You can define single-line or multiline fields to match the data in the file.

    Note

    The number of lines specified for a field cannot exceed the number of lines specified for the record containing the field.

DEC value

The number of decimals for numeric fields.

WID bytes

The display width of the field in bytes.

The specified value controls the display width of the field in Analytics views and reports. The display width never alters data, however it can hide data if it is shorter than the field length.

PIC format

Note

Applies to numeric or datetime fields only.

  • numeric fields the display format of numeric values in Analytics views and reports
  • datetime fields the physical format of datetime values in the source data (order of date and time characters, separators, and so on)

    Note

    For datetime fields, format must exactly match the physical format in the source data. For example, if the source data is 12/31/2014, you must enter the format as "MM/DD/YYYY".

format must be enclosed in quotation marks.

AS display_name

The display name (alternate column title) for the field in the view in the new Analytics table.

Specify display_name as a quoted string. Use a semi-colon (;) between words if you want a line break in the column title.

AS is required when you are defining FIELD. To make the display name the same as the field name, enter a blank display_name value using the following syntax: AS "". Make sure there is no space between the two double quotation marks.

Examples

Importing data from a Print Image (Report) file

You import data from the Print Image (Report) file, Report.txt.

One header record, and one set of detail records, with five fields, is created in the resulting Analytics table, Inventory_report:

IMPORT PRINT TO Inventory_report "Inventory_report.FIL" FROM "Report.txt" 0 RECORD "Header1" 1 1 0 TEST 0 0 AT 1,17,0 7 ":" FIELD "Field_1" C AT 1,19 SIZE 2,1 DEC 0 WID 2 PIC "" AS "Prod Class" FIELD "Field_2" C AT 1,24 SIZE 31,1 DEC 0 WID 31 PIC "" AS "Prod Description" RECORD "Detail" 0 1 0 TEST 0 0 AT 1,59,59 7 "." FIELD "Field_3" X AT 1,6 SIZE 9,1 DEC 0 WID 9 PIC "" AS "Item ID" FIELD "Field_4" C AT 1,16 SIZE 24,1 DEC 0 WID 24 PIC "" AS "Item Desc." FIELD "Field_5" N AT 1,40 SIZE 10,1 DEC 0 WID 10 PIC "" AS "On Hand" FIELD "Field_6" N AT 1,50 SIZE 12,1 DEC 2 WID 12 PIC "" AS "Cost" FIELD "Field_7" N AT 1,62 SIZE 12,1 DEC 2 WID 12 PIC "" AS "Total"

Remarks

For more information about how this command works, see Defining and importing print image (report) files and PDF files.

Identifiers for field data types

The table below lists the letters that you must use when specifying type for FIELD. Each letter corresponds to an Analytics data type.

For example, if you are defining a Last Name field, which requires a character data type, you would specify "C": FIELD "Last_Name" C.

For more information, see Data types in Analytics.

Note

When you use the Data Definition Wizard to define a table that includes EBCDIC, Unicode, or ASCII fields, the fields are automatically assigned the letter "C" (for the CHARACTER type).

When you enter an IMPORT statement manually, or edit an existing IMPORT statement, you can substitute the more specific letters "E" or "U" for EBCDIC or Unicode fields.

Letter

Analytics Data type

A

ACL

B

BINARY

C

CHARACTER

D

DATETIME

E

EBCDIC

F

FLOAT

G

ACCPAC

I

IBMFLOAT

K

UNSIGNED

L

LOGICAL

N

PRINT

P

PACKED

Q

BASIC

R

MICRO

S

CUSTOM

T

PCASCII

U

UNICODE

V

VAXFLOAT

X

NUMERIC

Y

UNISYS

Z

ZONED