Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Medicare Pricer Printing

Status
Not open for further replies.

medpcjockey

Technical User
Jan 24, 2007
11
0
0
US
I need a solution for a printing problem and have not been able to get Medicare assistance. Medicare has written their cobal application to print directly to lpt1, but it only works when hardware is attached to the parallel port. I've tried "net use lpt1: \\servername\printername" but the this has not been successful. If you try to print to a mapped printer the application does not output the print job until you close it or send a second print job. It is as if the print job is being held until another job pushes it through. Of course, If I attach a physical printer directly to the parallel port it prints the job right away without the need to send a second print job through. I am not a programmer and cannot modify the cobal appliction we use. Is there a program that will intercept the application calls and fool it into thinking that hardware is attached locally? Local printers are not part of our support model. I have tried all windows variations of setting up printers with no success. It is as if the cobal app was hardcoded to print only to locally attached hardware.

 
I tried the NET USE LPT2: "\\server\printer" with Windows XP. (I put it in AUTOEXEC.BAT) It works great. I also end the report with a page eject. If you end the report with an esc E (the PCL reset command), the spooler does not recognize it as end-of-report, and it holds the job until the application closes. This is true also of local printers. Some of my applications use extensive PCL commands, and use the esc E instead of page eject.

In my case the printer I assign to LPT2: is actually a local on my computer, but it is connected through a USB port, and is not directly available to legacy applications. The NET USE command resolves this problem.
 
How do I modify the report to use the page-eject or for that matter esc E command? Which files do I need to modify/edit? Do I need a special program to do it? Is there freeware/shareware that I can download for this one application?
 
I am using for more then a year a software, that can sending or view reports files, even from Dos prpomt window
From the application, you copy the spool file to some defined file, then a TSR program, capture the file. and redirect it to direct print or open a dialog box.

lOOK
 
As CliveC said, the last statement before closing the print file should be
Code:
WRITE print_line [from SPACE|trailer_line] BEFORE PAGE
.

Code:
WRITE print_line FROM SPACE
works with Microfocus COBOL. Others may have to use
Code:
MOVE SPACE TO print_line
WRITE print_line
 
esc E is a PCL command. It works only for HP and compatible printers. It tells the printer to reset the printer to the power-on state (does not delete "permanent" down-loaded fonts) and also ejects the page. It is the sequence 1B[sub]hex[/sub] 45[sub]hex[/sub], or 27[sub]10[/sub] 69[sub]10[/sub].

I use it in programs that print to special forms such as check stock and use multiple fonts, text placed in specific locations and graphics. The page eject command resets the print cursor, but not the current font, line spacing or graphics state.
 
webrabbit,
Thank you for the information you provided. I would like to try this out. Can you tell me how I can find out which file is my print file?
 
It is the one with the ASSIGN TO PRINTER[-1] clause, or the one with an ADVANCING phrase in the WRITE statements. (The word ADVANCING is actually optional. Either BEFORE or AFTER in the WRITE statement assumes the word ADVANCING, so you might look for one of those.)
 
Is thee a freeware/Shareware tool that I can use to view and edit these files?
 
WordPad should be able to view them, but it will add a LF on each line when you save the file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top