All Forums Tools
rnekkanti 12 posts Joined 05/15
03 Mar 2016
How to extract the count for source & target records in TPT

Good Morning TPT experts!
I need some help to extract counts from TPT.
I am trying to provide some assertions to users based on the number of records read from the source and number of records loaded into TD.
Is there any diagnostics functions present in TPT to extract the count of source records processed and number of records loaded into TD.
I have some details in the log file like these below .
LOYALTY_REDEMPTION_INFO_odbc: data retrieval complete
LOYALTY_REDEMPTION_INFO_odbc: Total Rows Exported:  576369
LOYALTY_REDEMPTION_INFO_updt: entering Application Phase
LOYALTY_REDEMPTION_INFO_updt: Rows Inserted: 576369

Can anyone suggest how can I get these highlighted values without parsing the logs?.

Thanks, RN
dnoeth 4628 posts Joined 11/04
03 Mar 2016

MERGE can't be used for Inserts into a table with a Identity PI (unless it's a single row).
You need to use two statements using old-school UPDATE WHERE EXISTS & INSERT/SELECT WHERE NOT EXISTS.


feinholz 1234 posts Joined 05/08
03 Mar 2016

Take a look in the TPT binary job log at the TWB_STATUS private log:
command: tlogview -j <job-id> -f TWB_STATUS
We provide that data in a fixed type format.
We also publish in the manual (TPT User Guide) the schema for the data in that private log.
If you export that to a file, you will have access to some data items like CPU time, start and end times, and row counts.
That output might be easier to parse to get row counts, than the text in the operator logs.


suhailmemon84 47 posts Joined 09/10
29 Mar 2016

Just had one quick question regarding TPT. In order to read the tpt logs, the only way is to use the tlogview command right?
Is there any setting in TPT that allows it to generate the job log in readable format already (so that we can do a cat or a more on the job log directly) so that we don't have to use the command tlogview to view the job log?

feinholz 1234 posts Joined 05/08
30 Mar 2016

There is no option to TPT to automatically generate a script in readable form.
You must use the tlogview command.
However, we added a way to do that from within a script.
We provide a $JOBID macro so in the script you can use that macro in an execution of the tlogview command (using the OS Command operator) to generate the output.
Just use the concatenation:
'tlogview -j ' || $JOBID || ' -f "*" -g '
(if that is the tlogview command you are trying to execute in order to generate the log)
You can also pass a variable into the script and then redirect the output to a file with that name:
'tlogview -j ' || $JOBID || ' -f "*" -g > ' || @my_output_file


suhailmemon84 47 posts Joined 09/10
31 Mar 2016

Thank you for the info Feinholz.

You must sign in to leave a comment.