cancel
Showing results for 
Search instead for 
Did you mean: 

Fixed Length File - Space needs to be filled for blank fields

Former Member
0 Kudos

Hi Guys,

               I am generating fixed length file.

When a field is has no value, I need to fill spaces in the output file.

Instead PI skipping the blank fields, so the fixed length file is not quite right.

Thanks

Sam

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

If you are using fieldFixedLengths and fieldSeparator, then the spaces should have been added for the blank fields. Can you please let us know, what exactly the parameters you are using.

Thanks & Regards,

Samir

Former Member
0 Kudos

Hi,

      I am using fieldFixedLengths, fixedLengthTooShortHandling and

fieldSeparator.

I am also using MapWithDefault node in the message mapping.

But I am getting "Constant" string for the empty fields in the output file.

Here is the output file


0090417724  0030300001          Pharmacy - Ship To        PO Box 5515, Mission Bay              Constant                                Constant                                Auckland      

Here is my mapping..

baskar_gopalakrishnan2
Active Contributor
0 Kudos

I think you can achieve either using mapwithdefault or  constant function. If you use constant function  then  enter  empty string quote "    " over there.

Former Member
0 Kudos

Hi Sam,

add mapWithDefault box in message mapping. Then double click the box, delete the string "Constant". keep it blank here. It is used to create the filed in target structure, so in FCC, it would not skipped.

In FCC, if the length is less than given length. space would be added after the string as default.

Hope it would help for you.

Regards,

Kevin Song.

Former Member
0 Kudos

mapwithdefault and put space as per length required , i.e 2 length required then put 2 space.

santosh_k3
Active Participant
0 Kudos

Hi Sam,

>>But I am getting "Constant" string for the empty fields in the output file.

Double click the Constant function in mapping and delete the  string "constant"  and keep it as empty in the constant function.

>>  I am using fieldFixedLengths, fixedLengthTooShortHandling and

fieldSeparator.

There is no need to specify fieldSeparator when you have already specified fieldFixedLengths.

But by seeing the Output file i think your requirement is get the horizontal tab after every fieldFixedLenghts

if that is the case what you have specified is correct.

One more thing there is no need to specify the fieldNames in the Receiver comm channel

remove the fieldName parameter from the FCC.

I hope now you will get the required output.

Thanks

Sai


santosh_k3
Active Participant
0 Kudos

Hi Sam,

One more way is to simply assign the target fields with the constant in mapping .

Then in the  receiver comm channel specify the RecordStructures

and in parameters

Ex:

RecordStructureName.fieldFixedLengths :  1,5 3

RecordStructureName.fixedLengthTooShortHandling : ignore

So even if the source fields has no value the output file will contain spaces(1,5,3) for Target fields.

Thanks

Sai

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

You should be able to handle this in mapping e.g by using the node function called mapWithDefault.

Regards,

Mark