A CSV example: Sage Line 50 Stock File

The system installs with an example import filter for the Sage Line 50 stock file. The example is given here along with the package script it generates. Also shown are a few sample ‘donor’ CSV records that were used to create the sample package script.

Filter Script

ISSUE: 1.18

 

PACKET: Sage Stock File

 !Sage stock format (standard stock.csv)

 ! F#1 Stock code         -->mch:Material

 ! F#2 Stock description  -->mch:Name

 ! F#3 Category no.       -->(create a Class kode) mch:Class

 ! F#4 Department         -->NA

 ! F#5 Nominal code       -->mch:SellingNomCode and mch:BuyingNomCode

 ! F#6 Supplier ref.      -->(create a CSH record)(create a MCS record)mcs:Supplier

 ! F#7 Unit of sales      -->(create a UMT)mch:PackQty,mch:AllocationUnit,mch:ManQty

 ! F#8 Sale price         -->mch:PackPrice

 ! F#9 Tax code           -->NA

 ! F#10 Discount A        -->(create a MCQ)mcq:Discount

 ! F#11 Discount B        -->NA

 ! F#12 Discount C        -->NA

 ! F#13 Re-order level    -->NA

 ! F#14 Re-order qty      -->mch:ReOrderQty

 ! F#15 Part reference    -->mcs:TheirPartNum

 ! F#16 Location          -->(create Location kode)mch:HomeLocation

 ! F#17 Comodity code     -->NA

 STREAM:

   IGNORE: [F#0] == []

   F#1,F#2,F#3,F#4,F#5,F#6,F#7,F#8,F#9,F#10,F#11,F#12,F#13,F#14,F#15,F#16,F#17,

 ENDSTREAM:

 

 RECORD:umt SEGMENT:StockUnits [DUPS] WHEN: [F#7] <> []

 FIELDS:Unit,Class,Name,Picture,Description

   [F#7]|General|[F#7]|@n-24.2~ [F#7]s~|Imported from Sage Stock File

 ENDRECORD:

 

 RECORD:kdt SEGMENT:StockClasses [DUPS] WHEN: [F#3] <> []

 FIELDS:Class,Code,Name,Protected,Description

   StockClass|[F#3]|Category [F#3]||Imported from Sage Stock File

 ENDRECORD:

 

 RECORD:kdt SEGMENT:Locations [DUPS] WHEN: [F#16] <> []

 FIELDS:Class,Code,Name,Protected,Description

   Location|[F#16]|[F#16]||Imported from Sage Stock File

 ENDRECORD:

 

 RECORD:mch SEGMENT:StockRecords

 FIELDS:Material,Name,Class,Group,Family,Standard,Sellable,Buyable,PackQty,PackPrice

 FIELDS:ExtraCost,ExtraSetupCost,ManQty,IsModule,ReviewOn,RejectRate,ReOrderQty,HomeLocation

 FIELDS:JobCardLayout,SpecSheetLayout,DeviceLabelLayout,CofCLayout,SubContractLayout

 FIELDS:BuyingNomCode,SellingNomCode,Length,Width,MinUseQty,MinUseLength,MinUseWidth

 FIELDS:ExtraSetupTime,ExtraCycleTime,CutWidth,Squaring,MinBatchSize,MaxBatchSize,Description

   [F#1]|[F#2]|[F#3?StockClass,][F#3]||||Yes|Yes|[F#7][F#7?,1]|[F#8?Sterling,][F#8]

   ||[F#7][F#7?,1]|Yes|||[F#7!Each][F#7],[F#14!1][F#14]|[F#16?Location,][F#16]

   ||||

   [F#5]|[F#5]|||[F#7!Each][F#7],0|||||||1|1000000|Imported from Sage Stock File

 ENDRECORD:

ENDPACKET:

 

Package Script

!  Package script created by gxImportFilter

!

!          Created:  9/12/96 at 22:10:56

!    Filter Script: F:\MATCH_IT\CODE_DEV\GX\GX_SSTOK.FIL

!           Packet:

!       Source CSV: E:\CLIENTS\K2\SAGE\STOCK.CSV

!         Begin At:

!           End At: ACETAL.8MM

!     Package file: g:\temp\test.pak

!    CSV Separator: ,

!     Strip quotes: 1

!Package separator: |

 

ISSUE: 1.17

 

IMPORT: FROM:{{{  umt:StockUnits:1                    TO:}}} AS:umt [DUPS]

IMPORT: FROM:{{{  kdt:StockClasses:1                  TO:}}} AS:kdt [DUPS]

IMPORT: FROM:{{{  mch:StockRecords:1                  TO:}}} AS:mch

 

END:

 

{{{  kdt:StockClasses:1

kdt:Class,Code,Name,Protected,Description

StockClass|16|Category 16||Imported from Sage Stock File

}}}

{{{  umt:StockUnits:1

umt:Unit,Class,Name,Picture,Description

LOT|General|LOT|@n-24.2~ LOTs~|Imported from Sage Stock File

OFF|General|OFF|@n-24.2~ OFFs~|Imported from Sage Stock File

}}}

 

{{{  mch:StockRecords:1

mch:Material,Name,Class,Group,Family,Standard,Sellable,Buyable,PackQty,PackPrice,ExtraCost,ExtraSetupCost,ManQty,IsModule,ReviewOn,RejectRate,ReOrderQty,HomeLocation,JobCardLayout,SpecSheetLayout,DeviceLabelLayout,CofCLayout,SubContractLayout,BuyingNomCode,SellingNomCode,Length,Width,MinUseQty,MinUseLength,MinUseWidth,ExtraSetupTime,ExtraCycleTime,CutWidth,Squaring,MinBatchSize,MaxBatchSize,Description

 

1SIBIT.00001|O RING 25MM ID 5MM CROSS SECT.||StockClass,16|||LOT,1|Yes|Yes|LOT,1|Sterling,20.00|||||LOT,1|Yes|||||LOT,1.00|||||||4000|4000|Imported from Sage Stock File

 

1SIBIT.00002|19MM DIA 2MM S/A EPDM WASHER||StockClass,16|||OFF,1|Yes|Yes|OFF,1||||||OFF,1|Yes|||||OFF,360.00|||||||4000|4000|Imported from Sage Stock File

}}}

 

Donor CSV Samples

 

"1SIBIT.00001    ","O RING 25MM ID 5MM CROSS SECT.", 16,  3,"4000  ","      ","LOT     ",   20.00,"T1",  0.00,  0.00,  0.00,    0.00,    1.00,"                ","                "

 

"1SIBIT.00002    ","19MM DIA 2MM S/A EPDM WASHER  ", 16,  2,"4000  ","      ","OFF     ",    0.00,"T1",  0.00,  0.00,  0.00,    0.00,  360.00,"                ","                "