Hi All,
I'm looking to run a script on a regular basis which imports data from another file.
The first line of the import file contains headers and needs to be avoided, the attached error always appears.
I just don't want the error appearing every time I ran it or I don't want to delete the headers from the file each time it's run.
Thanks,
Hassam
I'm looking to run a script on a regular basis which imports data from another file.
The first line of the import file contains headers and needs to be avoided, the attached error always appears.
I just don't want the error appearing every time I ran it or I don't want to delete the headers from the file each time it's run.
Code:
DEFINE VARIABLE cInputFile AS CHARACTER.
DEFINE VARIABLE cOutputFile AS CHARACTER.
DEFINE VARIABLE iOrder AS INTE.
DEFINE VARIABLE cWebOrdNum AS CHAR FORMAT "x(12)".
ASSIGN cInputFile = "\HybrisOrdMerge\Orders-From-Inc.csv"
cOutPutFile = "\HybrisOrdMerge\Both-B2B-Orders-Created-In-Hybris.csv".
DEFINE STREAM sInput.
DEFINE STREAM sOutput.
INPUT STREAM sInput FROM VALUE (cInputFile).
OUTPUT STREAM sOutput TO VALUE (cOutPutFile).
DEFINE TEMP-TABLE tt-Orders
FIELD IncOrdNum AS INTE
FIELD IncWebOrdNum AS CHAR
FIELD ELOrdNum AS INTE
FIELD ELWebOrdNum AS CHAR
INDEX tt-Orders IS PRIMARY UNIQUE IncOrdNum.
REPEAT:
IMPORT STREAM sInput DELIMITER "," iOrder cWebOrdNum.
CREATE tt-orders.
ASSIGN tt-orders.IncOrdNum = iOrder.
ASSIGN tt-orders.IncWebOrdNum = cWebOrdNum.
END.
INPUT STREAM sInput CLOSE.
FOR EACH tt-orders WHERE NO-LOCK:
Thanks,
Hassam