Page 1 of 1

Need to run a Seq withinn another

Posted: Wed Jun 13, 2012 4:04 pm
by kaps
I am trying to collect the Job Status of (say) Job1 like Job start time, end time, run status etc and I built a reusable job (say) Job2 for this purpose.

Question is that I want to run the Job2 when Job1 finishes successfully as well as when it fails. What I can do is that, Create another sequence job (say) Job3 which would have Job1 and Job2 where Job2 runs unconditionally after Job1. But I am wondering if there is a better approach :-)

Thanks for your time

Posted: Wed Jun 13, 2012 4:35 pm
by ray.wurlod
Why not just have DataStage collect operational metadata automatically?

If you're on version 8.7 or later, you can use the Operations Console to keep a history and watch trends.

Re: Need to run a Seq withinn another

Posted: Thu Jun 14, 2012 7:54 am
by shobhit_vk_gupta
Hi,

Just simple do following steps in command prompt and prepare a UNIX script so that it gets automated:
1)cd `cat /.dshome`
2)cd bin
3)dsjob -report project_name job1

The output of step 3 will give you the result.

Posted: Thu Jun 14, 2012 8:29 am
by kaps
Ray - We are on 8.7 but we would like to store this data in a table and in addition to that we are also storing cycle date and the table name on this table so that users can query this table to find out how current is the data in a table. I believe operations console gives more detail level job information which may be confusing to business users but if there is a way I can access the table(s) behind operation console it would be great.

Thanks

Posted: Thu Jun 14, 2012 8:31 am
by kaps
shobhit - That's what I am doing and storing the result in a table.

Posted: Thu Jun 14, 2012 4:14 pm
by ray.wurlod
8.7 Operations Console also relies on the process metadata being stored in a table. When setting it up you create a database schema called DSODB. This is open and documented. So you could create appropriate views on it for your users - or show them just the pictures from Operations Console!

Posted: Thu Jun 14, 2012 9:33 pm
by vamsi.4a6
kaps wrote:shobhit - That's what I am doing and storing the result in a table.
@kaps
1)cd `cat /.dshome`
2)cd bin
3)dsjob -report project_name job1

when i run above commands i am getting following output for a particular Job

STATUS REPORT FOR JOB: Test_Seq
Generated: 2012-06-15 05:28:24
Job start time=2012-06-08 08:36:14
Job end time=2012-06-08 08:36:18
Job elapsed time=00:00:04
Job status=1 (Finished OK)
Status code = 0


I want to load above information in a table and table is having 5 coulms(Generated,Job_start_time,Job_end_time,Job_status and Job_elapsed_time)


The problem is If i am able to write this information into a delimited file i can load into a table.could anybody please help on this to write this information into a delimited file to load into target table?

Posted: Thu Jun 14, 2012 10:51 pm
by chulett
Script the report generation and save the output to a tmp file. Collect the information you need for each column via standard UNIX functions like grep and cut. You can then echo them out with your delimiter of choice to a flat file.

Posted: Fri Jun 15, 2012 12:47 am
by vamsi.4a6
Thanks for the reply.I got the required output Just want to know is there anyway to get the Information like who created the Job and who run the Job .

I do not have access to Metadatarepositary tables like DS_JObs etc from command line and Administrator.I want to include those details also in the Target table?

Posted: Fri Jun 15, 2012 5:51 am
by ray.wurlod
vamsi.4a6 wrote:I do not have access to Metadatarepositary tables like DS_JObs etc from command line and Administrator
Yes you do.