Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ajaykumar1
Creator III
Creator III

need to store job failed time in qvd

Hi Experts,

I have the following scripts, it help me to store Start time and End time of tables like Invoice, Inventory. Now my problem is I am not getting job failed time in qvd if in case script fails due to any reason. I want to store failed time qvd for my analysis of monitoring system.

LET vStartTime = Now();

Invoice:

LOAD

*

FROM Data.csv;

LET vEndTime = Now();

ReloadDetails:

LOAD

'Data Table' AS ReloadTable,

'$(vStartTime)' AS StartTime,

'$(vEndTime)' AS EndTime

AutoGenerate (1);

LET vStartTime = Now();

Inventory:

LOAD

*

FROM Data1.csv;

LET vEndTime = Now();

Concatenate(ReloadDetails):

LOAD

'Data1 Table' AS ReloadTable,

'$(vStartTime)' AS StartTime,

'$(vEndTime)' AS EndTime

AutoGenerate (1);

// Add new records to QVD

IF Alt(FileSize('c:\Somepath\ReloadDetails.qvd'), 0) > 0 THEN

Concatenate(ReloadDetails)

LOAD

*

FROM ReloadDetails.qvd (qvd);

ENDIF;

STORE ReloadDetails INTO ReloadDetails.qvd;

Thanks

Ajay

2 Replies
maxgro
MVP
MVP

maybe from the .qvw logfile, at the end and with an external tool

or

you can try changing the errormode variable

SET ErrorMode=0;

store notexists into a.qvd (qvd);

trace $(ScriptError);

SET ErrorMode=1;

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You're not getting a Job failed time because it's pretty much impossible to capture "Any & all" job failures inside your script.

The first step towards capturing statement failure times is to set ERRORMODE to 0 and check ScriptError for a non-zero value after every critical script statement. The most obvious statements are CONNECT, LOAD, STORE.

As this may become a huge amount of work, depending on the length and complexity of your script, you may prefer to create a special document that scans task result files and is executed every time a Reload task fails (configure in QMC).

Best,

Peter