Focal Point
[CLOSED] Insert Script for logging ETL flow details

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

September 18, 2017, 09:42 AM
srajeevan
[CLOSED] Insert Script for logging ETL flow details
Hi ,
I am new to Iway DM and i have a requirement which is:
Listen to a directory and fetch the csv files in that and insert to a target table.Log the etl flow info everytime the flow runs.
I implemented the main flow which is listening and inserting to target table.
How can i log the details of the flow(like flow start time,end time,status,flow name etc).
Since i am new to Iway DM i am not that familiar with FOCUS code to write a procedure.
It will be really helpful if some one can help me with a sample procedure which takes the job id and insert the flow details into my log table.
I am not sure where to give the adapter name and table name.I didnt find any info about any SQL pass through procedure also in user guide.

This message has been edited. Last edited by: FP Mod Chuck,


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
September 18, 2017, 12:12 PM
dhagen
You don't have to write anything. All the logging is already done for you.

From the DMC, goto: Workspace/Logs and Traces/DataMigrator Log and Statistics


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
September 18, 2017, 05:03 PM
srajeevan
quote:
Originally posted by dhagen:
You don't have to write anything. All the logging is already done for you.

From the DMC, goto: Workspace/Logs and Traces/DataMigrator Log and Statistics



Actually...my requirement is to create a separate audit table which captures some log information.
so i tried to create a separate procedure which logs data into the audit table.

It is giving some silly error.
-SET &&DATA_FLOW_END_TIME=FPRINT(HGETC(8,'HYYMDS'),'HYYMDS','A');
-SET &&ETLLOG_LAST_SEQ_NO=1;
-SET &&STATUS= IF &&CM__RETURN NE 0 THEN 'ERROR' ELSE 'SUCCESS';

-*SQL SQLMSS SET SERVER CJICLOCAL
ENGINE SQLMSS SET DEFAULT_CONNECTION CON01
SQL SQLMSS
INSERT INTO druganalytics.dbo.audit_table (Serial_No.,Flow_Name,Status,Records_Inserted) VALUES
('1','hi','succ','60');
END
-RUN

-SET &&DATA_FLOW_NAME='hi';
-SET &&DATA_FLOW_START_TIME=&&DATA_FLOW_END_TIME;
-SET &&DATA_FLOW_END_TIME='time';

I tried to insert hard coded value but it gives the following error,

09/18/2017 17:02:13 DEVNODE 0 ERROR AT OR NEAR LINE 6 IN PROCEDURE sreejith/flow_demo
09/18/2017 17:02:13 DEVNODE (FOC295) A VALUE IS MISSING FOR: &&CM__RETURN

How can &&CM_RETURN value is missing.?
confused!!


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
September 19, 2017, 08:11 AM
dhagen
&&CM__RETURN is only set after a stored proc is executed. If you are calling your proc after a subflow is submitted using "CMASAP", then you need to know the dependency return code.

Post more code and we might be able to help.


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