WmFlatFile Questions

I am trying to use WmFlatFile to parse a string that is coming from a Websphere MQ Queue. The string on the queue represents a cobol copybook. I can get this to work if the data structure is very simple. It seems to fall down when the cobol copybook has re-occuring records inside of it. For those of you that know cobol, it has occurs clauses. Here is a simple example of what I am talking about. The following is an example of data that would need to be parsed by the WmFlatFile.

Joe Smith Chicago ILNew York NYMiami FL
John Doe Seatle WALuverne MN

This represents 2 messages that are put on the queue with the following structure.

FirstName 5 bytes
LastName 10 bytes
City 10 bytes (can occur up to 3 times)
State 2 bytes (can occur up to 3 times)

This is a very simple example. In real life there are multiple occurs clauses in each copybook. There are also no record identifiers either. I’m just trying to figure out if I am missing something or if the WmFlatFile will not support this.

Thanks for any suggestions.


Try this if it works

Create Delimiter based FFSchema with record parser=newline

RecordDefinition:recordWithNoID(set properties maxRepeat=unlimited)
FieldDefinitions(FirstName)fixedlength (specify start,end pos),
LastName) select fixedlength (specify start,end pos)
Since you know city,state can occur max 3times
City1,fixedlength (specify start,end pos),
State1,fixedlength (specify start,end pos),
City2,fixedlength (specify start,end pos),
State2,fixedlength (specify start,end pos),
City3,fixedlength (specify start,end pos),
State3fixedlength (specify start,end pos),

Please make sure the fields start/end positions given correctly otherwise it will fail in parsing.Test your schema against your sample file.


Thanks for the suggestion. I am sure that will work, but I am trying to figure out if I have any options that would avoid creating an entry for each possible piece of the re-occuring values. Some of the actual occurs clauses could have 50+ occurances with 15+ fields. It would be nice to just define the record structure and tell the WmFlatFile stuff that it re-occurs multiple times.

Then you might consider creating composite fields for re-occurs stuff.
If record iterates then its not a big deal,problem will be with fields repeats and try using composites and test your file.


I tried using a composite but it doesn’t seem to be working quite right. If I create the composite in the Dictionary, I can not change the value of the Fixed Position Start and End for the fields inside the composite each time that I want to use it. For example I define a field in the composite to have a start value of 5 and an end value of 10. That works fine for the first time I use it, but I will need these values to change on subsequent uses of the composite. Let me know if this is expected behavior. Thanks!!!


I have to deal with exactly the same problematic.

Did you find any solution to your problem?



Yes, You must first parse the initial record structure and leave the re-occuring field as a string. Then define the structure of the re-occuring field and pass in the string and have it parsed. Let me know if this helps or if you need additional information.

Do you mean you have 2 FF schema. 1st one for the constant part (without re-occuring field)
and 2nd one for the variable part?
Is that the case who structured is the 2nd one?