Let us consider the example that you posted here…
var1=AAA; var2=BBB; var3=" " ; var4=DDD
and var1Length=3; var2Length=5; var3Length=5; var4Length=3
In fixed length flatfile, record length is required… In this case, the record length is 16…
Using wm flatfile package, Fixed Length flatfile can be created… But not with delimiters…
Case I: Normal Fixed Length Flatfile without delimiters
Create dictionary - Field definition with positions starting from 0
In schema, set the dictionary through Properties window…
Select the Record parser as Delimiter and Record separater as New Line…
This brings an output like this for an input of 3 records…
AAABBB DDD
AAABBB DDD
AAABBB DDD
Case II: Fixed Length flatfile with delimiters
If you wanna output like AAA|BBB | |DDD, the record length is going to change… ie., 16+3 = 19 where | symbols are also considered as some fields… Different approach is required to achieve this…
- Create dictionary
RecordName
field1 0-4
field2 4-5 (This is for delimiters. While mapping other variables, hardcode it to |)
field3 5-10
field4 10-11 (delimiter)
field5 11-16
field6 16-17 (delimiter)
field7 17-20
- Create schema
Choose Delimiter option
Record Separater as New Line character
In the flatfile tab, set the dictionary through Properties
This brings an output like below
AAA |BBB | |DDD
AAA |BBB | |DDD
AAA |BBB | |DDD
There may be different way also… Others can suggest their views…
-Senthil
#webMethods#Integration-Server-and-ESB#B2B-Integration