+-----------------------------------------------------------------------+
| ### Appendix D Version: February 11, 2009                             |
+-----------------------------------------------------------------------+

> ***The reader should be advised that any decisions, policies, and
> solutions set forth in this DRAFT technical document are subject to
> change at any time without prior notice. This DRAFT technical document
> is not FINAL and does not represent the totality of revision/changes
> that may be implemented with Entry Summary Accounts Revenue (ESAR)
> functionality. Until such time that CBP issues a FINAL version of this
> technical guide, the attached DRAFT technical document is NOT
> considered approved, endorsed, or sanctioned by Customs and Border
> Protection and the Department of Homeland Security.***

  ------------ ------------------------------------------------------------------- --
  *This                                                                            
  mandatory                                                                        
  data must be                                                                     
  present for                                                                      
  acceptance                                                                       
  into Air                                                                         
  AMS.*                                                                            

               Defines the applications requirements, transaction file sequencing  
               rules and record data element format and requirements.              
  ------------ ------------------------------------------------------------------- --

# TRANSACTION CONTROL RECORDS

> A description of the records necessary to begin and end data
> exchanges.

# TRANSACTION MESSAGING SEQUENCING RULES

> A description of the order of records for a transaction file.

# RECORD IDENTIFIER DESCRIPTIONS

###### Transaction Control Inbound Header

> The Transaction Control Inbound Header Record provides data element
> descriptions and format requirements for the record beginning an
> inbound transaction file to CBP.

###### Transaction Control Outbound Header

> The Transaction Control Outbound Header Record provides data element
> descriptions and format requirements for the record beginning an
> outbound transaction file from CBP
>
> **Transaction Control Trailer**
>
> The Transaction Control Trailer Record provides data element
> descriptions and format requirements for the record ending a
> transaction file.

**Inbound and Outbound Examples**

> **Application Control**

This chapter defines the functional application tasks designed to
exchange manifest processing data between trade community participants
and the U.S. Customs and Border Protection (CBP) Automated Manifest
System (AMS).

##### Transaction Control Records

Each message input or output must contain a Transaction Control Header
record, the Freight/Flight record and a Transaction Control Trailer
Record.

##### The Transaction Control Header record identifies the participant, denotes the beginning of a file, and specifies the detail data to follow. Different applications require the building of separate transaction files. The Transaction Control Trailer record is paired with the Transaction Control Header record and signals the end of the transaction file. 

##### Transaction Messaging Sequencing Rules

All the Freight/Flight message types require Header and Trailer message
lines to encapsulate them.

An example of the order of records for a transaction file for one
carrier, vessel/voyage and applications follows:

+----------------------------+-----------------------------------------+
| **NAME**                   | **DESCIPTION**                          |
+----------------------------+-----------------------------------------+
| **Transaction Control      | **CAMIR-Air Header**                    |
| Header**                   |                                         |
+----------------------------+-----------------------------------------+
| > Freight/Flight Messages  | > FRI, FRC, FER, FSN, Etc.              |
+----------------------------+-----------------------------------------+
| **Transaction Control      | **CAMIR-Air Trailer**                   |
| Trailer**                  |                                         |
+----------------------------+-----------------------------------------+

**Transaction Control Inbound Header**

This record signals the beginning of a transaction file and it is used
for inbound transaction set to CBP. This mandatory data must be present
for acceptance into Air AMS.

  ---------------- ------------------ ------------ --------------------------------- -----------
  ***Transaction                                                                     
  Control Inbound                                                                    
  Header***                                                                          

  **Data Element** **Length/Class**   **Status**   **Description**                   **Note**

  Line Terminator  CRLF               M            Carriage return, line feed        

  Start of Header  1A                 M            \<SOH\> \-- Start of heading.     1

  Component        7A                 M            Always "WASUCCR".                 
  Identifier                                                                         

  Line Terminator  CRLF               M            Carriage return, line feed        

  Separator        Period             M            Period (Value '.')                

  Originator Code  8AN                M            Originator code of the trade      
                                                   participant                       

  Sender           0 - 999AN          O            Sender identification information []{.mark}
  Information                                                                        

  Line Terminator  CRLF               M            Carriage return, line feed        

  End of Header    1A                 M            \<STX\> \-- Start of text. This   2
                                                   is the end of the header and      
                                                   start of the flight/freight       
                                                   message                           
  ---------------- ------------------ ------------ --------------------------------- -----------

**Note 1**

> SOH: 0x'01' (Hex character 01). SOH -- Start of Header.

**Note 2**

STX: 0x'02' (Hex character 02). STX -- Start of Text.

**Transaction Control Outbound Header**

This record signals the beginning of a transaction file and it is used
for outbound transaction set from CBP. Concessions to receive/process
this mandatory outbound header data sent by CBP (Air AMS) must be made.

  ---------------- ------------------ ------------ --------------------------------- -----------
  ***Transaction                                                                     
  Control Outbound                                                                   
  Header***                                                                          

  **Data Element** **Length/Class**   **Status**   **Description**                   **Note**

  Line Terminator  CRLF               M            Carriage return, line feed        

  Start of Header  1A                 M            \<SOH\> \-- Start of heading.     1

  Component        3A                 M            Always "QK ".                     
  Identifier                                                                         

  Originator Code  8AN                M            Originator code of the trade      
                                                   participant                       

  Line Terminator  CRLF               M            Carriage return, line feed        

  Separator        Period             M            Period (Value '.')                

  Component        7A                 M            Always "WASUCCR".                 
  Identifier                                                                         

  Filler           1A                 M            Space                             []{.mark}

  Time             8N                 M            Transmission time Format:         
                                                   HHMMSSSS                          

  Line Terminator  CRLF               M            Carriage return, line feed        

  Start of Text    1A                 M            \<STX\> \-- Start of text. This   2
                                                   is the end of the header and      
                                                   start of the flight/freight       
                                                   message                           
  ---------------- ------------------ ------------ --------------------------------- -----------

**Note 1**

SOH: 0x'01' (Hex character 01). SOH -- Start of Header.

**Note 2**

> STX: 0x'02' (Hex character 02). STX -- Start of Text.

**Transaction Control Trailer**

This record signals the end of a transaction file and it is used for
both inbound and outbound transaction sets. This mandatory data must be
present for acceptance into Air AMS.

  ---------------- ------------------ ------------ --------------------------------- ----------
  ***Transaction                                                                     
  Control Inbound                                                                    
  Header***                                                                          

  **Data Element** **Length/Class**   **Status**   **Description**                   **Note**

  End of Text      1A                 M            \<ETX\> \-- End of Text.          1
  ---------------- ------------------ ------------ --------------------------------- ----------

**Note 1**

> ETX: 0x'03' (Hex character 03). ETX -- End of Text.

**Inbound:**

**Example in ASCII:**

\<0D\>\<0A\>\<01\>"WASUCCR"\<0D\>\<0A\>\<2E\>YYYYYYYY\<0D\>\<0A\>\<02\>xxx
flight/freight message xxx\<03\>

**Outbound**

**Example in ASCII:**

\<0D\>\<0A\>\<01\>"QK
"YYYYYYYY\<0D\>\<0A\>\<2E\>"WASUCCR"08354851\<0D\>\<0A\>\<02\>xxx
flight/freight message xxx\<03\>

Format Key

  ----------------------------------- -----------------------------------
  **Value in Example**                **Description**

  \<0D\>                              Hex value (carriage return)

  "WASUCCR"                           Literal value between quotes

  YYYYYYYY                            Originator Code

  xxx flight/freight message xxx      Actual flight/freight message (FRI,
                                      FER, FSN, etc.

  08354851                            Time in HHMMSSSS format
  ----------------------------------- -----------------------------------