Solved

Intercept COBOL Print Job in Windows XP

Posted on 2011-09-28
8
418 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 26

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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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 26

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 26

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

860 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