Focal Point
ETL Flow not reporting on truncated data

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/9507061926

March 01, 2013, 05:02 PM
AnnaR
ETL Flow not reporting on truncated data
Hello,

Here is the scenario; sometimes I receive source files with columns sizes larger than the original configuration setup in master data. During data load, some rows do not get loaded b/c there is truncation on data. There is no flag in Data Migrator to indicate that data was not loaded in its entirety due to truncation. Theonly way is to look through the log files. Data Migrator flow reads/processes only the
rows with column size fitting the master data specs and rpeorts the flow execution wuth return code 0 - but it is hardly a success. I tried using `Record Logging` feature that is available on the flow properties with attribute `Format Errors`; however that did nothing to capture truncated rows. Is there some method to flag the flow if ther eis truncation on the data? I know , I can setup master data with larger sizes, but I am looking for something that can be setup on a flow as a flag to indicate that some rows were not loaded due to truncation of data.

Any suggestions?


WebFOCUS 7.7, iWay Data Migrator, Windows
Excel, PDF, HTML, XML
March 06, 2013, 05:04 PM
Kerry
Hi Anna,

From our iWay manager: if you have not done so, please open a case with Customer Support Services for assistance. You may call 1-800-736-6130, or access online at InfoResponse.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
March 08, 2013, 07:55 AM
dhagen
We have the same situation. Add this stored proc before and after the data flow:

-* Verify the process.
-DEFAULTH &&U_FILE='NONE'
-DEFAULTH &&CO = 'MAN'
-IF &&U_FILE NE 'NONE' GOTO :VERIFY;
 
-* Allocate a file to store source format problems.
-SET &&U_FILE_NAME = LOCASE(&&CO.LENGTH, &&CO, 'A&&CO.LENGTH') || '_emgfile' || &YYMD || EDIT(HHMMSS('A8'),'_99_$99_$99');
-SET &&U_FILE_EXT = &&U_FILE_NAME || '.text';
-SET &&U_FILE = 'baseapp/' || &&U_FILE_EXT ;
FILEDEF EMGFILE DISK &&U_FILE
SET EMGSRV=FILE
-RUN
-EXIT
 
-* job has finished running ... test to see if emgfile contains values
-:VERIFY
APP QUERY baseapp HOLD
TABLE FILE FOCAPPQ PRINT SIZE
WHERE FILENAME EQ '&&U_FILE_EXT';
ON TABLE HOLD AS T_FSIZE
END
-RUN 
-READFILE T_FSIZE
-RUN
-SET &&KILL_RPC = IF &SIZE EQ 0 THEN 'N' ELSE 'Y';
-SET &MSG1 = IF &&KILL_RPC EQ 'N' THEN ' ' ELSE '-TYPE (FOC0209) Source format errors, check following file for details';
-SET &MSG2 = IF &&KILL_RPC EQ 'N' THEN ' ' ELSE '-TYPE (FOC0209) File: ' | &&U_FILE;
-SET &FDEL = IF &&KILL_RPC EQ 'Y' THEN ' ' ELSE 'APP DELETEF BASEAPP &&U_FILE_NAME TEXT';
&MSG1.EVAL
&MSG2.EVAL
&FDEL.EVAL
-EXIT  


For every row that gets removed from the query because of truncation, a line is added to the EMGFILE. If the EMGFILE has any values, then the process will set the KILL_RPC flag.

Side note: You might want to break the above into 2 procedures just in case you run multiple data flows - as RPC - in a single process flow.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott