Bar Codes

The OCLC Distributed ILL project will support the printing and scanning of Extended Code 39 bar codes. The printing and scanning of bar codes will be supported for the Transaction ID. The standard Code 39 character set only supports 43 characters (26 uppercase letters, 10 digits, and 7 special characters (- . $ / + % and space)). This Extended Code 39 format allows us to encode the full 128 character ASCII character set by defining specific 2-character Code 39 sequences to encode the remaining ASCII characters. It is not possible to encode the characters between hex 80 and hex FF. The table below shows the complete ASCII character set as it is represented in an Extended Code 39 bar code.

ASCII

Hex

Ext. Code 39

 

ASCII

Hex

Ext. Code 39

 

ASCII

Hex

Ext. Code 39

 

ASCII

Hex

Ext. Code 39

NUL

00

%U

 

SP

20

space

 

@

40

%V

 

`

60

%W

SOH

01

$A

 

!

21

/A

 

A

41

A

 

a

61

+A

STX

02

$B

 

"

22

/B

 

B

42

B

 

b

62

+B

ETX

03

$C

 

#

23

/C

 

C

43

C

 

c

63

+C

EOT

04

$D

 

$

24

/D

 

D

44

D

 

d

64

+D

ENQ

05

$E

 

%

25

/E

 

E

45

E

 

e

65

+E

ACK

06

$F

 

&

26

/F

 

F

46

F

 

f

66

+F

BEL

07

$G

 

'

27

/G

 

G

47

G

 

g

67

+G

BS

08

$H

 

(

28

/H

 

H

48

H

 

h

68

+H

HT

09

$I

 

)

29

/I

 

I

49

I

 

I

69

+I

LF

0A

$J

 

*

2A

/J

 

J

4A

J

 

j

6A

+J

VT

0B

$K

 

+

2B

/K

 

K

4B

K

 

k

6B

+K

FF

0C

$L

 

,

2C

/L

 

L

4C

L

 

l

6C

+L

CR

0D

$M

 

-

2D

-

 

M

4D

M

 

m

6D

+M

SO

0E

$N

 

.

2E

.

 

N

4E

N

 

n

6E

+N

SI

0F

$O

 

/

2F

/O

 

O

4F

O

 

o

6F

+O

DLE

10

$P

 

0

30

0

 

P

50

P

 

p

70

+P

DC1

11

$Q

 

1

31

1

 

Q

51

Q

 

q

71

+Q

DC2

12

$R

 

2

32

2

 

R

52

R

 

r

72

+R

DC3

13

$S

 

3

33

3

 

S

53

S

 

s

73

+S

DC4

14

$T

 

4

34

4

 

T

54

T

 

t

74

+T

NAK

15

$U

 

5

35

5

 

U

55

U

 

u

75

+U

SYN

16

$V

6

36

6

V

56

V

v

76

+V

ETB

17

$W

7

37

7

W

57

W

w

77

+W

CAN

18

$X

8

38

8

X

58

X

x

78

+X

EM

19

$Y

9

39

9

Y

59

Y

y

79

+Y

SUB

1A

$Z

:

3A

/Z

Z

5A

Z

z

7A

+Z

ESC

1B

%A

;

3B

%F

[

5B

%K

{

7B

%P

FS

1C

%B

<

3C

%G

\

5C

%L

|

7C

%Q

GS

1D

%C

=

3D

%H

]

5D

%M

}

7D

%R

RS

1E

%D

>

3E

%I

^

5E

%N

~

7E

%S

US

1F

%E

?

3F

%J

_

5F

%O

DEL

7F

%T

 

Table notes:

  1. The four characters $ % + / represent themselves if immediately followed by a digit, a space, $ % + /, or a stop character (otherwise these four characters must be encoded as shown in the above table)
  2. The character * must be encoded as /J when used as a regular character because * is used as the start/stop characters (which must appear at the beginning and end of all bar codes)
  3. The characters - and . can also be encoded as /M and /N respectively
  4. The digits (0 through 9) can also be encoded as /P through /Y
  5. The sequences %X, %Y, and %Z represent the ASCII DEL character (as does %T)

 

Bar Code Format:

  1. The actual construction of the bar code for a given character is described on various web sites (some of which are referenced at the end of this appendix.
  2. Each bar code consists of the following:
  1. White space must precede and follow each bar code to insure accurate recognization.

 

Check character:

  1. The Code 39 check character is a modulus 43 sum of all of the check character values (from the following table).
  2. The check character is computed by adding up all of the check character values, dividing by 43.
  3. Using the remainder from the above division, look up the proper check character in the following table.
  4. Char

    Value

     

    Char

    Value

     

    Char

    Value

     

    Char

    Value

     

    Char

    Value

     

    Char

    Value

     

    Char

    Value

    0

    0

     

    7

    7

     

    E

    14

     

    L

    21

     

    S

    28

     

    Z

    35

     

    %

    42

    1

    1

     

    8

    8

     

    F

    15

     

    M

    22

     

    T

    29

     

    -

    36

     

     

     

    2

    2

     

    9

    9

     

    G

    16

     

    N

    23

     

    U

    30

     

    .

    37

     

     

     

    3

    3

     

    A

    10

     

    H

    17

     

    O

    24

     

    V

    31

     

    SP

    38

     

     

     

    4

    4

     

    B

    11

     

    I

    18

     

    P

    25

     

    W

    32

     

    $

    39

     

     

     

    5

    5

     

    C

    12

     

    J

    19

     

    Q

    26

     

    X

    33

     

    /

    40

     

     

     

    6

    6

     

    D

    13

     

    K

    20

     

    R

    27

     

    Y

    34

     

    +

    41

     

     

     

  5. Example: if the string 'CODE 39' is encoded, the resulting bar code would be '*CODE 39R*' as follows:

Data:

C

O

D

E

 

3

9

Value:

12

24

13

14

38

3

9

Sum:

113

           
 

113

/

43

=

2

 

(remainder is 27)

     

27

=

R

 

check character

 

Assumptions:

  1. All bar codes must contain start and stop codes (leading and trailing *) to be recognized by typical bar code readers.
  2. The bar code reader strips the start and stop codes (leading and trailing *) from the scanned bar code before delivering it to the application.
  3. The bar code reader does not remove the check digit from the scanned bar code (it can verify it as long as it is not removed). We will remove the check digit in the application code. This will allow us to verify bar codes that were keyed in.
  4. The printable version of the bar code (printed under the bar code itself) will contain the entire string (without conversion to the extended character set described above) including the check digit. The printable version will not contain the start and stop codes.
  5. The ODIS software will prepend a # to all transaction IDs before the bar code is generated. The # will not be considered to be part of the actual transaction id.

 

Encoding a bar code:

  1. Initialize output string to a start code (*)
  2. If encoding a Transaction ID, append /C (represents a #) to output string
  3. Loop to append onto the output string the correct representation of each character from the input data (via the above table and rules)
  4. Calculate and append the check character onto the output string
  5. Append stop code (*) to output string

 

Decoding a bar code:

  1. If decoding a Transaction Id and the first character of input data is not a pound sign (#); skip to step 3
  2. Strip off the leading # and keep the remaining text then jump to step 5
  3. If decoding a Transaction Id and the first two characters of input data are not /C; generate error indication and jump to step 6
  4. Verify the check character; generate error indication and jump to step 6 if found to be invalid
  5. Loop through each character of the input data to reconstruct the original string (via the above table and rules)
  6. Finish

 

 

Examples (to see the examples correctly, the '3 of 9 Barcode' font must be installed):

  1. When a phone number such as '614-764-6000' is encoded, it will look like:
  2. */C614-764-6000T*

     

    #614-764-6000T

  3. When a string such as '123*456' is encoded, it will look like (the * is actually represented as /J within the bar code):
  4. */C123/J4563*

     

    #123*4563

  5. When a string such as 'Extended Code39' is encoded, it will look like (all lowercase letters are represented as the appropriate uppercase letter preceded by a +):
  6. */CE+X+T+E+N+D+E+D C+O+D+E39/*

     

    #Extended Code39/

     

  7. The separate elements in the transaction-id will be delimited by the '.' character, and the delimiters should always be present regardless of the presence of optional elements. In addition, I propose to only barcode the institution-symbol for the initial-requester-id.

A sample barcode for a transaction-id with TQG of "OCLC:ACQ:1" and TQ of "OZZ:1" would be:

 

*/C.OCLC/ZACQ/Z1.OZZ/Z1.*

 

#.OCLC:ACQ:1.OZZ:1.

 

References:

  1. For more information about Code 39 bar codes and Extended Code 39 bar codes, please see the following web site: http://www.adams1.com/pub/russadam/39code.html
--Links Checked and Revised by BAShuh, ILLASMA 12 September 2002