master slider blank master slider blank

Convert mainframe Cobol copybook files to formats suitable for uploading into PC databases

Convert Mainframe Comp3/Packed
Data in 60 Seconds with TextPipe!1

Trusted by over 2600 IT professionals & companies worldwide2

NASA
Hewlett-Packard
Boeing
Pfizer
Accenture
US Department of Defence
Automated stream editor

What TextPipe can do for you

Convert Mainframe data

Convert EBCDIC to ASCII CSV, Tab- or Pipe-delimited or fixed width
Convert Packed, Zoned and Binary fields, including Unisys Packed Decimal Unzoned/Packed-No-Zone (PNZ) with padding fields
Convert NULL and blank numerics
Convert REDEFINES and OCCURS fields, with nested OCCURS and OCCURS DEPENDING ON

Convert Enormous Files Quickly and Easily

TextPipe handles files of unlimited size, from 2 Gigabytes to 2 Petabytes!
Other applications attempt to load the entire file into memory, grinding your system to a halt
Perform Data Warehouse ETL (Extract-Transfer-Load) Tasks

Specify all text processing filters in one place (stream editing)

Combined power of awk, sed, grep, perl
Save filters for later use, include pre-defined filters
Self-documenting - you WILL understand what you (or others) did last week!

How it works

Awesome key Features

Why TextPipe?

icon-image Exceptionally fast
icon-image Handles files of unlimited size
icon-image Multi-award winning
icon-image Perform multiple operations simultaneously
icon-image Prompt support
icon-image Cost-effective
icon-image One text tool to rule them all

Reading COMP-3 packed decimal fields from mainframe files

COMP-3, also called packed decimal, is a COBOL storage format that holds two decimal digits in each byte. The last half-byte holds the sign instead of a digit. A five-digit amount takes three bytes, which saves space on a mainframe but makes the field unreadable in a text editor or a database import tool. The decimal point is not stored at all. It is implied by the PIC clause in the copybook, so a field declared as PIC S9(5)V99 COMP-3 has to be read as seven digits with two of them after the decimal point.

TextPipe decodes these fields for you. You point it at the data file and the copybook, or enter the field offsets and lengths by hand, and it writes each packed field as an ordinary number with the correct sign and decimal point. The surrounding text fields are converted from EBCDIC to ASCII in the same pass, so the output is a complete, readable record.

Sample input and output

A 4-byte field declared as PIC S9(6)V9 COMP-3 holds the bytes below, shown in hex:

12 34 56 7C   (positive)
12 34 56 7D   (negative)

The digits are 1234567 and the final half-byte is the sign: C means positive, D means negative and F means unsigned. With one implied decimal place, TextPipe writes:

123456.7
-123456.7

A full record with a customer name, an account number and a packed balance would come out as a single CSV line such as SMITH J,00481516,123456.7, ready for SQL Server, Oracle or Excel.

Typical settings

  • Field position and length: the byte offset and the packed length of each COMP-3 field, taken from the copybook.
  • Decimal places: the number of digits after the implied decimal point, from the V in the PIC clause.
  • Record length: fixed record size for files without line endings, which is typical of mainframe extracts.
  • Output format: CSV, tab delimited or fixed width text, with or without a header line.

Practical applications

Banks and insurers use the conversion to load account balances and premium tables from legacy systems into reporting databases. Auditors use it to check mainframe totals against a PC copy of the data. Migration teams use it to retire an old application while keeping its history searchable.

Common pitfalls

  • Do not run an EBCDIC to ASCII conversion over the whole record before decoding the packed fields. The conversion changes the bytes inside the packed fields and corrupts the numbers. Decode packed fields first, or convert only the character fields.
  • A wrong decimal place count shifts every value by a power of ten, and the output still looks valid. Compare one record with a printout from the source system.
  • FTP transfers in text mode alter binary bytes. Transfer the file in binary mode.

Related pages

The COMP-3 packed decimal guide covers the field format in more depth. For files with full copybooks, see the COBOL copybook import page. Character fields need the EBCDIC to ASCII converter, and the results can be ordered with large file sorting. The data conversion solutions page and the banking and finance case study show these steps in larger projects.

Select your Edition

TextPipe has editions for every need

Professional

Developers / DBAs / Data Analysts
$399 / year 1 Year Free
Upgrades

EBCDIC/Mainframe file handling

COMP-3 packed, zoned etc

Ultra-fast processing speed

Automation - CLI/COM

Most Popular

Floating

Development Teams
$499 / year 1 Year Free
Upgrades

All features of Pro

EBCDIC/Mainframe file handling

Share across teams

Automation - CLI/COM

Multi-CPU / App Server

Enterprise Data
$699 / year 1 Year Free
Upgrades

All features of Pro

Multiple instance

Utilize multiple CPUs

Automation - CLI/COM

TextPipe Case Studies

TextPipe is used across a broad range of industries

Banking and Finance
Banking & Finance
Cobol conversion / Documenting code
Systems Integrators
Database Consulting
Systems Integrators/High Tech
Print and Publishing
Print and Publishing &
Mail Houses

TextPipe Awards3

Winner of the SIA award as Best Application!
Excellent (5/5)
Excellent (5/5)
tucows5
Excellent (5/5)
5 Star Editor's Pick at ZDNet
seenonrocketdownload_black
EditorsPickAward
5star_filehungry
Excellent (5/5)
GET STARTED TODAY

FREE 30-DAY TRIAL

  1. Results are typical for a user with a modern workstation
  2. These are real user testimonials. Your results may vary
  3. Awards may no longer be present on the referred websites