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
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
- O (order header)
- R (operation)
- M/N (material)
- H (end item)