Version 4010 x12 messages support segments with composite elements (like REF04) which contain sub-elements that are separated by sub-element separators.
Here is an example of a segment which uses ; [semicolon] as a segment separator, * as an element separator and : [colon] as a sub-element separator:
REF*ACT*12345678901234*ACCOUNTING CODE*3X:SUB CONTRACT NUMBER 1234567;
My question is this: If there is another segment in the message (for example N1) which is not a composite element and it happens to contain a sub-element separator, should the message be: a.) Accepted, which means the sub-element separator in N102 (see example) gets ignored and treated as a regular character that is part of the element data b.) Rejected, because sub-element separators can only appear inside composite elements, therefore it cannot be present in a N1 segment.
Example (with same separators as above - note that a colon appears in N102 as part of the data): N1*PE*TEST:PARTY ONE;
Any input would be helpful.
Based on the scenario you describe, I would reject the transaction. It violates X12 standards and would probably cause errors in most EDI translators or parsers.
The X12 standards have this to say about delimiters such as the subelement separator (ISA16):
Once specified in the interchange header, the delimiters are not to be used in a data element value elsewhere in the interchange.
Assuming this is an inbound transaction, your trading partner should take steps to ensure that none of the data they send to you will contain any characters that are the same as the element separator, subelement separator, or segment terminator. If the subelement separator is a colon and colons cannot be avoided in their data, then another subelement separator should be used.
As an aside, I would be careful about using semicolons as segment terminators. That is a character that often appears in data (e.g. addresses, product descriptions, etc.).
It may seem like a hardship at first, but the X12 standards greatly facilitate the exchange of data in the long run.