How to trap NULL record

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
Ujjwal
Participant
Posts: 4
Joined: Wed May 11, 2005 11:26 pm

How to trap NULL record

Post by Ujjwal »

In some cases when we use FTP to read files, we get a NULL record at the end and hence we get a warning in the log saying record dropped.
But due to this my Sequence job fails as we have condition as status 2 or status = 3 as failure.
How do we trap this NULL RECORD problem

error log msg im getting is

"Trans_crncy,1:Field 'Description' from input dataset-'0' is NULL Record dropped"
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
You can try to preprocess the file and strip off the empty records.

this is do-able via a ds job, using Os commands such as sed (ask you system admins if you need help on the sed command)
or by combining the 2 (like using the filter option of a sequential file stage).

It was also covered before, you can search for the answer using the search utility of this forum.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Ujjwal
Participant
Posts: 4
Joined: Wed May 11, 2005 11:26 pm

Re: How to trap NULL record

Post by Ujjwal »

Ujjwal wrote:In some cases when we use FTP to read files, we get a NULL record at the end and hence we get a warning in the log saying record dropped.
But due to this my Sequence job fails as we have condition as status 2 or status = 3 as failure.
How do we trap this NULL RECORD problem

error log msg im getting is

"Trans_crncy,1:Field 'Description' from input dataset-'0' is NULL Record dropped"

=====================
in order to remove # from src file we are giving condition like first column name[1,1]<>'#' in transformer constraint but it is throwing warning
kindly reply soon treat it as urgent
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Re: How to trap NULL record

Post by meena »

Hi Ujjwal,
Roy is correct, You can use sed command in the DS job. Nor you can write a contraint, saying that the "output stream is not equal to NULL" if you have used a transformer in your DS job.

Meena
Ujjwal wrote:
Ujjwal wrote:In some cases when we use FTP to read files, we get a NULL record at the end and hence we get a warning in the log saying record dropped.
But due to this my Sequence job fails as we have condition as status 2 or status = 3 as failure.
How do we trap this NULL RECORD problem

error log msg im getting is

"Trans_crncy,1:Field 'Description' from input dataset-'0' is NULL Record dropped"

=====================
in order to remove # from src file we are giving condition like first column name[1,1]<>'#' in transformer constraint but it is throwing warning
kindly reply soon treat it as urgent
aramachandra
Participant
Posts: 55
Joined: Tue Sep 20, 2005 10:58 am

Post by aramachandra »

Have you tried to handle the null value by setting the null field value with empty quotes in the extended properties of the column where you have null in the source files.

arvind
Post Reply