Page 1 of 1

Length mismatch

Posted: Mon Jun 10, 2013 6:15 am
by sathyak098
Hi,

My file has records of length 100 bytes and it is fixed width.
I need to reject record if it does not have actul length.
In transformer constraint, Im checking the length of the record.
If it equals to 100, then sending to target, else sending to reject file.

I have 2 records which is having length less than actual in source file.ie., 98 bytes.However, when I run the job, only one record got rejected.

in unix when I checked length of 2 records, its giving 98 bytes.
In job, rejected record giving length of 99 bytes and the other record(which is expected to be rejected) showing length of 100 bytes.

Can anyone help me, why both the records are not rejected and why mismatch in length of unix and datastage?

Re: Length mismatch

Posted: Mon Jun 10, 2013 11:43 am
by rsomiset
Hi,
Please provide few more details like how exactly are you calculating length in DataStage & Unix?

--
Rajesh

Posted: Mon Jun 10, 2013 3:02 pm
by ray.wurlod
Is one of those records the header line and you have "first line is column headings" set?

Re: Length mismatch

Posted: Tue Jun 11, 2013 12:35 am
by sathyak098
Hi,
I'm using Len(input) function in transformer constraint

Posted: Tue Jun 11, 2013 12:38 am
by sathyak098
Hi Ray,

These 2 records are coming in the middle and as I dont have column names in file, i set below propery as false.

Posted: Tue Jun 11, 2013 3:02 am
by ray.wurlod
What is the data type of the final field? If it's VarChar, then a length mismatch will be tolerated.

Posted: Tue Jun 11, 2013 3:59 am
by sathyak098
Its CHAR(5)