Solved

Intercept COBOL Print Job in Windows XP

Posted on 2011-09-28
8
422 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 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

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 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 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

707 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