Closed Shpigford closed 11 years ago
From the sample file you provided earlier, it looks like these segments aren't specified in the grammar so you'll have a difficult time accessing them (you can play with #find!
but I wouldn't suggest it). Here's the output of bin/edi-pp (after changing it to use Config.contrib
):
LoopVal[0205](
SegmentVal[AT7: Shipment Status Detail](
ID.empty[E1650: Shipment Status Code],
ID.empty[E1651: Shipment Status or Appointment Reason Code],
ID.value[E1652: Shipment Appointment Status Code](AB: Delivery Appointment Date and/or Time),
ID.value[E1651: Shipment Status or Appointment Reason Code](BG: Other),
DT.value[ E373: Date](2013-06-19),
TM.value[ E337: Time](23:59:0.0),
ID.value[ E623: Time Code](LT: Local Time (Preferred Usage - Explain in detail)))),
SegmentVal[L11: Business Instructions and Reference Number](
AN.value[ E127: Reference Identification](DL-RETURNED TO SHIPPER),
ID.value[ E128: Reference Identification Qualifier](RRS: Reconciliation Report Section Identification Code),
AN.empty[ E352: Description]),
SegmentVal[L11: Business Instructions and Reference Number](
AN.value[ E127: Reference Identification](49-THE CUSTOMER WAS NOT AVAILA),
ID.value[ E128: Reference Identification Qualifier](REC: Related Case),
AN.value[ E352: Description]( ON 3RD ATTEMPT)),
InvalidSegmentVal[MAN],
InvalidSegmentVal[CD3],
InvalidSegmentVal[CD3],
InvalidSegmentVal[N1],
InvalidSegmentVal[N3],
InvalidSegmentVal[N4]),
How you seek to this N1
will ultimately depend on the changes you make to the grammar. If MAN
is a sibling loop to 0200
and N1
is a child loop of MAN
, you could jump directly from ST
to MAN
, and the from MAN
to N1
. You'll need some documentation from your trading partner to be able to construct the grammar, though.
Here's a typical transaction set:
What I'm ultimately trying to pull is that set of
N1
,N3
andN4
towards then end of the set.But, there will occasionally be an additional set of those under the first occurrence of
N1
(and beforeAT7
).So how would I differentiate those and select only those segments before
AT7
or only those towards the end?Does that make sense?