Need to run a Seq withinn another

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Need to run a Seq withinn another

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
shobhit_vk_gupta
Participant
Posts: 14
Joined: Wed May 05, 2010 1:24 am

Re: Need to run a Seq withinn another

Post 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.
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post 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
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

shobhit - That's what I am doing and storing the result in a table.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply