DRS Stage not returning DBMS Code

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rachitha
Participant
Posts: 30
Joined: Wed Jun 28, 2006 10:53 am

DRS Stage not returning DBMS Code

Post by rachitha »

Hi,

I am using DRS Stage as target in my job. Am not able to get DBMS code for rejected rows using <linkname.DBMSCODE>.

If target is ODBC Stage then its returning DBMS Code.Please let me know how to get DBMSCODE for DRS Stage.

FYI: Our requirement is to use DRS Stage.

Thanks,
Rachitha.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Unfortunately, not all stages return all possible return variables.

:idea: If you've already found the DRS stage doesn't return values that you need, don't use it. If you are using ODBC and it works, why 'require' the use of the DRS stage? Push back.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rachitha
Participant
Posts: 30
Joined: Wed Jun 28, 2006 10:53 am

DRS Stage not returning DBMS Code

Post by rachitha »

Hi,

<outputlink.LASTERR> works with DRS Stage. But we are getting message as "Row Rejected" for all failure cases like primary key violation, datatype mismatch,null value rejection,etc.

Please let me know how to get appropriate error message.

Thanks,
Rachitha
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Define 'appropriate'. Do you plan on doing something different in your job (other than simply reject errors) based on the type of error?

Typically, you would endevour to craft your job such that the errors you listed would never happen. I personally would consider any of these errors 'fatal' and require the job to be corrected such that it could not happen - they're not something I'd want to capture and be able to use in any sense downstream from the job. But that's just me.

In your reject link, include all of the variables available. Build some test cases to cause all of the situations you are interested in capturing and see which variables are populated / usable.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rachitha
Participant
Posts: 30
Joined: Wed Jun 28, 2006 10:53 am

DRS Stage not returning DBMS Code

Post by rachitha »

For each input record we are getting four warnings in director as mentioned below:

1.Violation of PRIMARY KEY constraint 'PK_LU_COMMODITY_SUB_CLASS'. Cannot insert duplicate key in object 'LU_COMMODITY_SUB_CLASS'.

2.The statement has been terminated.

3.Job_Dim_Commodity_Sub_Class..Xfm_ST_F0005_Lu_Commodity_Sub_Class: COMMODITY_SUB_CLASS_SRCCD = SRP COMMODITY_SUB_CLASS_DESC = DRINK SYRUPS - WB

4.At row 122, link "Out_Xfm_ST_F0005_Lu_Commodity_Sub_Class"
Row rejected.

Please let me know how to retrieve 1st warning message using target as DRS stage.

Using <outputlink.LASTERR> we are getting 4th warning message.

Thanks,
Rachitha.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I already explained how you can find out what information you can capture in the DRS stage. If that's not sufficient to your needs, then other approaches need to be considered.

Sometimes the detailed information you are seeking is only available in the job's log after the job completes. This means building standard jobs / routines / shell scripts to 'farm' the logs post job to get the information that you need. The concepts have been discussed here a number of times, searching should turn something up if you look for keywords like DSGetLog or -lognewest / -logdetail for example.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply