Length mismatch

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
sathyak098
Participant
Posts: 23
Joined: Tue May 14, 2013 6:34 am

Length mismatch

Post 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?
rsomiset
Premium Member
Premium Member
Posts: 46
Joined: Fri Sep 21, 2007 7:16 pm

Re: Length mismatch

Post by rsomiset »

Hi,
Please provide few more details like how exactly are you calculating length in DataStage & Unix?

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

Post by ray.wurlod »

Is one of those records the header line and you have "first line is column headings" set?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sathyak098
Participant
Posts: 23
Joined: Tue May 14, 2013 6:34 am

Re: Length mismatch

Post by sathyak098 »

Hi,
I'm using Len(input) function in transformer constraint
sathyak098
Participant
Posts: 23
Joined: Tue May 14, 2013 6:34 am

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is the data type of the final field? If it's VarChar, then a length mismatch will be tolerated.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sathyak098
Participant
Posts: 23
Joined: Tue May 14, 2013 6:34 am

Post by sathyak098 »

Its CHAR(5)
Post Reply