Quantcast
Channel: Visual COBOL
Viewing all articles
Browse latest Browse all 5819

Forum Post: RE: File open output and assign to printer works fine but need to add contents from a binary file running on Redhat

$
0
0
As Michael.Wojcik says, it would be possible to modify the COBOL program to use byte-stream I-O. Here's a link to byte-stream I-O in the Visual COBOL documentation: documentation.microfocus.com/.../HRCLRHCALL04.html Here is sample COBOL source code using byte-stream I-O: documentation.microfocus.com/.../HRCLRHCALL7C.html But I speculate this would be more work than your alternative of using a script outside of COBOL to 'cat' the two types of output into the 'lp' command, and of invoking this script from COBOL using CALL "SYSTEM". For others reading this discussion: the COBOL program could write the output file to disk (instead of writing directly to the "lp" command with dd_prt109=>lp -dprt109 -s -oraw). Then the COBOL program could invoke a shell script that would cat the binary data and the disk file together into the "lp" command. The COBOL program could invoke the script using CALL "SYSTEM" immediately after it finishes writing the file. Here's a knowledgebase article about invoking shell scripts using CALL "SYSTEM". The article concentrates on retrieving the return code from the scripts, but the sample code shows the basic use of CALL "SYSTEM": http://community.microfocus.com/microfocus/cobol/net_express__server_express/w/knowledge_base/6537/invoke-a-unix-command-from-within-cobol-using-call-system-and-retrieve-return-code

Viewing all articles
Browse latest Browse all 5819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>