on 07-15-2010 4:16 PM
I have defined the XSD Type (String, Number, Date..) and the length in the DT for the Target message
How do I access this info. in the mapping - so I can fill trailing spaces on String data, and zero-fill on Numeric data on the outbound XML MT ?
Thanks in advance!
Hi Mustafa,
Eventhough you define in xsd in xi it treats them as string. So if for example for a field which is integer of length 10 is there in the target then in your mapping map from source and in the end use FormatNum standard udf with ten zeros in it. So if your source field is 34534 then your output will be 0000034534 and if it character and if you are writing fixed length file then in your output file it will automatically add spaces according to the length. Else you can write a UDF, but the pain here is you have to write for every field.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
Thanks for this info.
Exactly - I am trying to avoid Field length maintenance on every field level mapping.
Currently, I have a HashMap defined as follows..
empFieldLengthsMap = new HashMap();
// emp field lengths
empFieldLengthsMap.put("Record_Type","1");
empFieldLengthsMap.put("Movement_Type","1");
empFieldLengthsMap.put("Company_Code","3");
...
and then a UDF that yields me the size as follows from the map
String out = "";
out = (String) empFieldLengthsMap.get( targetField );
if (out == null || out.equals("") ) {
out = "0";
}
return out;
HOWEVER, I cannot get the target field to input into this UDF! Any ideas?
Mustafa
Edited by: Mustafa Dadawalla on Jul 15, 2010 11:44 AM
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.