mapping higher to lower length transformer

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
Poovalingam
Participant
Posts: 111
Joined: Mon Nov 30, 2009 7:21 am
Location: Bangalore

mapping higher to lower length transformer

Post by Poovalingam »

Hi,
I'm mapping varchar18 to varchar(15) in transformer stage. I'm not using substring here. I'm just doing direct mapping. I have data in length 18 from source. I expected warning in data stage log and this record will get dropped and the job status will be finished with warnings. But it doesn't throw any warning. Transformer stage passed first 15 characters only to target and job status is finished. Is this actual behavior of transformer stage? Do I need to set any environment variable to raise warning and make the record to get dropped from transformer stage?
Thanks,
Poovalingam.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

There is no variable or setting you can change to make DataStage warn you automatically when you explicitly change to a smaller length.

You can of course program a transform stage to reject and output a warning to the log file when this happens.
eph
Premium Member
Premium Member
Posts: 110
Joined: Mon Oct 18, 2010 10:25 am

Post by eph »

Hi,

You may try the APT_IMPORT_REJECT_STRING_FIELD_OVERRUNS environment variable (ibm doc).

Eric
Poovalingam
Participant
Posts: 111
Joined: Mon Nov 30, 2009 7:21 am
Location: Bangalore

Post by Poovalingam »

I tried using APT_IMPORT_REJECT_STRING_FIELD_OVERRUNS as True. I think it's not working. The records are not dropped even after setting the apt variable. I took a reject link from transformer. Still it went to output stream only.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code it yourself. Use a constraint expression such as

Code: Select all

Len(InLink.TheString) <= 15
Use an Otherwise/Log output link to capture the too-long strings.

If you want to generate a warning, you can create a routine that passes its argument through unchanged but called DSLogWarn() in its code.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
eph
Premium Member
Premium Member
Posts: 110
Joined: Mon Oct 18, 2010 10:25 am

Post by eph »

That's strange, according to this technote, the env variable should work on all DS versions : http://www-01.ibm.com/support/docview.w ... wg21586920

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

Post by chulett »

It says "APT_IMPORT..." which could imply it only works in the Sequential File stage rather than a Transformer. And I see your TechNote notes the same thing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eph
Premium Member
Premium Member
Posts: 110
Joined: Mon Oct 18, 2010 10:25 am

Post by eph »

You are right, I really need to fix that 2days long headache.... Deepest apologies :?

Eric
Post Reply