cobol code for bar code printing (729 Views)
Reply
Occasional Advisor
Martha_1
Posts: 8
Registered: ‎06-19-2002
Message 1 of 12 (729 Views)

cobol code for bar code printing

I hope this is an easy question for someone to answer. Is there an escape sequence for a space? I have no problem printing barcode for other characters but the scanner will not scan if the variable has a space in it. Thanks in advance for any and all suggestions.
Honored Contributor
Eric Sorensen_1
Posts: 573
Registered: ‎10-08-2000
Message 2 of 12 (729 Views)

Re: cobol code for bar code printing

Hello Martha,

Which type of barcode are you using? Some types allow only a subset of characters.

Barcodes are produced by the printer, and it is possible the printer will not allow cursor movement while it is processing a barcode image, but you could try the horizontal cursor positioning command:

Ec&a+#H where # is the number of decipoints (1/720 inch) to the right of the current position. This will (if it works) produce a blank space. However, the barcode reader might need a barcode to represent a space...
A problem well defined is half solved.
Occasional Advisor
Martha_1
Posts: 8
Registered: ‎06-19-2002
Message 3 of 12 (729 Views)

Re: cobol code for bar code printing

Hi Eric,

I am using code39 printing to a LJ 8150. I am getting a blank for the space but need a barcode for it. I would think that it should print automaticaly but does not.

Thank-you for your help...any and ideas are welcomed!
Honored Contributor
Eric Sorensen_1
Posts: 573
Registered: ‎10-08-2000
Message 4 of 12 (729 Views)

Re: cobol code for bar code printing

Hello Martha,

I found several web sites that discuss code39 chars:

"Barcode readers need to have a printed SPACE character composed of bars and spaces, so it can be read like the barcoded letters, numbers and symbols."

Unfortunately, it seems the "standard" version of code39 does not support the space character. Some enhanced versions will produce a space barcode for the tilde char-- have you tried using tilde?
A problem well defined is half solved.
Occasional Advisor
Martha_1
Posts: 8
Registered: ‎06-19-2002
Message 5 of 12 (729 Views)

Re: cobol code for bar code printing

No, I have not tried that. What would be the escape sequence for it? And also what would be the sequence for a space?

Thanks for your help...
Honored Contributor
Eric Sorensen_1
Posts: 573
Registered: ‎10-08-2000
Message 6 of 12 (729 Views)

Re: cobol code for bar code printing

Escape sequence?? It seems to me that the bars for the space are produced when the printer sees the ~ in the char string.

Another document suggests that a comma will generate a space.

Yet another document suggests sending the decimal, octal, or hex representation of the space character: %40, #32, !20
A problem well defined is half solved.
Occasional Advisor
Martha_1
Posts: 8
Registered: ‎06-19-2002
Message 7 of 12 (729 Views)

Re: cobol code for bar code printing

Hi Eric,

I tried all your sugguestions to force print a bar coded space and its just not working. Thank you for trying to help me out. If I ever do get to work I will let you know.
Thanks again,
Martha
Occasional Visitor
Thane Schaffer
Posts: 1
Registered: ‎07-08-2002
Message 8 of 12 (729 Views)

Re: cobol code for bar code printing

Martha & Eric, I'm glad to see I'm not the only one battling this problem with spaces and getting inconsistant answers everywhere on the internet! I too have not gotten a space to embed in the barcode and have tried everything (and much more) to make it happen. I've had tremendous success with getting other extended code39 to print with our old laserjets and barcode (barcode and more) cartridge. For instance, I've gotten all kinds of quotes, parenthesis, curley brackets, commas, tilde, and all lowercase characters. But there appears to be no way to get the space to print in the beginning, middle, or end of a barcode...all I get is a chunk of whitespace?
Gryfindor House Rules!
Occasional Advisor
Martha_1
Posts: 8
Registered: ‎06-19-2002
Message 9 of 12 (729 Views)

Re: cobol code for bar code printing

I found the answer... "the image, which normally represents the Code 3 of 9 bar code "space" character, resides in the comma (ASCII 44) position...." This was kinda suggested by Eric and I did not check this out because it did not sound like it would work...but it does!! I found the above quote in "Bar codes and More DIMM" documentation. It does NOT put a comma, it is indeed a space.

Happy coding!
Martha

Occasional Visitor
Damion Edwards
Posts: 1
Registered: ‎10-03-2002
Message 10 of 12 (729 Views)

Re: cobol code for bar code printing

Hello Martha,
I am a programmer in kingston, jamaica and I have ben assigned a task to amend a program to have it print barcodes along with its other processes. however, I have no idea on how to do this. I would appreciate it much if you could possibly assist me with accomplishing this task. The format is code 39 and I realy need help. I have tried almost everything else I know but nothing helps when it comes to cobol and barcodes. I await your response
Nothing is Constant but Change
Occasional Advisor
Martha_1
Posts: 8
Registered: ‎06-19-2002
Message 11 of 12 (726 Views)

Re: cobol code for bar code printing

Hi Damion, Sorry for the delay in replying but here is what I used and worked for me:

(this signals the printer to print barcode for HP8500DN.. check your documentation for the correct sequence codes.)
01 BARSETLJ.
05 FL PIC X VALUE SPACE.
05 FL PIC X VALUE %33.
05 FL PIC X(04)VALUE "&l0O".
05 FL PIC X VALUE %33.
05 FL PIC XXXX VALUE "&a4L".
05 FL PIC X VALUE %33.
05 FL PIC XXX VALUE "(0Y".
05 FL PIC X VALUE %33.
05 FL PIC X(20) VALUE
"(s0p4.6h12v0s0b0T".

(THE BARCODE NUMBER MUST START AND END WITH "*".)
01 LINESETLJ.
05 FL PIC X VALUE SPACE.
05 FL PIC X VALUE "*".
05 BCASENUMLJ PIC X(12)
VALUE SPACES.
05 FL PIC X VALUE "*"

(RESET PRINT TO NOT PRINT BARCODE)
01 RESSET.
05 FL PIC X VALUE SPACE.
05 FL PIC X VALUE %33.
05 FL PIC X VALUE "E".

.......

FORMAT 1

<>

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXX
XXX


BARSETLJ (LINE 23)
LINESETLJ (LINE 24)
RESSET (LINE 25)

.........

HEADING 1 PAGE
PRINT BLANK AFTER PAGE
PRINT 25 AFTER 0
PRINT 1 AFTER 3
END

DETAIL 1



MOVE SPACES TO BCASENUMLJ
MOVE DTLE-NBR TO BCASENUMLJ
PRINT 23 AFTER 3
PRINT 24 AFTER 1
END

-------------------
Hope this helps or gets you a start in the right direction.
Martha
Occasional Visitor
Deborah Moses
Posts: 3
Registered: ‎01-27-2003
Message 12 of 12 (726 Views)

Re: cobol code for bar code printing

Hi Martha,
have read some old posts of yours...you seem to have a lot of knowledge about barcode and cobol.
I need to print from a cobol pgm on an as400 to a laserjet 5si; need code for 5si, and info on how to describe the device on the as400. Also, am running under RUMBA, which means I have pc drivers in the mix also.
ANY ideas, suggestions would be greatly appreciated.
Thanks.
Debby
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.