cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion: Target Field is optional

Former Member
0 Kudos

I am using FCC in receiver file adapter.

My file is getting generated.

In target structure one field is optional and hence target xml element doesnt have value. hence that field is not there in txt file. with this what happens next subsequent field gets shifted to my optional field place and then i get error field length is not correct.

I want to put 2 spaces if that optional field length is 2 char and then there should be field separator(space) and the subsequent column.

I am already giving fixedfieldlegnth of all the fields.

Pl can anyone suggest how to do this.

thanks,

sharada

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Sharada,

Anyway you have a field seperator and fixed field length options set on the FCC parameter list.

So what you have to do is just map your source field like this <b>SRC FLD -> [MapWithDefault (Def. value SPACE)]-> TRGT FLD</b>, this will ensure the occurance of this TRGT fld and other FCC options like FixedFieldLength and FieldSeperator will work normally and it will keep rest of the fileds in their correct position.

Regards,

Ananth

Former Member
0 Kudos

Hi Sharada,

Do your normal mapping to the target field that is optional.

Use a If function before mapping the field.

Check if the node is created in usual mapping, else map a constant with 2 spaces.

DO something like this:

Mapping ----------------> 
                           equalsS ----> if
constant(empty Value)--->
                  constant(2 spaces)--> then -> tgtField

                   Mapping -----------> else    

regards,

P.Venkat

Former Member
0 Kudos

Hi,

Is it alright if, in the target message,an empty xml tag is created?

i.e , if there is no field in the source, a dummy <field></field> will be create in the target without any value in it.

If this is ok, then you could use message mapping to solve this.

if <field> exists -> then-> map to -


> <Tfield> else map---> " " to <Tfield>

In content conversion use <b>fieldFixedLengths</b>with a value 0

Regards,

Smitha.

Former Member
0 Kudos

Hi Sharada,

In message mapping, check for the existance of target field. If the field doesnt exist, then map a constant of 2 spaces to the target field.

This way you wont get subsequent fields shifted to the optional field.

Regards,

Uma

Former Member
0 Kudos

Pl canone suggest on this

thanks,

Sharada