Page 1 of 1

Reading the DSJobReport file

Posted: Thu Mar 27, 2008 8:21 am
by Sakthi_Sst
Hi All,

I have used an after Job routine "DSJobReport" to generate the reports.
I have also got a text file with all the information on the file.
But there is some junk characters in between each filed.

So how do i get rid of these junk characters or how do i read this text file in an Sequential stage?

I have attached the report i.e. the contents of the text file along with this post.


**************************************************
STATUS REPORT FOR JOB: Job1
Generated: 2008-03-27 19:36:08
Job start time=2008-03-27 19:35:31
Job end time=2008-03-27 19:36:08
Job elapsed time=00:00:37
Job status=2 (Finished with warnings)
Stage: Sequential_File_0, 4 rows input
Stage start time=2008-03-27 19:35:49, end time=2008-03-27 19:36:04, elapsed=00:00:15
Link: TO_Sort, 4 rows
Stage: Sort_3, 4 rows input
Stage start time=2008-03-27 19:35:49, end time=2008-03-27 19:36:07, elapsed=00:00:18
Link: TO_Sort, 4 rows
Link: TO_Trnsfrmr, 4 rows
Stage: Transformer_6, 4 rows input
Stage start time=2008-03-27 19:35:52, end time=2008-03-27 19:36:07, elapsed=00:00:15
Link: TO_Trnsfrmr, 4 rows
Link: TO_Reject, 2 rows
Link: TO_Target1, 2 rows
Stage: Reject, 2 rows input
Stage start time=2008-03-27 19:35:52, end time=2008-03-27 19:36:07, elapsed=00:00:15
Link: TO_Reject, 2 rows
Stage: Target, 2 rows input
Stage start time=2008-03-27 19:35:52, end time=2008-03-27 19:36:07, elapsed=00:00:15
Link: TO_Target1, 2 rows

Posted: Thu Mar 27, 2008 8:39 am
by kumar_s
What do you think is Junk in about report??

Posted: Thu Mar 27, 2008 5:34 pm
by ray.wurlod
I don't see any junk.

Do you mean line terminators?
These are converted to field marks (@FM) when the file is loaded into a string, so that there's a consistent interface whether the operating system is UNIX (single-character line terminators) or Windows (dual-character line terminators).

Posted: Thu Mar 27, 2008 8:12 pm
by kduke
Why not use

dsjob -report XML Project Job

Posted: Thu Mar 27, 2008 11:13 pm
by Sakthi_Sst
Hi All,

1.When I copy it and paste it over here it doesn't show up that character.
But in the text file file which is created there is a character which is at the beginning and at the end of every field.

2.I n't sure whether it is a Line teriminator.

3. When I change the delimiters to none in the Sequential stage,I can read the file, but as a single field.

How do I read the single field as different fileds of the text file and load it in to a table?

Requirement :
Read the report file and load it into a table, fields such as Job start time.Job end time,Job name,Job status.......

Posted: Thu Mar 27, 2008 11:56 pm
by ray.wurlod
Use @FM system variable as the delimiter character for the Field() function.

Posted: Thu Mar 27, 2008 11:57 pm
by ray.wurlod
Use @FM system variable as the delimiter character for the Field() function.

Posted: Sat Mar 29, 2008 12:09 am
by kduke
Why not download EtlStats. It does this for you.

Posted: Tue Apr 01, 2008 12:30 am
by Sakthi_Sst
Ray,


Where exactly do I use this @FM variable.

Is it at the field propeties do I type " @FM " ?

or in Format -> field delimiter ?

Kindly let me know about this.

Posted: Tue Apr 01, 2008 12:36 am
by ray.wurlod
Field(Name.$CommandOutput, @FM, 2, 1) returns the second line of the command output from the Execute Command activity called Name.

Posted: Tue Apr 01, 2008 6:10 am
by Sakthi_Sst
Ray,

I really do not get this workaround.
Can you kindly explain me in detail.
Should I use an Exec activity to read this file?