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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to view output in cobol

Status
Not open for further replies.

bitoffluff

Technical User
Oct 6, 2002
1
US
In ms dos mode...how would you view and print the ouput of
a cobol program??
 
You could print to a print-file and then direct that file to a printer with a simple dos command (output.txt >> prn). If DOS is run from a Windows window, then the printer can be configured to print directly to a printer or to the print que, but the printer driver has to be set up to handle dos output. The default on windows print drivers is not to accept DOS printing jobs. A windows printer driver can also be set up to print to a file. A file can be viewed with the EDIT.EXE program in DOS or with notepad in windows. Sometimes there is a bit of lag in a windows DOS print job.

In the COBOL program usually you describe the printer output as a printer file or printer(LPT-1). By just describing it as a text file (C:\OUTPUT.TXT), it will write it to a text file that you can later be printed like any text file.

Most COBOL compilers will run from within a windows environment that hides windows from the DOS program. I have run MSDOS Object Oriented COBOL from WinXP in batch mode, but I have never tried to print from it. I had an old compiler called Personal Object Oriented COBOL for Win 3.1 and it ran ok from Windows 98SE. I think I bought it from Wiley as a Student version. It wouldnt print or make objects, but it could be run from inside windows. It wouldnt print, but you could just call the printer a file and view it from windows. The COBOL code is the same for a text file as a print file. You still write records one at a time. If you do not like my post feel free to point out your opinion or my errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top