Four Systems, One Container Number

Terminal gate house with a traffic cone and container stacks behind

Three reports sit in the same Monday morning inbox, and all three answer the same question about the same box. How long did MSCU 619840-2 spend in the port? The receiver’s weekly exception report says nine days. The terminal’s yard utilisation report says fourteen. The carrier’s equipment control report says seventeen. The shipment was three 40-foot high-cube containers of paper rolls and plastic resin pellets on wooden pallets, discharged at this port, collected by road and returned empty to a depot. Nothing went wrong. No box was rolled, no customs hold was raised, no cut-off was missed, no truck waited for a chassis that never arrived, and no damage was recorded on interchange.

None of the three numbers is a mistake. They were produced from the same four systems, against the same container number, within minutes of each other, by people who had no reason to disagree. What differs is a line of small print under each column: which event starts the count, which event ends it, in which time zone, and at what moment the report was run. The receiver counted from the availability notice to the loaded gate-out. The terminal counted from discharge to the same gate-out. The carrier counted from discharge to the empty return. Three intervals, one box, one stretch of real time.

The point that matters is quieter than the disagreement. No system in that chain stores the number nine, or fourteen, or seventeen. The berth and manifest system stores events. The yard system stores positions and moves. The gate system stores passages. The equipment system stores hand-overs. Each keeps its own rows with its own local timestamps, none of them keeps the interval between two rows, and none of them keeps the rows belonging to the others. Port dwell days exists in exactly one place: the report, after somebody used the container number to pull four sets of event rows together, chose two of them, and subtracted. A number without its footnote is not wrong. It is unfinished.

A footnote nobody reads

Read a dwell column as data and it looks like a measurement, the way a gross mass or a seal number is a measurement. It is not. A measurement is taken of something that is there. A dwell figure is a calculation performed on two things that are there, and the choice of those two things is a decision made by whoever built the report. That decision is usually compressed into four or five lines of small print that nobody opens unless an invoice is being argued about.

The footnote has to answer at least five questions. Which event starts the count? Which event ends it? What time zone are both timestamps expressed in? Are calendar days counted inclusively, or elapsed hours divided by twenty-four, and are non-working days excluded? And at what moment was the report run, because if the ending event has not happened yet the report must either leave the cell blank or use the snapshot time as a provisional end. Change any one of those five lines and the number changes. Not one row in any of the four systems changes with it.

Consider the simplest of the five. The receiver’s report counts from the availability notice because the receiver cannot act before that notice exists; from its point of view, the days before it are days when nobody could collect the box. The terminal’s report counts from discharge because the terminal is measuring how long its ground was occupied; from its point of view, a box sitting in a stack occupies a slot whether or not the paperwork has caught up. Both are describing the same box on the same pavement. Neither is measuring occupancy of the pavement and calling it something else by accident. They are answering different operational questions with the same word.

This is why a dwell figure should never travel alone. Send the nine days to a colleague without the footnote and it arrives as a fact about the port. Attach the footnote and it becomes a fact about a query. The distinction is not academic: the first invites somebody to go and find what went wrong, while the second tells them exactly where to look if they still think the number is surprising. Most dwell disputes end at the footnote, with no system access and no correction required.

One string, four kinds of object

It is tempting to say the four systems are aligned by the container number, as if the same field had been copied into four tables. That is close, but it hides the part that makes reports hard. The string MSCU 619840-2 names a different kind of object in each system, and the number of rows attached to it is different too.

In the manifest and berth system, that string names one line of a cargo list tied to a service, a voyage and a call. There is one row for this box on this voyage, and correcting it means correcting a manifest. In the terminal operating system, the same string names a unit that occupies a coordinate; every grounding, every shift and every rehandle appends a row, so one box can have a dozen rows in a week. In the gate system, the string names a passage: a camera read, a direction, a laden or empty status, a condition code, a truck and a time. Passages accumulate. In the equipment system, the string names a registered asset whose master record predates this shipment by years and will outlive it by years, with a chain of on-hire and off-hire events crossing many consignments.

System What the container number names there Rows for one box on one voyage What it never stores
Berth and manifest One line of a cargo list, bound to a service, voyage and call number One, amended by manifest correction Yard coordinates, gate passages, equipment history
Terminal operating system A unit occupying a bay, row and tier One per grounding or rehandle, often many Discharge timestamps from the vessel plan, availability notices, empty returns
Gate system One passage past a camera or a clerk One per gate-in and gate-out, laden and empty Stow position, call number, condition of the unit between passages
Equipment control A registered asset with a continuous multi-shipment history A master record plus custody events across many bookings Calendar days spent in this particular port
The report A join key used to pull rows out of all four One derived row per chosen pair of events Any event at all

So the cardinality runs one, many, many and one-across-many-shipments. An earlier article on this site established that a container number gives every document a common key, and another explained why such a key has to exist before the documents do. Both are true and neither finishes the job here. A shared key tells you which rows belong together. It does not tell you which of the many yard rows is the one you want, or whether the gate passage you picked belongs to the laden trip or the empty return, or whether the equipment row you found is from the previous consignment. Aligning four systems is not copying. It is selecting, and the selection rule is the footnote.

This also explains why the four systems do not need to agree with each other in order to be correct. A yard row at 10:40 on the 20th and a gate row at 08:30 on the 25th are both true; they are simply different kinds of statement. Expecting one number to reconcile them is a category error, and it is the most common reason a first attempt at a dwell report produces a spreadsheet full of apparent conflicts. The mapping table between systems is a human artefact, in the same sense that an EDI implementation guide is: messages can flow perfectly between four systems without any of them agreeing on what an interval means.

Events have witnesses, intervals do not

Every one of the four systems is built around events. An event is something that happened at a place, at a time, to a unit, observed by a person, a camera, a scanner or a crane controller. It can be signed for, timestamped, audited and, if necessary, corrected with a visible trace. An interval is a relation between two events. It has no observer, no location and no witness. It exists only once somebody says which two events, in which time zone, with which rounding. Storing that as a field in operational data would mean storing a number whose correct value depends on who is reading it.

Operational systems avoid this for a good reason, not out of laziness. If the yard system wrote dwell days into the box record, it would have to rewrite that record every morning, and every downstream reader would inherit a value computed under a rule the yard never published. Instead it writes the grounding, writes each rehandle, writes the departure, and stops. The time between them is left to whoever needs it. The same is true of the gate system with its passages, the manifest with its single line, and the equipment system with its custody chain.

Operational people have an instinct for this even without a data model. Ask a yard supervisor how long a box has been on the ground and the answer is a time and a position: since Tuesday, bay 3 row 7. Ask for a number of days and the supervisor asks which clock you mean. The event is something a person can point at. The interval is something a reader has to specify first. That is why event logs survive audits and duration columns do not: one can be checked against a camera, while the other can only be checked against a rule.

The interval is a query, not a column

Put the four systems side by side and the shape of their data is identical. Each keeps event rows: an identifier, an event code, a local timestamp with a time zone, a location or status, and the party that recorded it. Discharge complete. Grounded at bay 3, row 7, tier 2. Rehandled to tier 1. Released. Gate out laden. Gate in empty. None of them has a column called days in port, and adding one would not help, because no single system can see both ends of every definition of the interval.

The terminal knows discharge and knows the gate out; it does not know when the empty came back to a depot on the other side of the city. Equipment control knows the empty return; it was not the party that recorded the discharge. The carrier’s schedule knows the call and the intended voyage; it has no reason to store a yard coordinate. The receiver’s own system may hold only the availability notice and the delivery date. Every plausible definition of dwell therefore needs at least two owners, and frequently three. A derived value with multiple owners is not a field. It is a query.

The report performs that query. It takes the container number as a join key, pulls the event rows from the systems it can reach, sorts them into a sequence, picks a start and an end according to its stated rule, converts the two timestamps into one time zone, subtracts, and rounds. It then writes the answer into a cell that looks exactly like the gross mass in the cell next to it. Nothing about that cell is a record. Delete the report and the number does not vanish from a database, because it was never in one. Run the report again after a late gate event is posted and the number changes, though the underlying facts did not.

This is also why the question is not an integration problem. A site article on electronic data interchange makes the point that a format describes structure, not meaning, and that a message arriving is not the same as a message being understood. That lesson applies here with some force. Even with four perfectly synchronised feeds, with every event flowing in real time and every code mapped and acknowledged, the interval would still not exist until somebody chose the two events. Better plumbing removes missing rows; it does not remove the choice.

Three correct answers

Here is the box again, with the numbers attached. MSCU 619840-2 was discharged at 08:30 local on 11 March, grounded in the yard, and rehandled twice. The availability notice for the consignee was issued at 08:30 on 16 March. The laden box passed the gate out at 08:30 on 25 March, was unpacked at a warehouse outside the port, and the empty unit was returned to a depot at 08:30 on 28 March. Nothing was rolled, nothing was held, no appointment was missed and no free time was exceeded. It is an entirely ordinary import box.

Report and its reader Events used and the arithmetic Dwell days printed
Consignee’s weekly status report Availability notice 16 March 08:30 to laden gate out 25 March 08:30, elapsed days 9
Terminal yard occupancy report Discharge complete 11 March 08:30 to laden gate out 25 March 08:30, elapsed days 14
Carrier equipment utilisation report Discharge complete 11 March 08:30 to empty return 28 March 08:30, elapsed days 17
The same terminal rule, counted inclusively Both calendar dates counted, 11 March through 25 March 15
The same consignee rule, working days only 16 March to 25 March, weekends excluded 7

Five rows, one box, and the spread is ten days. Every row is reproducible from the same event log. The two extra rows are not errors either: they are what the second and first rules look like under a different rounding convention, and a surprising number of operational reports use one of them without saying so. If the five reports arrive in five inboxes, a reasonable person concludes that somebody’s system is broken. The correct conclusion is that nobody’s system is broken, and four footnotes have been omitted.

Notice also that the largest number comes from the equipment report, which counts a period that includes two days when the box was no longer in the port at all. That report is not measuring port dwell in the everyday sense. It is measuring how long a carrier asset was tied to this import before it became available for the next booking, and it happens to start its count at discharge because that is the first event its own system reliably sees at the terminal. Title the column “days in port” and it becomes misleading; title it “days from discharge to empty return” and it becomes useful. The number is identical in both cases.

Changing the answer is not changing the record

Two actions look alike from the outside and are completely different underneath. The first is changing the rule: switch the start from availability to discharge, switch the end from gate out to empty return, move both timestamps from local to UTC, count inclusively, or run the report a day later when a missing gate row has been posted. The printed number moves. No event row in any system is edited, no audit trail is produced, and no party is notified, because as far as operations are concerned nothing happened. The second action is changing a record: a corrected discharge timestamp, an availability notice withdrawn and reissued, a gate passage added after a camera fault. Now the facts have changed, every report that touches those events moves together, and the correction leaves a trace in the system that owns the row.

When two dwell figures disagree, the first question should always be which of these two actions would explain the gap. In practice it is almost always the first, and it can be settled with the footnotes and nothing else. If the rules match and the numbers still disagree, then and only then is there a data question worth escalating: pull the raw event rows, compare the timestamps and time zones, and find the owner of the row that differs. That order saves a great deal of effort. Teams often begin by asking four system owners to defend their data, when the actual difference was a start event chosen by two different report writers.

One of this site’s articles on demurrage and detention describes “arithmetic disputes” over free time counted from arrival instead of availability, calendar days counted as working days, and holidays that should not have counted. That is the same phenomenon seen from the invoice side, where the choice of start event changes money. This article stays on the other side of that line: how the cargo’s time is produced, not who pays for it, not how to contest a charge and not the rates themselves. Likewise an earlier article on what happens after discharge maps six gates and six clocks and explains which clock is running at each stage. Here the clocks are taken as given. The question is who subtracts them, into which table, and under which stated rule.

There is a practical asymmetry to keep in mind. A record can be corrected once and stays corrected, because it describes an event that happened. A derived number can be recomputed any number of times and will legitimately differ each time, because it describes a question. Treating the second as if it were the first is what produces long email threads about a port that is functioning normally.

Where the other articles stop

The four preceding articles in this series each open one of the four systems and stop at its boundary. The piece on berth windows shows that a vessel arrives once while twelve containers get twelve discharge timestamps; it stops at the ship’s plan and the crane’s sequence. The piece on yard stacks shows that available is a word while reachable is a position, and that a rehandle leaves a line in a move log but creates no new availability; it stops at the coordinate. The piece on port calls shows that a port is a place while a call is an event, and that the same port name can appear twice in one rotation; it stops at the call number. The piece on the empty box shows that a container number is assigned to a booking before the goods exist and can be withdrawn; it stops at the equipment history.

Each of those articles is about one table. This one is about the fifth table, the one that contains no events of its own. It is also why the four earlier ones never print a dwell figure. They are careful to say when each clock starts and which document carries it, but none of them claims that any document prints “days in port”, because none does. The number is assembled afterwards, from timestamps that belong to different owners, by a reader with a question.

Other articles on this site cover the surrounding territory and are worth reading alongside, but none of them is quite this: the box number as a common key, commercial and transport keys that must exist before documents do, electronic messages whose format is not their meaning, inland ramps with their own three clocks, and delivery promises built from carrier-derived estimates. The narrow question here remains how the cargo’s time is made visible, which is a question about reporting rather than about movement, and it is the last piece needed to explain why the same box can look slow, normal and fast in three different inboxes on the same morning.

Read the footnote before the number

The check is short and needs no privileged access. Ask for four things before accepting any dwell figure. First, the raw event rows rather than a summary: container number, event code, local timestamp, time zone, and the system that owns each row. Second, the rule that produced the column, written out as a start event, an end event, a rounding convention and a snapshot time. Third, the other reports covering the same box, so the spread can be explained rather than discovered later. Fourth, the identity of the person who would have to correct a row if a row were wrong, which tells you whether you are looking at a fact or at a query.

  1. Pull the event rows from all four systems and put them on one timeline in a single time zone.
  2. Write the rule above the column, including the start event, the end event, the rounding and the snapshot time.
  3. Recompute the other two rules from the same rows, and confirm that the spread is fully explained by the footnotes.
  4. Only if some gap remains, escalate to the owner of the specific event row that differs.

What can be checked on paper, then, is this: four systems’ raw event rows for one container number, each with an event code, a local timestamp and a time zone; the footnote attached to the dwell column, naming its start event, end event, rounding and snapshot time; and the three resulting figures with their differences accounted for by the rules rather than by a changed record. If the footnotes explain the spread, no system is wrong. If they do not, there is exactly one row to go and look at.

A port does not give cargo a length of stay. It gives a vessel a berth window, a yard a position table, a gate a chain of passages and a box an equipment history. All four tables record events, and none of them records a duration. The fifth table, the report, stores no events at all; it stores the difference between two rows and the small print that says which two. The three numbers in the Monday inbox are not three accounts of what happened to one container. They are three questions put to the same set of facts, and the answers were never going to be the same.

Related reading: one ETA and twelve discharge times, why the yard is a stack rather than a shelf, one service with eleven port calls, the empty box that travels before the cargo, what a box number does for free, six gates and six clocks after discharge, who pays demurrage and detention, why a box sits on an inland ramp, one shipment described five ways, why EDI is not integration, how to write a delivery promise, port and terminal charges, why transit times change, the ocean freight booking window, bill of lading release types, trucking collection and return, why port congestion comes in waves.

A dwell interval lives in a report and has to be read with the rule that produced it; a temperature record has the same discipline in a different form, because a download is a first-person account by a machine and says nothing about the centre of a pallet.

Share