This was the same post which i kept before above 2 post
+++++++++++++++++++++++++++++++++++++++++++++++++
Hi
I am exporting a data from Teradata in the binary format using TPT export oprator. This exported data will be input for the mainfram.
But while loading data in mainfram , Mainfram Team is telling the exported data is not comming in the correct format. below are the issues raised by mainfram team
Issue:-
Two byte of record information is getting appended in the lead position of the record.
The file generated isn’t consistent
Please find my TPT script and layout of the binary files ..please let me know how can we reoslve this issue.
--------------TPT EXPORT SCRIPT---------------------------------
DEFINE JOB EXPORT_TO_FILE_SALESBYTYPE
DESCRIPTION 'Export to tgt_file EFD.SLS.BY.TYPE.OCT11.dat for SALES BY TYPE'
(
DEFINE SCHEMA PRODUCT_SOURCE_SCHEMA
(
DST_PROC_WK_END_D CHAR(10),
DST_DEPT_I SMALLINT,
DST_CLASS_I SMALLINT,
DST_LOC_I SMALLINT,
DST_INV_TYPE_C CHAR(3),
DST_SLS_Q BIGINT,
DST_SLS_A DECIMAL(18,2)
);
DEFINE OPERATOR EXPORT_OPERATOR
TYPE EXPORT
SCHEMA PRODUCT_SOURCE_SCHEMA
ATTRIBUTES
(
VARCHAR PrivateLogName = 'export_log',
VARCHAR TdpId = 'TDDEVA',
VARCHAR UserName = 'S**********',
VARCHAR UserPassword = '***********',
VARCHAR SelectStmt = 'SELECT CAST(X.SLS_D AS CHAR(10)),
Z.MDSE_DEPT_REF_I,
Z.MDSE_CLAS_REF_I,
Y.CO_LOC_REF_I,
X.SLS_TYPE_C,
CAST (X.SLS_UNIT_Q AS BIGINT),
CAST ( X.EXT_SLS_PRC_A AS DECIMAL(18,2))
FROM TEST7_V.MDSE_SLSTR_ITEM_LINE X,
TEST20_V.CO_LOC Y,
TEST20RPT_V.MDSE_ITEM_DIM_V Z
WHERE X.MDSE_ITEM_I=Z.MDSE_ITEM_I
AND X.CO_LOC_I=Y.CO_LOC_I
AND Y.CO_LOC_REF_I=3
AND X.SLS_D =1120923 ;'
);
DEFINE OPERATOR FILE_WRITER
TYPE DATACONNECTOR CONSUMER
SCHEMA *
ATTRIBUTES
(
VARCHAR PrivateLogName = 'dataconnector_log',
VARCHAR DirectoryPath = 'C:\scripts\Other-TPT',
VARCHAR FileName = 'EFD.SLS.BY.TYPE.OCT11.dat',
VARCHAR Format = 'Binary',
VARCHAR OpenMode = 'Write',
VARCHAR INdicatorMode = 'N'
);
APPLY TO OPERATOR (FILE_WRITER)
SELECT * FROM OPERATOR (EXPORT_OPERATOR[2]);
);
-------------------------
Below is the binary file layout
Layout:
01 INSTOCKS- FILE.
05 DEPT-I PIC S9(04) USAGE COMP.
05 CLASS-I PIC S9(04) USAGE COMP.
05 ITEM-I PIC S9(04) USAGE COMP.
05 STORE_I PIC S9(04) USAGE COMP.
05 OUT-OF-STK-F PIC X(01).
05 BEL-MIN-F PIC X(01).
05 WCI-F PIC X(01).
05 GOAL-PRCNT PIC S9(03)V9(02) COMP-3.
↧