Required fields?

111 views
Skip to first unread message

glag...@gmail.com

unread,
Apr 17, 2016, 8:54:23 PM4/17/16
to COZYROC
I'm getting this error, the 4th field is situational and does not appear in my test file, I was under the impression that by default all fields set to required = false so i thought it would not throw an exception.  What am I doing wrong, this is my first test with Cozyroc.


[835 [2]] Error: CozyRoc.EDI.EDIParseException: EDI message processing failed [PD 835][1.0].  Segment [TRN] expected to contain 4 fields.  Actually contains 3 fields (not including segment code). Currently at segment number 5 - TRN*1*914044556504552*1066044592~
.
   at CozyRoc.EDI.EDIParser.assertFieldsOK(String[] currentSegmentFields, segment segment)
   at CozyRoc.EDI.EDIParser.mapFields(String[] currentSegmentFields, segment segment)
   at CozyRoc.EDI.EDIParser.mapSegment(String[] currentSegmentFields, segment expectedSegment)
   at CozyRoc.EDI.EDIParser.mapSegments(segment[] expectedSegments)
   at CozyRoc.EDI.EDIParser.mapSegment(String[] currentSegmentFields, segment expectedSegment)
   at CozyRoc.EDI.EDIParser.mapSegments(segment[] expectedSegments)
   at CozyRoc.EDI.EDIParser.parse(Stream ediInputSource)
   at CozyRoc.SqlServer.SSIS.EDISource.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
   at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper100 wrapper, Int32 outputs, Int32[] outputIDs, IDTSBuffer100[] buffers, IntPtr ppBufferWirePacket)

Ivan Peev

unread,
Apr 17, 2016, 8:58:11 PM4/17/16
to COZYROC
Hi Gary,

Your impression is incorrect. All fields a required by default. You have to explicitly define a field as optional.

gary lagace

unread,
Apr 18, 2016, 8:07:54 AM4/18/16
to COZYROC
Thanks Ivan,

I will set each of the field attributes as needed, but I got this information from the configuration web page.


xmltag Name of the field.
truncatable When set to true, the parser will not generate errors when the field does not contain trailing components or sub-components which are not required.
required Specifies whether or not the field is required. By default it is set to false indicating the field is not required.

gary lagace

unread,
Apr 18, 2016, 8:16:14 AM4/18/16
to COZYROC
I made the change and I'm still getting the same error, here is the TRN config section.

      <medi:segment segcode="TRN" xmltag="REASSOCIATION TRACE NUMBER">
        <medi:field xmltag="TRN01 481 Trace Type Code" />
        <medi:field xmltag="TRNO2 127 REFERENCE IDENTIFICATION" />
        <medi:field xmltag="TRNO3 509 ORIGINATING COMPANY IDENTIFIER" />
        <medi:field xmltag="TRNO4 127 Originating Company Supplemental Code" required="false"/>
      </medi:segment>

Ivan Peev

unread,
Apr 18, 2016, 11:59:44 AM4/18/16
to COZYROC
Gary,

You have to also define truncatable="true" attribute on the TRN segment element.

gary lagace

unread,
Apr 18, 2016, 12:15:10 PM4/18/16
to COZYROC
I have done that and I still get the same error.

835.xml

Ivan Peev

unread,
Apr 18, 2016, 12:22:06 PM4/18/16
to COZYROC
Gary,

Did you reload the config after you've made the change?

gary lagace

unread,
Apr 18, 2016, 1:14:54 PM4/18/16
to COZYROC
yes
Reply all
Reply to author
Forward
0 new messages