?
Solved

Intercept COBOL Print Job in Windows XP

Posted on 2011-09-28
8
Medium Priority
?
423 Views
Last Modified: 2012-05-12
I have an old COBOL accounting software package that is running within a framework that allows it to operate in Windows environments.  This program, obviously, is quite old and the company that produced it is no longer supporting it.

I have need to print something from this program onto a pre-defined template, but since last time I've needed this done the template has changed.  There are no COBOL programmers available anywhere near me to re-write this data, anyway this his likely the last time I'll need it to print this data.

Is there some way I can intercept the data being sent to the printer and capture it in a format that I can then use to print this information using Word or Excel?  My thinking is that COBOL is exporting this data to the printer in plain text since I was required to install a parallel port in the printer so the escape codes would work correctly.

Thanks for whatever leads anyone can give me.
0
Comment
Question by:BMIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 28

Assisted Solution

by:Dr. Klahn
Dr. Klahn earned 800 total points
ID: 36718442
You can install a "Generic/Text Only" printer, and have it print to "File:" rather than a printer port.  Then set that as the default printer.  There are some comments on the process at this site.  It is necessary to use the "Generic/Text Only" printer so that the files don't contain printer control language.
0
 

Author Comment

by:BMIT
ID: 36719767
DrKlahn, that is an awesome concept.  And will probably work if we can figure out how, within the restrictions of this proprietary software package, to direct the printing to the Generic/Text Only printer.  I tested it out, and this is EXACTLY what we want to happen.  But unfortunately can't choose that as a printer.

Any idea about "intercepting" the data as it enters or leaves the spooler?

Thanks,
0
 
LVL 7

Expert Comment

by:Jacobfw
ID: 36720174
Are you saying that the COBOL programs prints directly to LPT1 (attached printer) or to a standard printer spooler?

You should be able to redirect either the LPT to a file and/or the specific printer to FILE:
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:BMIT
ID: 36720429
The COBOL, as is, prints to LPT1.

I suppose I'm not familiar enough with Windows' operations to know how that is different than the spooler.

I will do a little research and find out how to redirect the LPT1 to the FILE / GENERIC that is setup (and works great).
0
 
LVL 7

Accepted Solution

by:
Jacobfw earned 1200 total points
ID: 36767500
1. Open printer's PROPERTY page
2. Select SHARING tab
3. Select SHARE THIS PRINTER
4. Supply a name for this printer (short, no spaces). This is the
printersharename below
5. Select OK
6. From a command prompt, enter

net use lpt1: \\computername\printersharename /persistent:yes

You should be able to combine this technique with your Generic to File printer above.....
0
 
LVL 28

Expert Comment

by:Dr. Klahn
ID: 36817203
If the Generic/Text printer is set to be the default printer, then print jobs not manually set to go somewhere else should go to the Generic/Text printer.
0
 
LVL 28

Expert Comment

by:Dr. Klahn
ID: 36817218
Ooops, didn't read the preceding comments carefully enough.  Yes, Jacobfw is correct, LPT1: must be redirected to the printer in this case.
0
 

Author Closing Comment

by:BMIT
ID: 36817454
Between the two tips I received, I was able to divert LPT1 traffic to the "Generic / Text" printer.

It intercepts the data and asks for a file into which this information will be deposited.

Thanks very very much for the help.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question