Page 1 of 1

Integers in fixedWidthfile

Posted: Mon Feb 25, 2008 9:41 am
by dodda
Hello

I have fixed with file as source in which there were couple of fields which were defined as Integer datatypes and right justified with leading spaces. Is it a common practice to have integer values as right justified. If i want to make the integers as left justified in the target file, is there a function in the transfomer that i can use?

Appreciate your help

Regards

Posted: Mon Feb 25, 2008 10:05 am
by ArndW
Justification only applies to text fields. In order to left just try:

Code: Select all

Right(Space(MaxLen):TRIM(In.column),MaxLen
where MaxLen is the length of your left-padded string and In.Column is the text right-padded input column.

Posted: Mon Feb 25, 2008 10:13 am
by Raamc
You can also use the following code..
Space(maxlength-Trim(In.column)):In.column
:wink:

Posted: Mon Feb 25, 2008 3:49 pm
by ray.wurlod
It IS common practice that integers are right justified, sometimes left padded with space, sometimes left padded with zeroes.

You can handle it easily with Trim().