Component Element Separator showing ">" instead of "\"

Post author
Tremor Olaes

Code looks like this:

 

var isa = new ISA();

isa.AcknowledgementRequested_14 = "0";
isa.AuthorizationInformation_2 = " ";
isa.AuthorizationInformationQualifier_1 = "00";
isa.ComponentElementSeparator_16 = @"\";
isa.InterchangeControlNumber_13 = "100000567";
isa.InterchangeControlStandardsIdentifier_11 = "U";
isa.InterchangeControlVersionNumber_12 = "00401";
isa.InterchangeDate_9 = DateTime.Now.ToString("yyMMdd");
isa.InterchangeReceiverID_8 = receiver_id;
isa.InterchangeSenderID_6 = "EXAR ";
isa.InterchangeTime_10 = DateTime.Now.ToString("HHmm");

 

I also tried "\\".  The file shows:

 

ISA*00*          *00*          *ZZ*EXAR           *01*059728071      *180213*1205*U*00401*100000567*0*T*>~

Comments

1 comment

  • Comment author
    Admin

    All separators need to be set in the Separators object passed in to the ISA writer:

    var isa = new ISA();
    // construct the interchange header ...

    var newSeparators = new Separators(
    '\n',
    Separators.X12.ComponentDataElement,
    Separators.X12.DataElement,
    null,
    null);

    writer.Write(isa, newSeparators);

    You can't set the separators in the ISA segment itself (ISA 11, ISA 16 and ISA 17) because they will be discarded and either the default values for X12 or the specified separators will be applied.

    0

Please sign in to leave a comment.