Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRLF use for a segment delimiter in X12

Status
Not open for further replies.

EdiTek

Programmer
Mar 20, 2003
52
US
Can anyone tell me if a CRLF is a valid segment terminater in an X12 transaction?

Thanks in advance,
Daren
 
I would guess not since crlf is two characters. The terminator as well as all separators can only be one character. You could use a dec 10 (LF) or dec 12 (CR) character. I believe either the LF or CR is treated as a CRLF in dos.

Or there are other characters that are commonly used as segment terminators. Depends upon what your TP will accept (if it matters) and/or what your software will handle.

LEE
 
Daren,

Usually we use Tilde (~) as the Segment Terminator since it's only 1 character. CRLF is 2 characters - one for Carriage Return and the other for Line Feed. Since the X12 guide says that it can be only one character, I personally think that CRLF can not be used as Segment Terminator.
Thanks ! Rajesh
 
Thanks for your responses.
I just needed this confirmed but I still prefer the CRLF when reading thru the X12 file.

Regards,
Daren
 
What OS are you using? We're using Unix and you can run a 'tr' command to translate (replace) certain characters into another and then display the converted text making the file much more readable. This is useful since trading partners use different terminators and separators and if you have a script to do this you can display any file you want with the terminators replaced with crlf. I'm not familar with any dos/win utilities that do this , but I'm sure that there is one.

Lee
 
We're running Windows Server 2000. I have created a script that will replace the existing segment terminator w/ crlf. My inquiry was mostly to see if we need to modify this on the outbound files for the receiving TP's. Readability is greatly enhanced w/ crlf. I'd love to see this as a valid X12 delimiter.

Daren
 
Yes, I would say you HAVE to reconvert the crlf back to some single character (ex: "~") before you send it to your TP. They will definately reject your document if not. I'm not sure how all translation software works, but the isa segment is fixed and it expects the 160th char (i think) to identify segment terminator... if you send 2 chars then the rest of the segments will be unidentifiable. The 2nd seg (GS) would start with lfGS and not match any valid segment id.

It's highly unlikely you will ever see these standards change to allow for 2 char separators and/or terminators.

If you want to make it readable... you'll just have to use your scripts to switch chars and/or maybe your translation software can generate formated reports?

PS. Have you tried using just 0a(lf) or 0D(cr)as a terminator? Win may add the cr or lf when viewing in some editors?? Haven't tried it... just guessing.

LEE
 
go to x12.org or disa.org for all the scoop on these standards. CTLF is not a valid terminator for docs.
 
Did CRLF work with anybody yet? I doubt it can be done (or be translated transparently by your TP). Please update if any development.
Good luck.
 
We've been using CRLF as our default segment delimiter. This was unintentional on our part but so far we've only had a couple trading partners that couldn't process with it.
Many of our TP's send their files using the CRLF as well and we haven't had any problems with it.
I have heard that the windows OS will read CRLF as if it is a single character - I am not certain this is true or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top