Canadian National Railway (CN Rail)
/
[Built from HCT Sample] Rail Carrier Waybill Interchange
  • Specification
  • EDI Inspector
Stedi maintains this guide based on public documentation from Canadian National Railway (CN Rail). Contact Canadian National Railway (CN Rail) for official EDI specifications. To report any errors in this guide, please contact us.
Go to Stedi Network
Canadian National Railway (CN Rail) logo

X12 417 [Built from HCT Sample] Rail Carrier Waybill Interchange

X12 Release 7010
Delimiters
  • ~ Segment
  • * Element
  • > Component
  • ^ Repetition
EDI sample
  • Sample 1
View the latest version of this implementation guide as an interactive webpage
https://www.stedi.com/app/guides/view/canadian-national-railway/built-from-hct-sample-rail-carrier-waybill-interchange/01HNG083A0RW8RKSZGB8WVDF9Q
Powered by
Build EDI implementation guides at stedi.com
Overview
ISA
-
Interchange Control Header
Max use 1
Required
GS
-
Functional Group Header
Max use 1
Required
heading
ST
0100
Transaction Set Header
Max use 1
Required
BX
0300
General Shipment Information
Max use 1
Optional
BNX
0400
Rail Shipment Information
Max use 1
Optional
N9
0500
Extended Reference Information
Max use 30
Optional
CM
0600
Cargo Manifest
Max use 2
Optional
DTM
0700
Date/Time Reference
Max use 5
Optional
N7 Loop
N8
1800
Waybill Reference
Max use 499
Required
F9
2000
Origin Station
Max use 1
Required
D9
2100
Destination Station
Max use 1
Required
R2
4700
Route Information
Max use 13
Required
LX Loop
LX
5400
Transaction Set Line Number
Max use 1
Required
L5
5500
Description, Marks and Numbers
Max use 15
Required
L0 Loop
SE
8100
Transaction Set Trailer
Max use 1
Required
GE
-
Functional Group Trailer
Max use 1
Required
IEA
-
Interchange Control Trailer
Max use 1
Required
ISA

Interchange Control Header

RequiredMax use 1
Example
ISA-01
I01
Authorization Information Qualifier
Required
Identifier (ID)
00
No Authorization Information Present (No Meaningful Information in I02)
ISA-02
I02
Authorization Information
Required
String (AN)
Min 10Max 10
ISA-03
I03
Security Information Qualifier
Required
Identifier (ID)
00
No Security Information Present (No Meaningful Information in I04)
ISA-04
I04
Security Information
Required
String (AN)
Min 10Max 10
ISA-05
I05
Interchange ID Qualifier
Required
Identifier (ID)
Min 2Max 2
Codes
ISA-06
I06
Interchange Sender ID
Required
String (AN)
Min 15Max 15
ISA-07
I05
Interchange ID Qualifier
Required
Identifier (ID)
Min 2Max 2
Codes
ISA-08
I07
Interchange Receiver ID
Required
String (AN)
Min 15Max 15
ISA-09
I08
Interchange Date
Required
Date (DT)
YYMMDD format
ISA-10
I09
Interchange Time
Required
Time (TM)
HHMM format
ISA-11
I65
Repetition Separator
Required
String (AN)
Min 1Max 1
^
Repetition Separator
ISA-12
I11
Interchange Control Version Number Code
Required
Identifier (ID)
00701
Standards Approved for Publication by ASC X12 Procedures Review Board through October 2013
ISA-13
I12
Interchange Control Number
Required
Numeric (N0)
Min 9Max 9
ISA-14
I13
Acknowledgment Requested Code
Required
Identifier (ID)
Min 1Max 1
0
No Interchange Acknowledgment Requested
1
Interchange Acknowledgment Requested (TA1)
2
Interchange Acknowledgment Requested only when Interchange is "Rejected Because Of Errors"
3
Interchange Acknowledgment Requested only when Interchange is "Rejected Because Of Errors" or "Accepted but Errors are Noted"
ISA-15
I14
Interchange Usage Indicator Code
Required
Identifier (ID)
Min 1Max 1
I
Information
P
Production Data
T
Test Data
ISA-16
I15
Component Element Separator
Required
String (AN)
Min 1Max 1
>
Component Element Separator

Functional Group Header

RequiredMax use 1
Example
GS-01
479
Functional Identifier Code
Required
Identifier (ID)
WB
Rail Carrier Waybill Interchange (417)
GS-02
142
Application Sender's Code
Required
String (AN)
Min 2Max 15
GS-03
124
Application Receiver's Code
Required
String (AN)
Min 2Max 15
Required
Date (DT)
CCYYMMDD format
Required
Time (TM)
HHMM, HHMMSS, HHMMSSD, or HHMMSSDD format
GS-06
28
Group Control Number
Required
Numeric (N0)
Min 1Max 9
GS-07
455
Responsible Agency Code
Required
Identifier (ID)
Min 1Max 2
T
Transportation Data Coordinating Committee (TDCC)
X
Accredited Standards Committee X12
GS-08
480
Version / Release / Industry Identifier Code
Required
String (AN)
007010
Standards Approved for Publication by ASC X12 Procedures Review Board through October 2013

Heading

ST
0100
Heading > ST

Transaction Set Header

RequiredMax use 1
Example
ST-01
143
Transaction Set Identifier Code
Required
Identifier (ID)
417
Rail Carrier Waybill Interchange
ST-02
329
Transaction Set Control Number
Required
Numeric (N0)
Min 4Max 9
BX
0300
Heading > BX

General Shipment Information

OptionalMax use 1
Example
BX-01
353
Transaction Set Purpose Code
Required
Identifier (ID)
00
Original
BX-02
91
Transportation Method/Type Code
Required
Identifier (ID)
X
Intermodal (Piggyback)
BX-03
146
Shipment Method of Payment Code
Required
Identifier (ID)
PP
Prepaid (by Seller)
BX-04
145
Shipment Identification Number
Optional
String (AN)
Min 1Max 30
BX-05
140
Standard Carrier Alpha Code
Optional
Identifier (ID)
Min 2Max 4
BX-06
188
Weight Unit Code
Optional
Identifier (ID)
L
Pounds
BX-07
147
Shipment Qualifier
Optional
Identifier (ID)
B
Bill of Lading for Individual Shipment
BX-08
226
Section Seven Code
Optional
Identifier (ID)
N
Not in Effect
BX-12
199
Confidential Billing Request Code
Optional
Identifier (ID)
N
Not Applicable
BNX
0400
Heading > BNX

Rail Shipment Information

OptionalMax use 1
Example
BNX-01
460
Shipment Weight Code
Optional
Identifier (ID)
M
Manifest Weight
BNX-03
11
Billing Code
Optional
Identifier (ID)
S
Single Shipment Billing
N9
0500
Heading > N9

Extended Reference Information

OptionalMax use 30
Example
If Time Code (N9-06) is present, then Time (N9-05) is required
N9-01
128
Reference Identification Qualifier
Required
Identifier (ID)
BM
Bill of Lading Number
BN
Booking Number
SI
Shipper's Identifying Number for Shipment (SID)
N9-02
127
Reference Identification
Required
String (AN)
Min 1Max 80
Optional
Date (DT)
CCYYMMDD format
Optional
Time (TM)
HHMM, HHMMSS, HHMMSSD, or HHMMSSDD format
N9-06
623
Time Code
Optional
Identifier (ID)
ET
Eastern Time
CM
0600
Heading > CM

Cargo Manifest

OptionalMax use 2
Example
If Date (CM-04) is present, then Port or Terminal Function Code (CM-02) is required
CM-02
115
Port or Terminal Function Code
Optional
Identifier (ID)
L
Port of Loading (Operational)
Optional
Date (DT)
CCYYMMDD format
CM-05
13
Booking Number
Optional
String (AN)
Min 1Max 17
CM-09
182
Vessel Name
Optional
String (AN)
Min 2Max 28
DTM
0700
Heading > DTM

Date/Time Reference

OptionalMax use 5
Example
If Time Code (DTM-04) is present, then Time (DTM-03) is required
DTM-01
374
Date/Time Qualifier
Required
Identifier (ID)
168
Release
Optional
Date (DT)
CCYYMMDD format
Optional
Time (TM)
HHMM, HHMMSS, HHMMSSD, or HHMMSSDD format
DTM-04
623
Time Code
Optional
Identifier (ID)
ET
Eastern Time
N7 Loop
RequiredMax 500
N7
0800
Heading > N7 Loop > N7

Equipment Details

RequiredMax use 1
Example
If either Weight (N7-03) or Weight Qualifier (N7-04) is present, then the other is required
If either Tare Weight (N7-05) or Tare Qualifier Code (N7-16) is present, then the other is required
N7-01
206
Equipment Initial
Optional
String (AN)
Min 1Max 4
N7-02
207
Equipment Number
Required
String (AN)
Min 1Max 15
N7-03
81
Weight
Optional
Decimal number (R)
Min 1Max 10
N7-04
187
Weight Qualifier
Optional
Identifier (ID)
N
Actual Net Weight
N7-05
167
Tare Weight
Optional
Numeric (N0)
Min 3Max 8
N7-11
40
Equipment Description Code
Optional
Identifier (ID)
CN
Container
N7-15
567
Equipment Length
Optional
Numeric (N0)
Min 4Max 5
N7-16
571
Tare Qualifier Code
Optional
Identifier (ID)
M
Marked
N7-20
65
Height
Optional
Decimal number (R)
Min 1Max 8
Optional
Decimal number (R)
Min 1Max 8
M7
1400
Heading > N7 Loop > M7

Seal Numbers

OptionalMax use 5
Example
M7-01
225
Seal Number
Required
String (AN)
Min 2Max 15
N7 Loop end
N8
1800
Heading > N8

Waybill Reference

RequiredMax use 499
Example
N8-01
186
Waybill Number
Required
Numeric (N0)
Min 1Max 6
Required
Date (DT)
CCYYMMDD format
F9
2000
Heading > F9

Origin Station

RequiredMax use 1
Example
F9-01
573
Freight Station Accounting Code
Optional
Identifier (ID)
Min 1Max 5
F9-02
19
City Name
Required
String (AN)
Min 2Max 30
F9-03
156
State or Province Code
Required
Identifier (ID)
Min 2Max 2
F9-08
154
Standard Point Location Code
Optional
Identifier (ID)
Min 6Max 9
F9-09
116
Postal Code
Optional
Identifier (ID)
Min 3Max 15
D9
2100
Heading > D9

Destination Station

RequiredMax use 1
Example
D9-01
573
Freight Station Accounting Code
Optional
Identifier (ID)
Min 1Max 5
D9-02
19
City Name
Required
String (AN)
Min 2Max 30
D9-03
156
State or Province Code
Required
Identifier (ID)
Min 2Max 2
D9-08
154
Standard Point Location Code
Optional
Identifier (ID)
Min 6Max 9
D9-09
116
Postal Code
Optional
Identifier (ID)
Min 3Max 15
N1 Loop
RequiredMax 15
N1
2200
Heading > N1 Loop > N1

Party Identification

RequiredMax use 1
Example
At least one of Name (N1-02) or Identification Code Qualifier (N1-03) is required
If either Identification Code Qualifier (N1-03) or Identification Code (N1-04) is present, then the other is required
N1-01
98
Entity Identifier Code
Required
Identifier (ID)
CN
Consignee
N1
Notify Party no. 1
PF
Party to Receive Freight Bill
SH
Shipper
Optional
String (AN)
Min 1Max 60
N1-03
66
Identification Code Qualifier
Optional
Identifier (ID)
C5
Customer Identification File
N1-04
67
Identification Code
Optional
String (AN)
Min 2Max 80
N3
2300
Heading > N1 Loop > N3

Party Location

OptionalMax use 2
Example
N3-01
166
Address Information
Required
String (AN)
Min 1Max 55
N4
2400
Heading > N1 Loop > N4

Geographic Location

OptionalMax use 1
Example
N4-01
19
City Name
Optional
String (AN)
Min 2Max 30
N4-02
156
State or Province Code
Optional
Identifier (ID)
Min 2Max 2
N4-03
116
Postal Code
Optional
Identifier (ID)
Min 3Max 15
N4-04
26
Country Code
Optional
Identifier (ID)
CA
Canada
PER
2500
Heading > N1 Loop > PER

Administrative Communications Contact

OptionalMax use 2
Example
If either Communication Number Qualifier (PER-03) or Communication Number (PER-04) is present, then the other is required
PER-01
366
Contact Function Code
Required
Identifier (ID)
IC
Information Contact
Optional
String (AN)
Min 1Max 60
PER-03
365
Communication Number Qualifier
Optional
Identifier (ID)
TE
Telephone
PER-04
364
Communication Number
Optional
String (AN)
Min 1Max 2048
N1 Loop end
R2
4700
Heading > R2

Route Information

RequiredMax use 13
Example
R2-01
140
Standard Carrier Alpha Code
Required
Identifier (ID)
Min 2Max 4
R2-02
133
Routing Sequence Code
Required
Identifier (ID)
S
Origin Carrier, Shipper's Routing (Rail)
R2-05
177
Intermodal Service Code
Optional
Identifier (ID)
Min 1Max 2
LX Loop
RequiredMax 25
LX
5400
Heading > LX Loop > LX

Transaction Set Line Number

RequiredMax use 1
Example
LX-01
554
Assigned Number
Required
Numeric (N0)
Min 1Max 6
L5
5500
Heading > LX Loop > L5

Description, Marks and Numbers

RequiredMax use 15
Example
If either Commodity Code (L5-03) or Commodity Code Qualifier (L5-04) is present, then the other is required
L5-01
213
Lading Line Item Number
Optional
Numeric (N0)
Min 1Max 6
L5-02
79
Lading Description
Optional
String (AN)
Min 1Max 50
L5-03
22
Commodity Code
Optional
String (AN)
Min 1Max 30
L5-04
23
Commodity Code Qualifier
Optional
Identifier (ID)
T
Standard Transportation Commodity Code (STCC)
L0 Loop
OptionalMax 25
L0
5700
Heading > LX Loop > L0 Loop > L0

Line Item - Quantity and Weight

RequiredMax use 1
Example
If either Weight (L0-04) or Weight Qualifier (L0-05) is present, then the other is required
If either Lading Quantity (L0-08) or Packaging Form Code (L0-09) is present, then the other is required
L0-01
213
Lading Line Item Number
Optional
Numeric (N0)
Min 1Max 6
L0-04
81
Weight
Optional
Decimal number (R)
Min 1Max 10
L0-05
187
Weight Qualifier
Optional
Identifier (ID)
N
Actual Net Weight
L0-08
80
Lading Quantity
Optional
Numeric (N0)
Min 1Max 7
L0-09
211
Packaging Form Code
Optional
Identifier (ID)
CNT
Container
L0 Loop end
LX Loop end
SE
8100
Heading > SE

Transaction Set Trailer

RequiredMax use 1
Example
SE-01
96
Number of Included Segments
Required
Numeric (N0)
Min 1Max 10
SE-02
329
Transaction Set Control Number
Required
Numeric (N0)
Min 4Max 9
Heading end

Functional Group Trailer

RequiredMax use 1
Example
GE-01
97
Number of Transaction Sets Included
Required
Numeric (N0)
Min 1Max 6
GE-02
28
Group Control Number
Required
Numeric (N0)
Min 1Max 9

Interchange Control Trailer

RequiredMax use 1
Example
IEA-01
I16
Number of Included Functional Groups
Required
Numeric (N0)
Min 1Max 5
IEA-02
I12
Interchange Control Number
Required
Numeric (N0)
Min 9Max 9
EDI Samples

Sample 1

ISA*00* *00* *02*CN *ZZ*HCTERMINAL *240119*1058*U*00701*001445903*0*P*>
GS*WB*CN*HCTERMINAL*20240119*1058*001445903*X*007010
ST*417*445903001
BX*00*X*PP*EBKG07478038*CN*L*B*N****N
BNX*M**S
N9*BM*EBKG07478038**20240119*10584000*ET
N9*BN*EBKG07478038**20240119
N9*SI*EBKG07478038
N9*BN*EBKG07478038**20240119*10580000*ET
CM**L**20240206*EBKG07478038****MSC PRATITA
DTM*168*20240119*10570000*ET
N7*MEDU*640164*51125*N*5027******CN****2000*M****102*96
M7*10135268
N8*779763*20240119
F9*42368*BRAMPTON INTER TERM*ON*****044761*L8L6L8
D9*33388*MONTREAL VIAU TERM*PQ*****030342*H1N0C6
N1*SH*HAMILTON CONTAINER TERMINAL*C5*A001357970000
N3*443 SHERMAN AVE N
N4*HAMILTON*ON*L8L6L8*CA
PER*IC*SARANG GAIKWAD*TE*(905) 538-7810
N1*CN*MEDITERRANEAN SHIPPING CO*C5*2096095100000
N3*MONTREAL VIAU TERM
N4*MONTREAL VIAU TERM*PQ*H1N0C6*CA
N1*N1*HAMILTON CONTAINER TERMINAL
N3*443 SHERMAN AVE N
N4*HAMILTON*ON*L8L6L8*CA
N1*PF*HAMILTON CONTAINER TERMINAL*C5*A001357970000
N3*443 SHERMAN AVE N
N4*HAMILTON*ON*L8L6L8*CA
R2*CN*S***85
LX*1
L5*1*SCRAP IRON OR STEEL, CAST IRON, HAVING VALUE FOR*4021127*T
L5*1*REMELTING PURPOSES
L5*1*SCRAP IRON OR STEEL, CAST IRON, HAVING VALUE FOR
L5*1*REMELTING PURPOSES
L0*1***51125*N***1*CNT
SE*35*445903001
GE*1*001445903
IEA*1*001445903

Stedi is a registered trademark of Stedi, Inc. All names, logos, and brands of third parties listed on this page are trademarks of their respective owners (including “X12”, which is a trademark of X12 Incorporated). Stedi, Inc. and its products and services are not endorsed by, sponsored by, or affiliated with these third parties. Use of these names, logos, and brands is for identification purposes only, and does not imply any such endorsement, sponsorship, or affiliation.