ImportFile
Use this form set level rule to import transactions (via a standard export file) from Documaker Desktop into GenData. This rule outputs the transaction to an NAFILE.DAT file which can then be used by the GenData program.
Note | You can import multiple export files if you use the SCH option. |
Syntax
There are several ways to specify the import file in the option parameter:
Option |
Description |
FILE = file name |
Enter the name and path of the import file. |
INI = INI control group, option |
Enter the INI control group and option in which the import file is defined. |
SCH = offsetofmask, <searchmask> offsetofdata, lengthofdata |
This indicates the file name is contained in a record of the extract file. The offsetofmask is the offset of the search mask, offsetofdata is the offset where the file name starts, and lengthofdata is the length of the file name. |
GVM = GlobalVariableName |
GlobalVariableName defines the GVM that contains the file name and path information. |
The INI and FILE options normally import the same file for each transaction. The SCH and GVM options let you import a different file for each transaction.
Keep in mind:
- For each field that comprises a section (whose data comes from the combined standard export file), you must create or have a DDT record with the field rule set to one of these field rules:
- If you use the NoOpFunc rule for any field rule associated with the standard export file, you must insert the ReplaceNoOpFunc rule in the <Base Rules> section of the AFGJOB.JDT file.
- Place the ImportFile rule in the <Base Form Set Rules> section of the AFGJOB.JDT file after the BuildFormList rule or any custom rule that creates a form set.
- Do not include the LoadRcpTbl, RunSetRcpTbl, GetCo, or GetLOB rules in your AFGJOB.JDT file.
Assume you have the following items defined in your master resource library. Keep in mind:
- The ReplaceNoOpFunc rule is required in the AFGJOB.JDT file because one of the fields in the sample DDT uses the NoOpFunc rule.
- Trn_Fields control group options are based on items in the first record of the combined WIP/NA/POL Export data file.
- The LoadRcpTbl and RunSetRcpTbl or GetCo and GetLOB rules are not required if this information was assigned from the imported file. It may, however, be necessary to use other rules, such as the Field2GVM rule, to move data from the imported form set fields to relevant GVM variables.
Here is a sample import file named IMPORT.DAT file:
;SAMPCO;LB1;EXPORT FILE # 1;NB;P ;;
\NA=\;SAMPCO;LB1;LETTER2;
\NA=q1snam\
\NA=q1fl2a\
DATE\October 12, 2000
LESSEE_NAME\Morris Sander
LESSEE_addr\3200 Windy Hill Road
LESSEE_city\Atlanta, GA 30339
\NA=q1b302\
\NA=q1ba36\
\NA=q1ba32\
\NA=q1sal1\
Here is a sample DDT file:
;0;0;Date;0;0;Date;0;25;; NoOpFunc;;N;N;N;…
;0;0;Lessee_Name;0;9;Lessee_Name;0;25;; MapFromImportData;;N;N;N;…
;0;0;Lessee_addr;0;25;Lessee_addr;0;25;; MapFromImportData;;N;N;N;…
;0;0;Lessee_city;0;25;Lessee_city;0;25;; MapFromImportData;;N;N;N;…
Here are sample INI settings:
< TRN_Fields >
Key1 = 2,6,N
Key2 = 32,2,N
KeyID = 13,18,N
< TRN_File >
BinaryExt = N
MaxExtRecLen = 120
< ExtractKeyField >
SearchMask = 2,SAMPCO
< Data >
ExtrFile = xxxxx (see the import file example above)
Example
The following examples illustrate the different ways you can define the import file when you use this rule.
Using the File option
This example imports information from a file named IMPORT.DAT in the \import directory and uses that information to create the GenData files which the GenPrint program uses to create the print output files.
Here is an excerpt from a sample AFGJOB.JDT file:
<Base Rules>
…
;ReplaceNoOpFunc;;;
/* Every form set in this base uses these rules. */
<Base Form Set Rules>
;NoGenTrnTransactionProc;;;
;ResetOvFlw;;;
;BuildFormList;;;
;ImportFile;;File=.\Import\Import.dat;
…
Using the INI option
This example imports information based on the Import_File option in the Import_Data control group. Using this information, the GenData program creates the files the GenPrint program uses to create the print output files.
Here are the sample INI settings:
< Import_Data >
Import_File = .\Import\Import.dat\
Here is an excerpt from a sample AFGJOB.JDT file:
<Base Rules>
…
;ReplaceNoOpFunc;;;
/* Every form set in this base uses these rules. */
<Base Form Set Rules>
;NoGenTrnTransactionProc;;;
;ResetOvFlw;;;
;BuildFormList;;;
;ImportFile;;INI=Import_Data,Import_File;
…
Using the SCH option
This example imports multiple Documaker Desktop export files based on the content of a line in the extract file. Using this information, the GenData program creates the files the GenPrint program uses to create the print output files.
Here is an excerpt from a sample extract file named EXTRFILE.DAT:
;CWNG;CIS;1;NB;W ;; TXT .\Import\impt1file.dat
;CWNG;CIS;1;NB;W ;; TXT .\Import\impt2file.dat
…
For this example, use these INI options:
< Data >
ExtrFile = extrfile.dat
< TRN_Fields >
Key1 = 2,4,N
Key2 = 7,3,N
KeyID = 35,22,N
< ExtractKeyField >
SearchMask = 2,CWNG
Here is an excerpt from a sample AFGJOB.JDT file:
<Base Rules>
…
;ReplaceNoOpFunc;;;
/* Every form set in this base uses these rules. */
<Base Form Set Rules>
;NoGenTrnTransactionProc;;;
;ResetOvFlw;;;
;BuildFormList;;;
;ImportFile;2;SCH=30,TXT 35,21;
…
Using the GVM option
This example imports data from an import file based on a GVM variable called Import_File. Using this information, the GenData program creates the files the GenPrint program uses to create the print output files. Any valid GVM variable can be used no matter how it is created or assigned.
Here is an excerpt from a sample AFGJOB.JDT file:
<Base Rules>
....
;ReplaceNoOpFunc;;;
/* Every form set in this base uses these rules. */
<Base Form Set Rules>
;NoGenTrnTransactionProc;;;
;ResetOvFlw;;;
;BuildFormList;;;
;ImportFile;;GVM=Import_File;
…
See also
- MapFromImportData
- ReplaceNoOpFunc
- RULNestedOverFlowProc
- ImportNAPOLExtract
- ImportNAPOLFile
- ImportExtract
© Copyright 2020, Oracle and/or its affiliates. All rights reserved. Legal notices.