Solved

Intercept COBOL Print Job in Windows XP

Posted on 2011-09-28
8
413 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 23

Assisted Solution

by:Dr. Klahn
Dr. Klahn earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 7

Accepted Solution

by:
Jacobfw earned 300 total points
Comment Utility
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 23

Expert Comment

by:Dr. Klahn
Comment Utility
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 23

Expert Comment

by:Dr. Klahn
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
nestparen challenge 4 55
mapBully challenge 6 88
Asus ks2003 driver XP 32 33 65
Event ID: 1202 / Source: SceCli 6 43
Online collaboration can help businesses be more efficient, help employees grow their skills and foster a team environment.
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…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
This video Micro Tutorial is the second in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles a…

772 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

12 Experts available now in Live!

Get 1:1 Help Now