Page 1 of 1

mapping higher to lower length transformer

Posted: Mon May 27, 2013 7:15 am
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.

Posted: Mon May 27, 2013 10:03 am
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.

Posted: Mon May 27, 2013 10:19 am
by eph
Hi,

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

Eric

Posted: Tue May 28, 2013 1:50 am
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.

Posted: Tue May 28, 2013 2:54 am
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.

Posted: Tue May 28, 2013 5:30 am
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

Posted: Tue May 28, 2013 6:24 am
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.

Posted: Tue May 28, 2013 8:03 am
by eph
You are right, I really need to fix that 2days long headache.... Deepest apologies :?

Eric