Solved

Intercept COBOL Print Job in Windows XP

Posted on 2011-09-28
8
415 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
  • 3
  • 3
  • 2
8 Comments
 
LVL 24

Assisted Solution

by:Dr. Klahn
Dr. Klahn earned 200 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
 

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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 7

Accepted Solution

by:
Jacobfw earned 300 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 24

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 24

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now