Example of an FID file
!*****************************************************************************
!* IMPORT FROM FILE WITH MULTIPLE RECORDS *
!* O,R,M/N & H IN THE SAME FILE: *
!* *
!* TOTAL: PMORGEXX.DAT
*
!* *
!* INCREMENTAL: PMOGI1XX.DAT *
!*****************************************************************************
FILEDEF(OPTR1,H:\PSFI\CONTROL\OPTR1.TXT)
[IMPORT]
FILEFORMAT=SEPARATED
CONVERTCHARS=WINDOWS_TO_PMSIM
ID=#1
! DELIMITER=;
! CHARQUOTES=
[O]
SUBSTITUTION=(#7,OPTR1.#4),KEYS((#14,OPTR1.#1),(#7,OPTR1.#2)),NFA(SKIP)
SUBSTITUTION=(#7,OPTR1.#4),KEYS((#14,OPTR1.#1),(#7,OPTR1.#2)),NFA(SKIP)
SUBSTITUTION=(#30,OPTR1.#3),KEYS((#14,OPTR1.#1),(#7,OPTR1.#2)),NFA(SKIP)
! FIELD TYPE DEFAULT OFFSET LENGTH R DESCRIPTION
! ----- ------ --------------- ------ ------ - -------------------
TRANSFORM=#7;0:1;
#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
#13 ;TIME ; ;11 ; ; -"-
-"-
#14 ;SHORT ;NULL:ERROR ;136 ; ; IOHSTA SHOP ORDER STATUS
#15 ;FLOAT ;NULL:ERROR ;13 ; ; ROHPLQ PLANNED QUANTITY
#16 ;FLOAT ; ;14 ; ; ROHFDQ FINISHED QUANTITY
#17 ;CHAR ; ;138 ;25 ; COHRON DESCRIPTION
#18 ;CHAR ; ;163 ;10 ; COHSON SHOP ORDER NUMBER
#19 ;DATE ; ;60 ; ; MOHIST INFINITE
SCHEDULED START
#20 ;TIME ; ;60 ; ; -"-
-"-
#21 ;DATE ; ;61 ; ; MOHIED INFINITE
SCHEDULED END
#22 ;TIME ; ;61 ; ; -"-
-"-
#23 ;DATE ; ;58 ; ; MOHFST FINITE SCHEDULED
START
#24 ;TIME ; ;58 ; ; -"-
-"-
#25 ;DATE ; ;59 ; ; MOHFED FINITE SCHEDULED
END
#26 ;TIME ; ;59 ; ; -"-
-"-
#27 ;SHORT ; ;130 ; ; IOHMLC LOW LEVEL CODE
#28 ;SHORT ; ;528 ; ; IXRPGC PEGGING CODE
#30 ;SHORT ; ;13 ; ; IOHPU1 PULL-UP CODE 1 -
TOO EARLY
#31 ;SHORT ; ;14 ; ; IOHPU2 PULL-UP CODE 2 -
DELAYED
#32 ;SHORT ; ;128 ; ; IOHEXT EXTRA CODE
#34 ;SHORT ;NULL:1 ;135 ; ; IOHOCD ORDER GROUP
#35 ;CHAR ; ;6 ;3 ; COHRTY ROUTING TYPE
#36 ;LONG ; ;6 ; ; MOHPGS PEG SUFFIX
#37 ;FLOAT ; ;17 ; ; SOHMFC(1MULTIPLICATION
FACTOR 1
#38 ;FLOAT ; ;18 ; ; SOHMFC(2MULTIPLICATION
FACTOR 2
#39 ;FLOAT ; ;19 ; ; SOHMFC(3MULTIPLICATION
FACTOR 3
#40 ;FLOAT ; ;20 ; ; SOHMFC(4MULTIPLICATION
FACTOR 4
#41 ;FLOAT ; ;21 ; ; SOHMFC(5MULTIPLICATION
FACTOR 5
#42 ;FLOAT ; ;22 ; ; SOHMFC(6MULTIPLICATION
FACTOR 6
#43 ;FLOAT ; ;23 ; ; SOHMFC(7MULTIPLICATION
FACTOR 7
#44 ;FLOAT ; ;24 ; ; SOHMFC(8MULTIPLICATION
FACTOR 8
#45 ;FLOAT ; ;25 ; ; SOHMFC(9MULTIPLICATION
FACTOR 9
#46 ;FLOAT ; ;26 ; ; SOHMFC(1MULTIPLICATION
FACTOR 10
! #47 ;SHORT ; ;55 ; ; IOHOPR EXTERNAL ORDER
PRIORITY
#47 ;SHORT ; ;55 ; ; IOHOPR EXTERNAL ORDER
PRIORITY
#48 ;DATE ; ;63 ; ; MOHTIM ORDER TIMESTAMP
#49 ;TIME ; ;63 ; ; -"-
-"-
#50 ;SHORT ; ;139 ; ; IOHCGR COLORING GROUP
#51 ;CHAR ; ;173 ;1 ; EOHOSS MRP STATUS
#52 ;CHAR ; ;280 ;1 ; EOHOTY ORDER TYPE
! #56 ;DUMMY ; ; ; ;
Explanation of the FID file above:
FILEDEF()
defines the file token OPTR1.
[IMPORT]
starts a Statement called IMPORT.
Entry | Value | Description |
---|---|---|
FILEFORMAT |
SEPARATED FIXED |
DELIMITER and CHARQUOTES must be defined. |
CONVERTCHARS |
WINDOWS_TO_PMSIM PMSIM_TO_WINDOWS NONE |
|
TYPE |
WRITE READ READ_RENAME APPEND |
|
CHARQUOTES |
Or Or any char | Only one CHAR is allowed. It is possible that it has no value, but nothing can be placed after the = sign. |
DELIMITER |
; or , or any char | Only one CHAR is allowed. If nothing is displayed after the = sign the semicolon is used. |
LAYOUT |
MULTI_REC SINGLE_REC |
|
ID |
Whole numbers | Whole numbers corresponding to the record datafields. The type of Record can often be read in the ID=#1 |
TRANSFORM |
||
SUBSTITUTION |
NFA(X) Not found Action, where X can be: ERROR: Error message WARNING: Error message GEN_NEW_SEQNUM: is used to replace the alpha numeric order number with the numeric number for internal use in M3 SWB. SKIP: Ignore |
|
DEF_FLOAT_FORM |
||
DEF_NUM_DECIMAL |
||
DEF_SHORT_LEN |
Can not be 0 | |
DEF_INT_LEN |
Can not be 0 | |
DEF_LONG_LEN |
Can not be 0 | |
DEF_DATE_LEN |
Can not be 0 | |
DEF_TIME_LEN |
Can not be 0 | |
PREFIXED_ZEROS |
YES | Place zeros before such that each number is the same length. This is used primarily for data entry. The default is NO. |
Substitution Example:
FILEDEF(OP,H:\stelton\control\ordrepef.txt)
SUBSTITION = (#4, OP.#3)KEYS((#6,OP.#1),(#2,OP.#2)),NFA(SKIP)
File Token OP means file H:\stelton\control\ordrepef.txt, that is shown below:
2;3;40;23
8;1;30;21
OP.#1 | OP.#2 | OP.#3 | OP.#4 |
---|---|---|---|
2 | 3 | 40 | 23 |
8 | 1 | 30 | 21 |
In this example, the source file shows this information:
O;1;PEN/GOLD;2;13;8;10;
O;2;PEN/GOLD;4;13;8;10;
O;3;PEN/GOLD;2; ;2;10;
O;4;PEN/GOLD;2; ;2;10;
#1 | #2 | #3 | #4 | #5 | #6 | #7 |
---|---|---|---|---|---|---|
O | 1 | PEN/GOLD | 2 | 13 | 8 | 10 |
O | 2 | PEN/GOLD | 4 | 13 | 8 | 10 |
O | 3 | PEN/GOLD | 2 | 2 | 10 | |
O | 4 | PEN/GOLD | 2 | 2 | 10 |
#1 | #2 | #3 | #4 | #5 | #6 | #7 |
---|---|---|---|---|---|---|
O | 1 | PEN/GOLD | 30 | 13 | 8 | 10 |
O | 2 | PEN/GOLD | 4 | 13 | 8 | 10 |
O | 3 | PEN/GOLD | 40 | 2 | 10 | |
O | 4 | PEN/GOLD | 2 | 2 | 10 |
#6==8
and #2==1
and Field #4 in the third row has changed to 40 because
field #6==2
and #2==3
.This pertains to all O record entries in the Data file Pmorge01.
IF (OP.Column #1 == Data.#6) AND (OP.Column.#2 == Data.#2)
THEN Data.#4 = OP.Column#3