Identifiers and keys

Operators and P-5 numbers

Every company that touches a Texas well has a six-digit P-5 number. The number is stable and the name is not. Here is what the P-5 Organization file contains, and how to use it as the operator dimension for everything else.

Before anyone can drill, operate, or transport oil and gas in Texas, they file a Form P-5 organisation report with the Railroad Commission and receive a six-digit operator number. That number is the operator's identity across every RRC dataset: permits, completions, production, violations, dockets, tax certifications. It is the "who" column of the whole system.

The P-5 Organization file is the dimension table that gives that number a meaning.

What is in the file

The P-5 file is fixed-width, distributed in both ASCII and EBCDIC, refreshed monthly, documented in the RRC's ORA001 layout. Records are 350 bytes and come in several types, distinguished by a record identifier in the first two bytes. Organisation master data lives in the A records; other record types carry related detail such as officers and filings.

An A record gives you, in this order down the layout: the operator number, a 32-character organisation name, a refiling flag, the P-5 status, a hold-mail code, a renewal letter code, the organisation type, a comment field, a gatherer code, two address lines, city, state, ZIP and ZIP suffix, a block of location address fields, the date the record was built, the date the organisation went inactive, and a phone number. Dates are CCYYMMDD.

A few gotchas that come straight out of that layout:

  • The name field is 32 characters. Long company names are truncated by the file format itself, not by whoever loaded it. SOUTHWESTERN ENERGY PRODUCTION C is what the file says.
  • Empty is encoded, not absent. A phone number of 0000000000 means "none", not "all zeros". A ZIP suffix of 0000 means "none". A date of 00000000 means "none". Every one of these needs converting to null on load or your averages and your date ranges will be wrong.
  • Low numbers are internal. Operator numbers at the very bottom of the range are RRC internal records rather than real companies, and there is a well-known test record at 123456. Upstream skips operator numbers of 15 or below and the test record; you should too, or your "smallest operators" list will be nonsense.

Status codes: active is not the same as operating

The P-5 status is a single character. The important distinction it draws is between organisations that are current with the Commission and organisations that are not:

  • A — active
  • I — inactive
  • D — delinquent
  • S — see remarks

A P-5 filing has to be renewed, and the renewal is tied to a financial assurance requirement. An operator can be D, delinquent, and still appear as the operator of record on thousands of producing wells — delinquency is a compliance state, not an operational one. If you are looking for "companies currently operating in Texas", P-5 status is a weak proxy; recent production or recent permits are much stronger.

The organisation type is likewise a single character distinguishing corporations, limited partnerships, sole proprietorships and the other legal forms the RRC recognises. EZRRC publishes both code sets as real lookup tables rather than leaving them as single letters in a column.

Why names are unreliable and numbers are not

Operator names in Texas data are a graveyard of joins. The reasons compound:

Truncation. Thirty-two characters, silently cut.

Punctuation drift. SMITH OIL CO., INC., SMITH OIL CO INC, SMITH OIL COMPANY, INC — the same filing, entered differently at different times, or the same company filing differently at different times.

Denormalised copies. Several datasets carry an operator_name column alongside the operator number. That name was correct when the extract was built. An extract built two years ago carries a two-year-old name. Two datasets refreshed on different cadences will disagree about the same operator number, and both will be internally consistent.

Corporate churn. Mergers, name changes and asset sales are constant. The company that drilled a well in 2014 is frequently not the company producing it in 2026. Sometimes the P-5 number survives a name change; sometimes a new number is issued and wells are transferred. Both leave traces in the data and neither is visible in a name.

Distinct entities with similar names. Operating subsidiaries, royalty entities and midstream affiliates often share a corporate prefix and have entirely separate P-5 numbers, because they have entirely separate regulatory obligations.

The number sidesteps all of this. It is assigned once, it is used consistently, and every dataset that names an operator also numbers one.

-- Do this
SELECT o.name, count(*) AS permits
  FROM texas.permits p
  JOIN texas.operators o ON o.id = p.operator_no::int
 WHERE p.issue_date >= DATE '2026-01-01'
 GROUP BY o.name
 ORDER BY permits DESC;

-- Not this: name-to-name joins lose rows silently
-- JOIN texas.operators o ON o.name = p.operator_name

Two notes on that query. First, the join is on the number and the display name comes from the dimension table, so every row gets the same, current name. Second, if you want to group companies that are commercially the same entity but regulatorily distinct, you have to build and own that mapping yourself — the RRC does not publish a corporate family tree, and any tool that shows you one has made one up.

Using P-5 as a dimension

The operator number appears, under various column names, in nearly every RRC dataset:

Dataset Operator column
Drilling permits operator number on the permit
Completions operator number on the filing packet
PDQ production operator_no on every lease-cycle row
PDQ operator warehouse operator_no plus P-5 status and filing dates
High cost gas operator number on the certification
ST-1 applications OPERATOR_P5
Inspections and violations P5_OPERATOR_NO

The PDQ dataset ships its own operator dimension table with the P-5 status code, last filed date, tax certificate flag and e-filing status. It overlaps the P-5 Organization file but is not identical: it is a snapshot taken when the production dump was built, and it carries production-system flags the P-5 file does not. When they disagree, the P-5 Organization file is the authority on organisation identity; the PDQ table is the authority on what the production system believed at extract time.

A worked pattern: operator activity over time

Because production is lease-grain and permits are well-grain, the honest way to measure an operator is to measure each grain separately and label it:

-- Monthly oil volume attributed to one operator, lease grain
SELECT cycle_year_month,
       sum(lease_oil_prod_vol) AS oil_bbl,
       sum(lease_gas_prod_vol) AS gas_mcf
  FROM texas.pdq_og_lease_cycle
 WHERE operator_no = '123456'
   AND cycle_year_month BETWEEN '202401' AND '202612'
 GROUP BY cycle_year_month
 ORDER BY cycle_year_month;

Two caveats that apply to every version of this query. Operator attribution is as-of-extract: the production rows carry the operator who reported them, so a lease that changed hands mid-year splits across two operator numbers, which is correct. And the last two cycles are always incomplete — see the production article for why.

Checklist

  • Join on the six-digit P-5 number. Never on the name.
  • Take names from the P-5 Organization file, not from denormalised copies.
  • Treat 0000000000 phones, 0000 ZIP suffixes and 00000000 dates as null.
  • Exclude the RRC's internal low-numbered records and the 123456 test record.
  • P-5 status is a compliance state, not an activity signal.
  • Corporate families are yours to build; the RRC does not publish them.

Next: the file formats. Start with EBCDIC, because if you cannot read the bytes none of the rest matters.