Page 1 of 1

Complex Flat File trimming trailing blanks

Posted: Mon Aug 28, 2017 4:08 am
by jcronje69
Hi

I use CFF (Complex Flat File) to populate a MS SQL DB with hundreds of CFF files. The issue I have is that the CFF use a Character native data type for string values and the trailing blanks are not trimmed automatically.
Options I have is to use the Datastage TRIM function or set ANSI_PADDING OFF on the MS SQL table. There are too many columns to implement the TRIM function. The ANSI_PADDING OFF setting is set to be discontinued for future SQL Server releases.

Any other option I can use?

thank you
Jaco

Posted: Mon Aug 28, 2017 4:08 pm
by ray.wurlod
Welcome aboard.

Using a Transformer stage, select all the columns that need to be trimmed, right click, and choose Derivation Substitution from the menu. Type Trim($1) into the expression field. All done.

Posted: Mon Aug 28, 2017 8:59 pm
by chulett
Just make sure you are trimming into a "varchar" rather than a character field.

Posted: Tue Aug 29, 2017 11:50 pm
by jcronje69
thank you, nice to be on-board
that's an easy enough solution
thank you kindly