Reading Column-Binary Data


Definition

column-binary data storage
   

is an older form of data storage that is no longer widely used and is not needed by most SAS users. Column-binary data storage compresses data so that more than 80 items of data can be stored on a single punched card. The advantage is that this method enables you to store more data in the same amount of space. There are disadvantages, however; special card readers are required and difficulties are frequently encountered when this type of data is read. Because multi-punched decks and card-image data sets remain in existence, SAS provides informats for reading column-binary data. See "Description of Column-Binary Data Storage" on page 372 for a more detailed explanation of column-binary data storage.

How to Read Column-Binary Data

To read column-binary data with SAS, you need to know:

  • how to select the appropriate SAS column-binary informat

  • how to set the RECFM= and LRECL= options in the INFILE statement

  • how to use pointer controls.

The following table lists and describes SAS column-binary informats.

Table 21.5: SAS Informats for Reading Column-Binary Data

Informat Name

Description

$CB w.

reads standard character data from column-binary files

CB w.

reads standard numeric data from column-binary files

PUNCH. d

reads whether a row is punched

ROW w.d

reads a column-binary field down a card column

To read column-binary data, you must set two options in the INFILE statement:

  • Set RECFM= to F for fixed.

  • Set the LRECL= to 160, because each card column of column-binary data is expanded to two bytes before the fields are read.

For example, to read column-binary data from a file, use an INFILE statement in the following form before the INPUT statement that reads the data:

 infile  file-specification or path-name  recfm=f lrecl=160; 
Note  

The expansion of each column of column-binary data into two bytes does not affect the position of the column pointer. You use the absolute column pointer control @, as usual, because the informats automatically compute the true location on the doubled record. If a value is in column 23, use the pointer control @23 to move the pointer there.

Description of Column-Binary Data Storage

The arrangement and numbering of rows in a column on punched cards originated with the Hollerith system of encoding characters and numbers . It is based on using a pair of values to represent either a character or a numeric digit. In the Hollerith system, each column on a card has a maximum of two punches, one punch in the zone portion, and one in the digit portion. These punches correspond to a pair of values, and each pair of values corresponds to a specific alphabetic character or sign and numeric digit.

In the zone portion of the punched card, which is the first three rows, the zone component of the pair can have the values 12, 11, 0 (or 10), or not punched. In the digit portion of the card, which is the fourth through the twelfth rows, the digit component of the pair can have the values 1 through 9, or not punched.

The following figure shows the multi-punch combinations corresponding to letters of the alphabet.

start figure
 

row

punch

zone portion

12

X X X X X X X X X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’

11

ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X X X X X X X X X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’

10

ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X X X X X X X X

digit portion

1

X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’

2

ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’

3

ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’

4

ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’

5

ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’

6

ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’

7

ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’

8

ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’

9

ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ ˆ’ X

alphabetic character

 

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

end figure

Figure 21.1: Columns and Rows in a Punched Card

SAS stores each column of column-binary data in two bytes. Since each column has only 12 positions and since 2 bytes contain 16 positions, the 4 extra positions within the bytes are located at the beginning of each byte. The following figure shows the correspondence between the rows of a punched card and the positions within 2 bytes that SAS uses to store them. SAS stores a punched position as a binary 1 bit and an unpunched position as a binary 0 bit.

click to expand
Figure 21.2: Column-Binary Representation on a Punched Card



SAS 9.1.3 Language Reference. Concepts
SAS 9.1.3 Language Reference: Concepts, Third Edition, Volumes 1 and 2
ISBN: 1590478401
EAN: 2147483647
Year: 2004
Pages: 258

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net