Skip to content

Code Updates

cdmgtri edited this page Dec 5, 2022 · 4 revisions

The following is a list of code tables that are maintained by the NIEM Business Architecture Committee (NBAC). There are additional code tables that are managed and/or maintained by domains and are not included below.

Note: To correctly import international characters from a UTF-8 CSV file into Excel:

  • Go to the "Data" tab and click "From Text/CSV"
  • Select the file
  • Change the "File Origin" field in the top left corner from "1252: Western European (Windows)" to "65001: Unicode (UTF-8)"

Canada Post

Canada Post Addressing Guidelines

https://www.canadapost.ca/tools/pg/manual/PGaddress-e.asp

  • See section 4 "Symbols and Abbreviations Recognized by Canada Post" for codes

Commodity codes

Standard Classification of Transported Goods (SCTG) Commodity Code List

https://bhs.econ.census.gov/bhsphpext/brdsearch/scs_code.html

  • Use the link above or go to the "Commodity Flow Survey" page on the US Census Bureau website
  • Click on "Commodity Codes List" by the search box
  • Codes will appear in nested drop-downs.
  • Save the HTML file and parse the codes and definitions from the <li> tags.

Note: There is a PDF manual also available but the HTML file will be much easier to parse. Use the manual to determine the version information.

DEA Controlled Substances

US Department of Justice (DOJ) Drug Enforcement Agency (DEA) Diversion Control Division

https://www.deadiversion.usdoj.gov/schedules/

  • Click on "DEA Drug Code Number" under the "Controlled Substances" column
  • Copy/paste from PDF to Excel.
  • Note: Multi-line PDF definitions will paste into separate rows

FIPS US state and county codes

US Census Bureau Federal Information Processing Series (FIPS)

https://www.census.gov/programs-surveys/geography/geographies/reference-files.html

  • From the US Census Bureau home page, go to "Browse by topic" / "Geography" / "Geographies" / "Reference Files", or use the link above
  • Starting with the current year, work backwards looking for the most recent update of "YYYY FIPS Codes"
  • Download both spreadsheets to get the state and the county codes
  • Remove "00" region and division codes from the state-geocodes list
  • Filter on Summary Level "050" for county codes from the all-geocodes list

Hazmat codes

US Department of Transportation Pipeline and Hazardous Materials Safety Administration

PHMSA's Online CFR (oCFR)
https://www.phmsa.dot.gov/standards-rulemaking/hazmat/phmsas-online-cfr-ocfr

  • Go to oCFR Tool (under "Related Links" from left sidebar)
  • Go to tab "Table of Hazardous Materials and Appendices" at top of page
  • Click "Download Hazmat Table" at bottom of search form

ISO 3166-1 country codes

https://www.iso.org/iso-3166-country-codes.html

Country codes are free to use but the csv, xml, and xls formats are only available via a paid subscription.

  • Click on the "Online Browsing Platform"
  • Change "Results per page" in the top right corner to 300
  • Copy the table

Note: From the ISO 3166 landing page, click on "archive of changes to the standard" to get to pdfs or other files describing published updates to ISO 3166:1 and ISO 3166:2. These likely won't be very suitable for actual code updates, but may be helpful to review.

ISO 4217 currency codes

https://www.iso.org/iso-4217-currency-codes.html

  • Click on "Access ISO 4217:
  • Download the spreadsheet or XML file
  • Remove blank rows ("No universal currency")
  • Remove duplicates

Note: The publish date in the spreadsheet may be more recent than the release date on the website.

ISO 639-3 language codes

https://iso639-3.sil.org/

  • From the top menu bar, hover over "Code Tables" drop-down
  • Click on "Download Tables" in the footer
  • Go to the "Complete Set of Tables" section
  • Download the UTF-8 version

Notes: The release date is in the download filename.

ISO 639-5 language family codes

The Library of Congress Network Development and MARC Standards Office

https://www.loc.gov/standards/iso639-5/index.html

  • Click on the "ISO 639-5 Code List" link on the right
  • Note: From the ISO 639-5 home page, click on the "ISO 639-5 Change Notice" link on the right to see if changes have been made since the last update.

OCCS facility codes

Founded in 1948, CSI is a national association of almost 7,000 experts in building construction and the materials used therein.

https://www.csiresources.org/standards/omniclass

  • Download "Table 11 - Construction Entities by Function"

Standard Occupational Classification (SOC) System codes

https://www.bls.gov/soc/

  • Go to the most recent "SOC System" link
  • Go to "YYYY SOC Downloadable Materials"
  • Click on "YYYY SOC Structure (XLSX)"
  • Filter to remove blanks on each code column to get the appropriate group of codes

UNECE Recommendation 20

Codes for Units of Measure used in International Trade

https://www.unece.org/cefact/codesfortrade/codes_index.html

  • Download zip file under "Codes for Trade" / "Codes for Units of Measurement used in International Trade"

The zip file will contain all versions of the unit of measure codes; links from other pages tend to point to revision 7e (2010).

USPS codes

Publication 28, Postal Addressing Standards

https://pe.usps.com/text/pub28/28apb.htm

  • See Appendix B for state codes and directionals
  • See Appendix C for street suffixes

xCard

xCard: vCard XML Representation

Internet Engineering Task Force (IETF) RFC 6351

https://tools.ietf.org/html/rfc6351

  • Go to Appendix A: Relax NG Schema
  • Go to Section 6: Properties, # 6.4.1: property-tel values for codes