Creating a text file through Job control code

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Deepakinstyle
Participant
Posts: 47
Joined: Wed Apr 18, 2007 4:49 am

Creating a text file through Job control code

Post by Deepakinstyle »

Hi all,
I have 4 jobs,which should run after one another in the sequence.
i decided to achieve it through job control.
Now my requirement is like:

when run the job control job..
if the first job in the job control Status ='Run failed' or Status ='Crashed'
then i need to create sequential file with the status,error-description,elapsed time for job included in it.

In the same sequential file will be created for all jobs in the sequence if they all fails.

Any help is, appreciated
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Write a routine which will write these details into your error file and pass the failed job name as parameter. In the routine fetch the job information with DSGetJobInfo. DSJ_JOBSTATUS and DSJ_JOBELAPSED will give you status and elapsed time. All the jobs which fails can call the same routine for error logging.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Deepakinstyle
Participant
Posts: 47
Joined: Wed Apr 18, 2007 4:49 am

Post by Deepakinstyle »

JoshGeorge wrote:Write a routine which will write these details into your error file and pass the failed job name as parameter. In the routine fetch the job information with DSGetJobInfo. DSJ_JOBSTATUS and DSJ_JOBELAPSED will give you status and elapsed time. All the jobs which fails can call the same routine for error logging.

Hi JoshGeorge,
That was fine.
But actually i want my Text file to be created in a particular directory/filename. Now the point is where should i specify these filename and directory path stuff.I tried this one with the basic function DSMakejob & dsjobreport. But i was unable to create it to the particular location.Hope you got my point.

Thanks,
Deepak
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

You can define the file name and file paths as Arguements in your routine. The output from the DSMakejob & dsjobreport can then be directed to this file.

Check out the DSJobReport routine code -available as a Built-in After/Before Job sub routine in DataStage - to get an idea.

Aneesh
Post Reply