on 05-28-2010 5:49 AM
Hi All,
I searched for this problem on SDN and tried all provided solution.
But it still doesnt work.
I am doing FIX lenght conversion and need blanks at the end of each line to keep the field length equal.
I have given my FCC parameters as
Recordset structure.-- Region
Region.fieldNames BZIRK,BZTXT,BLANK
Region.fieldFixedLengths 5,26,25
Region.fixedLengthTooShortHandling ignore
Region.fieldContentFormatting nothing,nothing,nothing
Region.endSeparator 'nl'
But it still trims all the trailing spacse.
Please help.
Regards,
Nidhi
Is this issue resolved? I need to have blank spaces at end of each line in a fixed length file. In payload using view source I can see spaces in XML. But when creating text file spaces at the end of each line are truncated.
This is at Receiver file adapter.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for debugging u try passing some value into the BLANK field to see if its getting created ..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nidhi ,
One option is to set the length in the message mapping for each output field .
Write a udf with 2 parameters as input . One is the value that goes to the output field and other the max length that it should have ...
addSpaces( var, maxLength)
{
String output =var ;
while( var.length()<maxlength)
{
output = output +" ";
}
}
if the length is greater than the maxLength allowed also do a subString in the udf..
Edited by: Rahul Thunoli on May 28, 2010 2:16 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rahul,
Thanks for your reply...
Have a look at my input file thought its a text file m giving you XML so that u can read it better.
So I just want this Blank field to be unaltered.How to acheive this .
<ns0:MT_Region ">
<Region>
<BZIRK>0002</BZIRK>
<BZTXT>Southern region00000 </BZTXT>
<BLANK> </BLANK>
</Region>
<Region>
<BZIRK>NTRE</BZIRK>
<BZTXT>Lower North Island0000000</BZTXT>
<BLANK> </BLANK>
</Region>
</ns0:MT_Region>
Regards,
Nidhi
don't include to the fixedfieldtooshorthandling parameter in the communication channel . And like is aid before set the length for the Blank in the message mapping .. or if you are always going to pass a string of spaces just map a constant with a string of spaces to the field BLANK . Make sure you enter the do fieldFixedlengths in the communication channel .
>
> This also does nt work
How are you viewing the file....some editors wont show you the spaces.
In one the threads it was mentioned that due a space after g in fieldContentFormatting the spaces were not retained....check i something similar (space or other character) is present in your config....also recheck that you have maintained proper names with proper case.
Edited by: abhishek salvi on May 28, 2010 1:50 PM
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.