Parameter File for Data Transfer
Infor M3 SWB's data transfer procedure is flexible and the interface easily adapted to different user environments. The process is controlled by user defined parameter files and independent files are created for each record type. You can control the number and sequence of fields in each record and insert standard values into selected fields.
The parameter file PMOTRA.FID controls the layout of the input and export files, and is found in the Infor M3 SWB Control directory (for US installation it will usually be C:\Program Files\MvxAPP11\CONTROL).
A parameter file consists of these three parts:
- Statement Header
- Record Definition
- Field Definition
Example of Parameter File
Below is an example of a parameter file controlling complete and incremental file input (including 4 record types per file):
!*****************************************************************************
!* IMPORT FROM FILE WITH MULTIPLE RECORDS *
!* O,R,M/N & H IN THE SAME FILE: *
!* *
!* TOTAL: PMORGExx.DAT *
!* *
!* INCREMENTAL: PMOGI1xx.DAT *
!*****************************************************************************
[IMPORT]
FILEFORMAT=SEPARATED
ID=#1
! DELIMITER=;
! CHARQUOTES=
[O]
! Field Type Default Offset Length R Description
! ----- ------ --------------- ------ ------ - -------------------
#1 ;CHAR ; ;1029 ;1 ; "O" EXRTYP Record type
#2 ;CHAR ; ;9 ;12 ; COHPEG Peg ID
#3 ;CHAR ;NULL:ERROR ;113 ;25 ; COHITM Item number
#4 ;LONG ;NULL:ERROR ;8 ; ; MOHMRP Order number
#7 ;SHORT ; ;134 ; ; IOHPRI External network priority
#8 ;DATE ; ;9 ; ; MOHDDT MRP order due date
#9 ;TIME ; ;9 ; ; -"- -"-
#10 ;DATE ; ;10 ; ; MOHRDT MRP order release date
#11 ;TIME ; ;10 ; ; -"- -"-
#12 ;DATE ; ;11 ; ; MOHCDT End item peg receipt date
These subtopics support this section:
- Statement Header
- Record Definition
- Field Definition
Statement Header
The Statement Header contains general information about the file type and standard variables defining the file layout. Not all variables are mandatory.
This example shows the possible variables:
[IMPORT::O] (Statement Name)
LAYOUT=SINGLE_REC (Layout Information)
TYPE=READ (Type)
FILEFORMAT=SEPARATED (File Format)
ID=#1 (Record ID Number)
DELIMITER=; (Delimiter sign)
CHARQUOTES= (Quotes Around Strings)
DEF_FLOAT_FORM=6.2 (Standard Length)
! This is a Commentary Line ----- ------ ---------------
Statement Name
Every statement header must contain a statement name. This name controls the type of import/export to be performed. The different types are:
-
Single files:
[IMPORT]
[JOB]
[EXPORT]
-
Multiple files:
[IMPORT::O]
[IMPORT::R]
[IMPORT::M/N]
[IMPORT::H]
[JOB::O]
[JOB::R]
[JOB::M/N]
[JOB::H]
[EXPORT::O]
[EXPORT::R]
[EXPORT::M/N]
[EXPORT::H]
Layout Information
Layout information controls whether the overall data file is displayed as single or multiple files or records. The options are:
- LAYOUT = SINGLE_REC
- LAYOUT = MULTI_REC
This variable is not mandatory.
Type
Type defines whether it is an import or export file. The two options are:
- TYPE = READ
- TYPE = WRITE
This variable is not mandatory.
File Format
The File format variable has these optional values:
-
FILEFORMAT = SEPARATED
Separated means that the fields in the data file are separated by a defined delimiter (refer to paragraph 3.1.6).
-
FILEFORMAT = FIXED
Fixed means that the fields in the data file are placed in fixed character positions.
This variable is mandatory.
Record ID Number
The Record ID number is the number of the field identifying the record. There are four different record types in the regular Infor M3 SWB order transfer: O, R, M/N and H. The Record ID occupies the first field in the standard parameter file.
This variable is mandatory.
Delimiter Sign
The delimiter sign is only used if the file formats must be kept separate. You can use any character or sign as a delimiter. Nevertheless, if you include it in data or character string fields, then it is interpreted as an extra field.
This variable is not mandatory. If the variable is not defined, then Infor M3 SWB will use the quotation sign defined in the PARA module in the menu.
Quotes Around Strings
his variable defines whether character strings in the data file are surrounded by quotations. You can use quotations with characters or signs but not with data and character string fields.
This variable is not mandatory. If the variable is not defined, then Infor M3 SWB will use the quotation sign defined in the PARA module in the menu.
Standard Length
Standard length defines the normal length of fields. It is especially useful when the file format is fixed.
In the field definition, you define the length of a field. With the a fixed file format you must define the length of all fields with the standard length for a data type or by individual definition of the individual fields (over-writing the standard length).
You have these options:
- DEF_SHORT_LEN
- DEF_LONG_LEN
- DEF_FLOAT_LEN
- DEF_DATE_LEN
- DEF_TIME_LEN
This variable is not mandatory.
Commentary Line
A comment line always begins with a [ ! ]. The data here is treated as information only.
8.4.3 Record Definition
The record definition comes right after the statement header.
If the import file only contains one record type (LAYOUT = SINGLE_REC) the record is not given a name.
[IMPORT::O]
Transformation
TRANSFORM=#7;A:10;B:20;C:30;OTHERWISE:40;
! Field Type Default Offset Length R Description
! ----- ------ --------------- ------ ------ - -------------------
#1 ;CHAR ;"" ;1029 ;1 ; "O" EXRTYP Record type
#2 ;CHAR ;"" ;9 ;12 ; COHPEG Peg ID
#3 ;CHAR ;"NULL:ERROR" ;113 ;25 ; COHITM Item number
If the import file contains more than one record type (LAYOUT = MULTI_REC) record definitions are separated by a name.
[IMPORT]
ID=#1
[O]
! Field Type Default Offset Length R Description
! ----- ------ --------------- ------ ------ - -------------------
#1 ;CHAR ; ;1029 ;1 ; "O" EXRTYP Record type
#2 ;CHAR ; ;9 ;12 ; COHPEG Peg ID
#3 ;CHAR ;NULL:ERROR ;113 ;25 ; COHITM Item number
#4 ;LONG ;NULL:ERROR ;8 ; ; MOHMRP Order number
! O's definition follows on.
[R]
TRANSFORM=#7;A:10;B:20;C:30;OTHERWISE:40;
! Field Type Default Offset Length R Description
! ----- ------ --------------- ------ ------ - -------------------
#1 ;CHAR ; ;1029 ;1 ; "R" EXRTYP Record type
#2 ;CHAR ; ;1071 ;12 ; CXRPEG Peg ID
#3 ;CHAR ;NULL:ERROR ;1030 ;25 ; CXRITM Item number
#4 ;LONG ;NULL:ERROR ;257 ; ; MXRMRP Order number
! R's definition follows on.
[M]
! Field Type Default Offset Length R Description
! ----- ------ --------------- ------ ------ - -------------------
#1 ;CHAR ; ;1029 ;1 ; "M" EXRTYP Record type
#3 ;CHAR ;NULL:ERROR ;65 ;25 ; CRSPIT Parent item number
#4 ;LONG ;NULL:ERROR ;14 ; ; MRSPON Parent order number
! M's definition follows on.
[N]
! Field Type Default Offset Length R Description
! ----- ------ --------------- ------ ------ - -------------------
#1 ;CHAR ; ;1029 ;1 ; "N" EXRTYP Record type
#3 ;CHAR ;NULL:ERROR ;65 ;25 ; CRSPIT Parent item number
#4 ;LONG ;NULL:ERROR ;14 ; ; MRSPON Parent order number
! N's definition follows on.
[H]
! Field Type Default Offset Length R Description
! ----- ------ --------------- ------ ------ - -------------------
#1 ;CHAR ; ;1029 ;1 ; "H" EXRTYP Record type
#2 ;CHAR ; ;158 ;12 ; CCOPEG Peg ID
#3 ;DATE ; ;2 ; ; MCOEDD Earliest order line
! H's definition follows on.
Transformation
To transform field contents, use the TRANSFORM variable when you import or export data. This variable must be placed immediately before the field defining the actual record.
Example
[IMPORT]
ID=#1
[R]
TRANSFORM=#5;A:10;B:20;C:30;OTHERWISE:40;
! Field Type Default Offset Length R Description
! ----- ------ --------------- ------ ------ - -------------------
#1 ;CHAR ; ;1029 ;1 ; "R" EXRTYP Record type
#2 ;CHAR ; ;1071 ;12 ; CXRPEG Peg ID
#3 ;CHAR ;NULL:ERROR ;1030 ;25 ; CXRITM Item number
#4 ;LONG ;NULL:ERROR ;257 ; ; MXRMRP Order number
#5 ;LONG ;NULL:ERROR ;9 ; ; MOPNUM Operation number
The value in field 5 is transformed in this way:
Old value | Transformed value |
---|---|
A | 10 |
B | 20 |
C | 30 |
Others | 40 |
OTHERWISE transforms all values different from A, B and C to 40. OTHERWISE does not must be used.
If you also want to transform back again when the data is exported, you must add reverse transformations as follows.
TRANSFORM=#5;10:A;20:B;30:C;OTHERWISE:D;
Record Name
The record name defines the type of record. The options are:
- O (order header)
- R (operation)
- M/N (material)
- H (end item)
Field Definition
The field definition comes right after the record definition. It defines which fields are being used by the record layout.
Field Number in the Data File | Infor M3 SWB Data Type | Format Field | Infor M3 SWB offset | Length | Identification Field | Commentary | |
---|---|---|---|---|---|---|---|
#1 #2 #3 #4 #7 #C |
;CHAR ;CHAR ;CHAR ;LONG ;SHORT ;SHORT |
;"" ;"" ;"NULL:ERROR" ;"NULL:ERROR" ;"" ; 789 |
;1029 ;9 ;113 ;8 ;134 ;8 |
;1 ;12 ;25 |
; "O" |
EXRTYP COHPEG COHITM MOHMRP IOHPRI |
Record type Peg ID Item number Order number External network priority |
Field Number in the Data File
The field number defines the sequence number of the field in the data file. If you do not specify this value, when you import your data, the field is jumped over and not included. During data export, dummy fields with null contents are generated.
You can initialize Infor M3 SWB variables to constant values by writing #C instead of using a field number. Here are examples of three constant fields:
#C ;SHORT ; 789 ;8 ; ; (The value at offset 8 is set to 789)
#C ;LONG ; 66000 ;9 ; ;
#C ;FLOAT ; 5.5 ;5 ; ;
Infor M3 SWB Data Type
Infor M3 SWB data type defines which type of Infor M3 SWB variable is used. These data types are available:
- CHAR
- SHORT
- LONG
- FLOAT
- DOUBLE
- DATE
- TIME
- DUMMY (see explanation below).
For fixed format files, the parameter file must contain the length of all the fields, whether you want to transfer them into Infor M3 SWB. Use the data type DUMMY for fields you do not plan to transfer.
You do not have to include DUMMY fields for delimiter separated files. If you use the standard sequence of fields provided in the interface manual and the dummy feature for fields that will not be included it is easier to communicate with us should you require consultant support.
Example
#1 ;CHAR ;"" ;1029 ;1 ; "O" EXRTYP Record type
#2 ;CHAR ;"" ;9 ;12 ; COHPEG Peg ID
#3 ;DUMMY ; ; ; ; Dummy field
The import file in the example has three fields, though only the first two fields should be read in. If you omit the DUMMY code, then you will get a warning that the import file has too many fields.
Format Field
Format field is used to define and structure data fields. Quotation marks placed around the code are optional. The formatting options available always depends on the type of data:
Data types | Format | Definition |
---|---|---|
ALL | NULL:ERROR | The field is mandatory. If the field is empty you will get a warning. |
ALL | NULL:SKIP | If the field is empty, no initialization of the content in Infor M3 SWB is done. |
ALL | NULL:value | If the field is empty, it is initialized in Infor M3 SWB with the defined value. Example: NULL:123 will put the value in Infor M3 SWB to 123, if the data field is empty. |
LONG | FILTER1 |
If the value of the field consists of letters and a number �letter��number1*� the result in Infor M3 SWB is a conversion to a number = asc(letter) * 1000 + number1. If the field does not contain letters the result is number1. * number1 must be less than 1000. Examples: A100 => 65100 and 752 => 752. |
CHAR | STARTPOS:value |
Only part of a character string field is transferred to Infor M3 SWB that is from the STARTPOS value position and length character forward. Examples: STARTPOS:3 and length = 5 for character string ABCDEFGHIJKLMN transfers the string CDEFG to Infor M3 SWB. A warning is given if the field length is over written. |
Infor M3 SWB Offset
Infor M3 SWB offset defines the byte offset in Infor M3 SWB's internal data structure, where the value is inserted/extracted. This offset is normally unchangeable.
Length: Length defines how long the field will be. The type of length parameter depends on the chosen file format.
Separated
With FILEFORMAT=SEPARATED field length for the data type CHAR must be used to define the number of characters in the field.
For the data type TIME it might be necessary to define a length depending on which TIME format, you use (see description under Fixed).
For all other data types length has no meaning.
Fixed
With FILEFORMAT=FIXED you must define the length for each field during both import and export.
For data type, FLOAT and DOUBLE you can define length and precision. For example: Length 6.2 for FLOAT defines a field with total length of 6, a decimal sign and 2 decimals. Write the number 7.43 as:
Char. position: 1234567
Number: 7.43
For the data type TIME, you can define a length of 6, 4 and 2. If a length is not defined the standard length is used (see table below). The three different length definitions have these consequences for the interpretation of the TIME data:
- Length 6: The data in the field is converted to hours, minutes and seconds. If the field contains less than 6 characters the 2 less significant characters (to the right) are converted to seconds, the 2 next characters are converted to minutes, etc.
- Length 4: If the field in the import file contains less than 4 characters the value in the field is converted to hours and minutes. If the field in the import file contains more than 4 characters the value in the field is converted to hours, minutes and seconds.
- Length 2: If the field in the import file contains 2 or less than 2 characters the value in the field is converted to hours. If the field in the import file contains 3 or 4 characters, the value in the field is converted to hours and minutes. If the field in the import file contains more than 4 characters the value in the field is converted to hours, minutes and seconds.
The conversion of TIME fields is always done from right to left. These examples illustrate the interpretation of TIME data depending on the field length defined:
Data | Length 6 | Length 4 | Length 2 |
---|---|---|---|
...;122324;... | 12:23:24 | 12:23:24 | 12:23:24 |
...;230017;... | 23:00:17 | 23:00:17 | 23:00:17 |
...;071523;... | 07:15:23 | 07:15:23 | 07:15:23 |
...;71523;... | 07:15:23 | 07:15:23 | 07:15:23 |
...;123;... | 00:01:23 | 01:23:00 | 01:23:00 |
...;1510;... | 00:15:10 | 15:10:00 | 15:10:00 |
...;7;... | 00:00:07 | 00:07:00 | 07:00:00 |
...;17;... | 00:00:17 | 00:17:00 | 17:00:00 |
General
If you omit the length parameter a standard length is used (see table below). Other standard values can also be defined.
Data type | Standard length | Variable used for over writing the standard length |
---|---|---|
SHORT | 4 | DEF_SHORT_LEN |
LONG | 9 | DEF_LONG_LEN |
FLOAT & DOUBLE | 10.3 | DEF_FLOAT_FORM |
DATE | 8 | DEF_DATE_LEN |
TIME | 4 | DEF_TIME_LEN |
Identification Field
For single files, the statement header must contain a Record ID number, which is treated as the identification field for the record. The Record ID number is usually 1, typically referring to O, R, M or H lines.
Commentary
Text following the identification field is regarded as comments and not imported/exported data.