IMPORT PRINT command
Concept Information
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:
|
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:
|
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:
|
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:
You can use the default names, or specify different names. |
record_type |
The three possible record types when defining a Print Image file:
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.
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:
|
||||||
match_type |
The type of matching to perform:
|
||||||
AT start_line, start_position, range |
|
||||||
logic |
The logical relations between criteria:
|
||||||
text |
Literal or wildcard characters to match against:
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 |
|
||||||
SIZE length, lines_in_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.
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 |
|
P |
PACKED |
Q |
BASIC |
R |
MICRO |
S |
CUSTOM |
T |
PCASCII |
U |
UNICODE |
V |
VAXFLOAT |
X |
NUMERIC |
Y |
UNISYS |
Z |
ZONED |