HOW TO CAPTURE DATABASE CONNECTION ERROR

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
ketanshah123
Participant
Posts: 88
Joined: Wed Apr 05, 2006 1:04 am

HOW TO CAPTURE DATABASE CONNECTION ERROR

Post by ketanshah123 »

HI ALL
m CREATING A JOB WHICH WILL ACCESS A STORED PROCEDURE
BUT BEFORE ACCESSING STORED PROCEDURE HAVE TO CHECK WHETHER CONEECTION WITH DATBASE IS SUCCESSFUL OR NOT ?

CURRENTLY I HAD IMPLEMENTED THE JOB AS
STORED PROCEDURE STAGE -------->SEQUETIAL FILE STAGE

THE SEQUENTIAL FILE STAGE IS TO CAPTURE THE ERROR CODE RETURN BY STORED PROCEDURE AND M USING DB2 UDB ON AIX (OS)

SO PLZ SUGGEST HOW TO CHECK DATABASE CONECTION SUCCES ?
OR ANY OTHER WAY TO THIS JOB.......
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can have a seperate job prior to the job using the stored procedure.
Have a DB stage ( whichever one you are using ) point to a transformer and then to a flat file.
In the DB stage enter a custom sql - select 1 from dual. Give the condition in the transformer and according to your requirements write into the flat file the result.
On top of that you can have another job to read the result and progress accordingly or have a job control script read the result from the file.
IHTH.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

FYI - Typing in all caps is fine for a COBOL program, but on the web it is considered SHOUTING. Please use your 'inside voice' here. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Hi,

When a server job is validated,

Connections are made to the data sources or data warehouse
without actually extracting, converting, or writing data

i think you can use validate to solve you problem.


Thanks,
Anupam
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You marked your job type as "parallel" but posted your question in the server forum. Which is the correct job type?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ketanshah123
Participant
Posts: 88
Joined: Wed Apr 05, 2006 1:04 am

Post by ketanshah123 »

hi
the job is of parallel type..........
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your original approach is the most sound. Create a small job that runs a simple query, and detect the error information in that. You can use a Routine that inspects its log, or you can use link variables in the job itself.

This is run in a job sequence that decides whether to run the main job depending on whether the first connection was successful.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ketanshah123
Participant
Posts: 88
Joined: Wed Apr 05, 2006 1:04 am

Post by ketanshah123 »

hi ray ,
as m new to this tool can you tell me how to caputre the error return by querry or use link var, or routine that inspects the log.......

Is anyway it is possible to include / import log generated by DS Director to a text file so that I can attach that in mail.Though I am including job status in mail but its not much explainatory to detect exact reason for failure compared to one generated by DS Director.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

ketanshah123 wrote:as m new to this tool can you tell me how to caputre the error return by querry or use link var, or routine that inspects the log.......
Is anyway it is possible to include / import log generated by DS Director to a text file so that I can attach that in mail.Though I am including job status in mail but its not much explainatory to detect exact reason for failure compared to one generated by DS Director.
You can write a routine that uses the DSGetLog... functions to interrogate the log. While interrogating, your routine can also write whatever you like into a text file (search for OpenSeq and WriteSeq commands), and this can be attached to any email.
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