Understanding Line Data Formats
Total Page:16
File Type:pdf, Size:1020Kb
BY DAVID STAAL Understanding Line Data Formats ince a large amount of production printing is still based on line data and its hybrids, technical Sanalysts in the print industry need to understand these line data formats, especially when trying to integrate mainframe print data with PC-based solutions. laser printers with full graphic non-proportional, that is, the characters are all the ALTHOUGH capabilities have been available for same width. more than a decade, a large amount of production printing is G use continuous feed paper (with holes on the still based on line data (or hybrids, such as Xerox LCDS). For sides), which can include blank paper, green bar this reason, technical analysts in the print industry need to paper and special forms, such as labels and thoroughly understand line data formats, especially when pre-printed checks trying to integrate mainframe print data with PC-based G move down the page in only one direction. The paper is solutions. As an instructor, I have found that many analysts moved with a tractor feed and can be advanced, but not lack this basic knowledge, largely because it is not available backed up. in any simple form. This article is intended to provide a basic and thorough Line data is data that is formatted for line printers. It description of the most common line data formats, including generally has the following characteristics: mainframe Fixed Block (FBA or FBM), Variable Block (VBA or VBM), and ASCII line data. This article will also G is text only explain the basic varieties of printer carriage control and G is stored as records or lines of data provide examples of these formats. G has some kind of “carriage control” commands that instruct Line data, or line printer data, can be defined simply as the printer on how to move down the paper, such as Line data formatted for a printer that prints one line at a time. As Feed or Page Break printers have evolved, more advanced printers (those that could support fonts and graphics) continued to support the THREE ELEMENTS OF LINE DATA data intended for the older line printers, as a backward compatibility feature. Eventually, the expression “line data” Over the years, and on different computing platforms, was coined to refer to this older data stream. For a thorough many formats evolved for storing line data. The most com- understanding of line data, it is necessary to review the mon of these formats (e.g., ASCII text, EBCDIC VBA or original target of line data, which is, of course, a line printer. VBM and EBCDIC FBA or FBM) will be discussed in detail later in this article. To interpret any line data format, it is nec- LINE PRINTERS essary to identify the following three basic elements that make up the format: Line printers, sometimes called impact printers, have the following characteristics: G Record Separation: How are the records separated or delimited? G print one line or less (one character) at a time G Carriage Control: What type of carriage control G print text only, no graphics is used? G use a fixed font because the characters are physically G Character Set: Is the data EBCDIC, ASCII or engraved on the print heads or print band. The font is something else? TECHNICAL SUPPORT • FEBRUARY 2001 ©2001 Technical Enterprises, Inc. Reproduction of this document without permission is prohibited. Record Separation FIGURE 1: CARRIAGE CONTROL Because line data is fundamentally Carriage Control Machine Machine ASA SCS ASCII record-oriented, methods of storing line w/out data with data (ANSI) CC data must allow for the separating or Do not space 03 (no op) 01 + 0D 0D delimiting of records. This ensures that the Space one line 0B09 (space) 0D 15 0D 0A program reading the data doesn’t accidentally Space two lines 13 11 0 0D 15 15 string together two or more records or break Space three lines 1B19 - 0D 15 15 15 Skip to Channel 1 8B89 1 0D 0C 0C a record into pieces. Skip to Channel 2 93 91 2 0D 04 82 The following three basic schemes are Skip to Channel 3 9B99 3 0D 04 83 used by different line data formats for Skip to Channel 4 A3 A1 4 0D 04 84 record separation: Skip to Channel 5 ABA9 5 0D 04 85 Skip to Channel 6 B3 B1 6 0D 04 86 Skip to Channel 7 BB B9 7 0D 04 87 G Fixed Length Records: This is the Skip to Channel 8 C3 C1 8 0D 04 88 most basic scheme where you arbitrarily Skip to Channel 9 CBC9 9 0D 04 89 decide on a length, such as 80 or 1331, Skip to Channel 10 D3 D1 A 0D 04 7A and all records in the file are made to Skip to Channel 11 DBD9 B 0D 04 7B Skip to Channel 12 E3 E1 C 0D 04 7C be the same length. A program processing a fixed-length file of 133-byte records, FIGURE 2: SAMPLE LINE DATA for example, can then just read 133 bytes into its buffer at a time and A TEST OF CARRIAGE CONTROL. Single Space. assume that it has read in one record. This scheme is used primarily for Double Space. mainframes, and the most common format for this is called FBA (Fixed Block with ASA/ANSI carriage control) or FBM (Fixed Block with Machine carriage control). G Record Delimiters: The record delimiter New Page scheme relies on special characters that A TEST OF CARRIAGE CONTROL. are different from normal text to mark the end of a record. The most familiar Triple Space. example of this is ASCII text, which Double Space. Single Space. uses the Carriage Return (0Dh), Line Overprint Feed (0Ah), and Form Feed (0Ch) as record delimiters. A program processing this data would read one byte at a time, FIGURE 3: LINE DATA ELEMENTS FOR FBA and when it came to one of these special Record Separation Fixed Length Records characters, it would assume it had Carriage Control ASA reached the end of the record. One Character Set EBCDIC flaw in this approach is that something unusual in the data portion of the FIGURE 4: RECORD STRUCTURE FOR FBA record (such as an escape code string) might get confused with a Record 1 Record 2 record delimiter. C Data C Data G Length Byte or Word: The most advanced and flexible scheme for Carriage Control byte separating records is to use a byte or two (a word) at the beginning of each using Length Words are VBA (Variable printer carriage control must have the fol- record to store the length of the following Blocked with ASA carriage control) or lowing two basic commands: record. This approach provides the VBM (Variable Blocked with Machine G move down a line (called Line Feed, benefit of storing variable length carriage control) and Barr S/370 format. New Line or Space One Line) records, and allows you to store any G move to top of next page (called Form type of data, not just text. For example, Carriage Control Feed, Page Break or Skip to Channel 1) applications used with Xerox printers Line data needs to have some kind of car- can store Xerox Metacode inside of a riage control, which are the instructions to Following are the four most common line data format using this scheme. Two the printer on how to move vertically down types of carriage control used in the produc- common examples of line data formats the page. At a minimum, any type of line tion printing business: 1The number 133 is derived from the old line printers that could print 132 columns wide. The record would store 1 byte of ASA carriage control followed by 132 bytes of text. ©2001 Technical Enterprises, Inc. Reproduction of this document without permission is prohibited. TECHNICAL SUPPORT • FEBRUARY 2001 G ASCII: used in the PC, Unix and FIGURE 5: HEX DUMP OF FBA Internet arenas 00000000 4E C1 40 E3 C5 E2 E3 40-D6 C6 40 C3 C1 D9 D9 C9 +A TEST OF CARRI G SCS: used in RJE, 3270, and 5250 00000010 C1 C7 C5 40 C3 D6 D5 E3-D9 D6 D3 4B 40 40 40 40 AGE CONTROL. 00000020 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 print streams 00000030 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 G ASA or ANSI: used on mainframes 00000040 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 00000050 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 and AS/400s, as well as adopted for 00000060 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 other platforms 00000070 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 00000080 40 40 40 40 40 40 E2 89-95 87 93 85 40 E2 97 81 _Single Spa G 1403/3211 Machine: native carriage 00000090 83 85 4B 40 40 40 40 40-40 40 40 40 40 40 40 40 ce. control used on mainframe channel- 000000A0 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 000000B0 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 attached line printers 000000C0 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 000000D0 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 000000E0 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 The table in Figure 1 shows the hexa- 000000F0 40 40 40 40 40 40 40 40-40 40 40 40 40 40 40 40 00000100 40 40 40 40 40 40 40 40-40 40 F0 C4 96 A4 82 93 0Doubl decimal values for the standard carriage 00000110 85 40 E2 97 81 83 85 4B-40 40 40 40 40 40 40 40 e Space.