cancel
Showing results for 
Search instead for 
Did you mean: 

FCC issue

Former Member
0 Kudos

All,

I want to write a file with its maximum length..lets say if my output is having only one char(1),but its max length is 15,,i want to have 14 spaces and and 1.

am using following parameters.

XML.fieldNames

XML.fieldFixedLengths

XML.fixedLengthTooShortHandling-Cut

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

When you specify

XML.fieldFixedLengths - 15

XML.fixedLengthTooShortHandling-Cut

u ll get 14 spaces when input is 1 char.

No need of a UDF.

Former Member
0 Kudos

XML.fixedLengthTooShortHandling-Cut is used when length of element exceeds than that defined in fieldFixedLengths

If your value is of length 1 and maxlength in fieldFixedLengths is 15 then you need to pad this value with leading spaces in mapping

in mapping use UDF, if length is < 15 then

lengthDiff = maxLength - strLength;
	 				
for(int cnt=0;cnt<lengthDiff;cnt++){
	strInput = " "+strInput;  
}
return strInput;

Pass input string as parameter to this UDF

Former Member
0 Kudos

Hi ,

The parameters you are using are sufficient for the required output with blank spaces of 14....

Thanks

Swarup