| Framework EDI Reference. SEFManager Utility | |
| .SETS Section |
Overview
This section of the SEF file describes the implementation guideline of an ASC/X12 Transaction Set or UN/EDIFACT Messages in the EDI document. The transaction set/message outlines the general format that an EDI document must follow. It indicates the necessity of data in the document by specifying if the corresponding data segment must or must not exist, should or should not exist, or if the data is dependent on other data in the document. Furthermore, should the data exist, it must conform to the rules imposed upon its position relative to other data in the document which is indicated by the data segment reference in the transaction set/message -- specifying how each data segment in the document must follow one another.
NOTE: The examples of syntax shown may not be the actual definition, and may have been altered for brevity and emphasis.
An example of an ASC/X12 Transaction Set in the .SETS section looks like the following.
An example of a UN/EDIFACT Message in the .SETS section looks like the following:
An example of a .SETS section in a SEF file may look like (UN/EDIFACT example):
.SETS
DOCARE=[UNH,M][BGM,M][RFF,M,2][DTM]{:5[FII,M][RFF,,2][CTA][COM,,5]}{:9[NAD,M][RFF][CTA][COM,,5]}{[AUT][DTM]}[UNT,M]
APERAK=[UNH,M][BGM,M][DTM,,9][FTX,,9][CNT,,9]{:99[DOC][DTM,,99]}{:9[RFF][DTM,,9]}{:9[NAD][CTA,,9][COM,,9]}{:99999[ERC][FTX]{:9[RFF][FTX,,9]}}[UNT,M]
AUTHOR=[UNH,M][BGM,M][DTM][BUS]{:2[RFF][DTM]}{:5[FII][CTA][COM,,5]}{:3[NAD][CTA][COM,,5]}{:9999[LIN,M]{:5[RFF][DTM]}{:9999[SEQ][GIS,M][DTM,,2][MOA][DOC,,5]}{:2[FII][CTA][COM,,5]}{:2[NAD][CTA][COM,,5]}}[CNT,,5]{:5[AUT][DTM]}[UNT,M]
Rules
The section conforms to the following rule (NOTE: Quotes around keywords are used for emphasis and for grouping characters of the keyword only, and are not part of the keyword):
General:
Example 1:
.SETS
DOCARE=[UNH,M][BGM,M][RFF,M,2][DTM]{:5[FII,M][RFF,,2][CTA][COM,,5]}{:9[NAD,M][RFF][CTA][COM,,5]}{[AUT][DTM]}[UNT,M]
APERAK=[UNH,M][BGM,M][DTM,,9][FTX,,9][CNT,,9]{:99[DOC][DTM,,99]}{:9[RFF][DTM,,9]}{:9[NAD][CTA,,9][COM,,9]}{:99999[ERC][FTX]{:9[RFF][FTX,,9]}}[UNT,M]
AUTHOR=[UNH,M][BGM,M][DTM][BUS]{:2[RFF][DTM]}{:5[FII][CTA][COM,,5]}{:3[NAD][CTA][COM,,5]}{:9999[LIN,M]{:5[RFF][DTM]}{:9999[SEQ][GIS,M][DTM,,2][MOA][DOC,,5]}{:2[FII][CTA][COM,,5]}{:2[NAD][CTA][COM,,5]}}[CNT,,5]{:5[AUT][DTM]}[UNT,M]
DOCARE=[UNH,M][BGM,M][RFF,M,2][DTM]
In the above UN/EDIFACT example, the last message definition "DOCARE=[UNH,M][BGM,M][RFF,M,2][DTM]"
is accepted only.
Example 2:
.SETS
DOCARE=[UNH,M][BGM,M][RFF,M,2][DTM]{:5[FII,M][RFF,,2][CTA][COM,,5]}{:9[NAD,M][RFF][CTA][COM,,5]}{[AUT][DTM]}[UNT,M]
APERAK=[UNH,M][BGM,M][DTM,,9][FTX,,9][CNT,,9]{:99[DOC][DTM,,99]}{:9[RFF][DTM,,9]}{:9[NAD][CTA,,9][COM,,9]}{:99999[ERC][FTX]{:9[RFF][FTX,,9]}}[UNT,M]
AUTHOR=[UNH,M][BGM,M][DTM][BUS]{:2[RFF][DTM]}{:5[FII][CTA][COM,,5]}{:3[NAD][CTA][COM,,5]}{:9999[LIN,M]{:5[RFF][DTM]}{:9999[SEQ][GIS,M][DTM,,2][MOA][DOC,,5]}{:2[FII][CTA][COM,,5]}{:2[NAD][CTA][COM,,5]}}[CNT,,5]{:5[AUT][DTM]}[UNT,M]
.SETS
BAPLTE=[UNH,M][BGM,M][DTM,M][RFF][NAD,,3]{:3[TDT,M][LOC,M][DTM,M,99][RFF][FTX]}{:999[LOC][GID]{:9999[EQD][EQN]}}[UNT,M]
APERAK=[UNH,M][BGM,M][DTM,,9][FTX,,9][CNT,,9]
CONAPW=[UNH,M][BGM,M][RFF,M,9][DTM,M,9]{:3[NAD,M]{:2[CTA][COM,,3]}}[LOC,M,99][FTX,M,99][DOC,,9][CNT,,5][AUT][UNT,M]
In example 2 above, the last occurrence of "APERAK=[UNH,M][BGM,M][DTM,,9][FTX,,9][CNT,,9]"
in the second section is accepted.
<SETS_section> ::= <set_section_header> <carriage_return_line_feed>
{<set_definitions>}
<set_section_header> ::= ".SETS"
<set_definitions> ::= <set_transactionset_message_definition>
{<carriage_return_line_feed> <set_transactionset_message_definition>}
Table
Example:
In the above example, the message is divided into 3 tables:
<set_table> ::= "^" {"^"}
Segment Reference
<set_segreference> ::= "[" <set_segment> ["," [<set_segrequirement>] ["," <set_segmaxuse>] "]"
Examples.
| Symbol | Meaning |
| . (dot) | NOT USED. |
| $ | RECOMMENDED. |
| - | NOT RECOMMENDED. |
| & | DEPENDENT |
| ! | MUST BE USED |
<user_requirement> ::= "." | "$" | "-" | "&" | "!"
Examples.
<set_segrefmask> ::= "*" <unsigned_integer>
Example:

The example below shows an automatic assignment of ordinal numbers when loops do not participate in the ordinal count.

The example below shows an automatic assignment of ordinal numbers when loops participate in the ordinal count. In the example below, the loop FII and AUT has been assigned ordinal number 5 and 11.
If a different ordinal number is specified, it conforms to the following:
When an out-of-sequence ordinal number is encountered, the next segment reference is determined to have an ordinal number in the next sequence, and subsequence segment references' ordinal numbers continue to follow the sequence to the end of the transaction set/message, or until the next out-of-sequence ordinal number is encountered. In the example below:
<set_ordinal> ::= "@" <unsigned_integer>
Example:
Position Numbers:
<set_pos_increment> ::= "+" <unsigned_integer> | "-" <unsigned_integer>
Example:
| Position | Segment |
| 10 | UNH |
| 20 | BGM |
| 30 | RFF |
| 40 | DTM |
| 50 | UNT |
| Position | Segment |
| 100 | UNH |
| 150 | BGM |
| 200 | (Group) |
| 250 | RFF |
| 350 | DTM |
| 400 | UNT |
| Position | Segment |
| 100 | UNH |
| 150 | BGM |
| 200 | (Group 1) |
| 250 | RFF |
| 350 | DTM |
| 200 | (Group 2) |
| 250 | RFF |
| 350 | DTM |
| 400 | UNT |
<set_segreference> ::= [<set_pos_increment>] "[" <set_segment> ["," [<set_segrequirement>] ["," <set_segmaxuse>] "]"
<set_segment> ::= [<user_requirement>] <segment_id> [<set_segrefmask>] [<set_ordinal>]
<set_segrefmask> ::= "*" <unsigned_integer>
<set_ordinal> ::= "@" <unsigned_integer>
<user_requirement> ::= "." | "$" | "-" |
"&" | "!"
<set_pos_increment> ::= "+" <unsigned_integer> |
"-" <unsigned_integer>
Loops or Groups