on 07-08-2010 10:43 AM
Hi All,
Is there any way(without using UDFs) that we can concatenate 30 fields and map it to target field? The main challenge is that these fields have to be sent as in fixed length structure.
For Ex:
Assume 'fieldA' needs to occupy first 4 positions in the target field but it comes with length 1. In such a case we need add that many blanks to 'fieldA' and concat.
Please suggest if there's any way(at least in PI 7.1) to handle this without using UDF.
Thanks,
Vishal
This requirement can be achieved without using UDF. Standard graphical mapping will be easy to meet but would become big.
You can fix the length of the field by using the "nameA.fieldFixedLength" in the content conversion tab of File Adapter. Remaining configurations are as usual.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal,
Please see shrutis thread and you have a udf over there. It is a very simple one not a complex one. Take one input str and put the code given. In the udf he is padding up with zeros so instead you need to pad with space. So change only that line to:
str=" "+str;
Rest everything should work for you. Since your input is dynamic we cannot achieve with standard functions.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No this is not possible using std functions. Unless if your source value is fixed.
Consider if fieldA have the value length as 1 or 2 or 3 etc.. Then its not possible to use the Constant (dynamic spaces).
Best Bet is to use UDF
Regards
Ramg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
2 things;
1. this is definitely possible using the standard concat function
2. and obviously a UDF
but since you input is large in number i.e 30 it is ideal to have a UDF instead of building the same logic using a graphical standard function. The reason basically being the readability obviously.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal,
U can do it without udf, may be it will be too lengthy and confusing.
u can first check for the length of each fields , then use a FormatNum to adjust the length and then use the concat function to concat each field.
field1 concat field2 = result1.
result1 concat field3 = result2
continue in tis way.You can also refer the following link,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.