I am trying to create a output file schema which should be of the below format.
MEMBER,1,134,134,Jo, ,Arch,1,S,M
BENEFIT,1,M,1,89,7,1,1,20110101,20120731,11
BENEFIT,1,D,2,89,3,11,5,20110101,20120731,16
MEMBER,14,448,448,Cli,M,Ast,1,M,M
BENEFIT,14,D,2,89,3,11,5,20170101,17000101,16
BENEFIT,14,M,1,89,7,1,1,20170101,17000101,11
BENEFIT,14,M,1,89,7,1,1,20150101,20161231,11
So in the Flat File schema, should I create two records one for the Member (with one as the Max Occur) and One for Benefit (max occur to unbounded)?
Am I doing it right
Does your input XML message contain multiple Members?
If so you will want to add a Sequence Group with a Max Occurs set to either the maximum number of Members or Unbounded. And then yes, Member = 1 and Benefit unbounded.
Also you should be using tag identifiers in Member and Benefit set to MEMBER and BENEFIT respectively, so if you ever have to use the schema to parse the file you can do so successfully.
Schema for reference
Note: If you do use Tag Identifier you will either have to change the Child order to Prefix, or include the first coma in the Tag Identifier and keep it Infix.