Browser utilities

Tools

Utilities for recurring IBM i tasks: date and numeric format conversion, data reading, command generation. They run in the browser, with no installation.

Calculations happen on the device in use. Entered data is not transmitted to the server.

IBM i date converter

Type a date in any format and get it in all the others, CYYMMDD and Julian included.

12607272026-07-27

Why does CYYMMDD exist?

A 7-digit numeric field whose first digit is the century: 0 for 1900, 1 for 2000. It was born to fit a date into very little space and cross the millennium without ambiguity, once two digits for the year were no longer enough. It costs one byte more than YYMMDD and saves one against YYYYMMDD: a trade-off still sitting inside a great many production files. Watch out for six digits: 260727 can be either YYMMDD or Julian CYYDDD, and only the file layout can tell you for sure.

Packed and zoned decimal

How a number is really written to disk, byte by byte, and how much room it takes.

123.4512 34 5C

How to read these bytes

In zoned decimal every digit takes a whole byte: the high nibble is F and the low one holds the digit. In packed decimal two digits share a byte, so it takes nearly half the room. In both, the last nibble carries the sign: C positive, D negative, F unsigned. The decimal point is never stored: it lives only in the field definition. This matters when you stare at a record in hex through DSPPFM and F10, or when you need to know what a file will really weigh before you create it.

Record layout

Which byte each field starts at, how long the record is, and how much the file will weigh.

A(10) P(5,2)pos. 1-10, 11-13

One field per line: name, type, length, decimals. Types are A (character), P (packed), S (zoned). The DDS style is accepted too, such as CUSTNO 7P 0.

DDS to SQL

Paste the DDS of a physical file and get the matching CREATE TABLE.

A R CLIENTECREATE TABLE

What it covers and what it does not

Field definitions are read — name, length, type, decimals — along with the record format and key fields. Type mapping is: A to CHAR, P to DECIMAL, S to NUMERIC, L to DATE, T to TIME, Z to TIMESTAMP, B to SMALLINT, INTEGER or BIGINT depending on length. A field with no explicit type is zoned when it has decimals and character when it does not, as DDS requires. Validation keywords, default values and fields defined by reference are left out, and flagged rather than guessed: the result is a starting point to read through, not something to run blind.

Is a tool you would often use missing? Let us know, gladly.