× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



c function puts() writes to stdout. That's "standard output", a file descriptor normally provided in c by the operating system. In fact there are three standard file descriptors, input, output and error, fd(0) fd(1) and fd(2).

ILE does not necessarily provide these descriptors, but in the default interactive scenario, ILE pipes stdin and the stdout and stderr output to the ugly 5250 vt100 emulator you maligned in an earlier post. In batch, the output is piped to a job that copies the streams to print file QPRINT. Again, this is the DEFAULT behavior, not the only behavior.

The stdio file descriptors can easily be set to files when the descriptors are established and opened.
new_desc = open ('/dev/null' : mode : aut);
new_desc is 0 for the first file opened, 1 for the second and so on.

dev/null is a special value that assigns the descriptor to the operating system. In ILE this is the default behavior as assigned above. Easy to replace this with '/somepath/somefile.txt' and the output (or input) will go to (or come from) some other path.

Once established in a job the file descriptors stay pretty much in place. You can even pass the descriptors to QSH or PASE by setting environment variable QIBM_USE_DESCRIPTOR_STDIO to "Y".

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of James Lampert
Sent: Wednesday, December 21, 2011 1:37 PM
To: Midrange Systems Technical Discussion
Subject: (see thread on RPG list) Re: Test program calls puts(), creates spool file here, but not on customer box

This problem began at the top of the month, when I tried to use the c
puts() function to provide quick-and-dirty diagnostics to a headless server program, and was discussed briefly on the RPG list, without any resolution so far. Then it got shoved aside in favor of more pressing matters. But it has abruptly returned to the foreground.

Here is what we know so far:

On our boxes, and on the customer's old box, all of the usual ways to produce spool files (e.g., compilation listings, PRTTRGPGM listings, the "Host Print" key [from QuestView, or from a system menu], calling the
puts() function in the C runtime within a batch job, and so forth) all produce spool files.

But on their new box, while compilation listings and PRTTRGPGM listings still produce spool files, the "host print" key (wherever I've tried it) and "puts() in a batch job" don't. There is no spool file if I do a WRKSPLF; there's no spool file in WRKJOB option 4; there have been no reports of unexpected pages coming out of unexpected printers.

It acts as if a spool file was produced, but there's no evidence that this happened.

One note: the print key takes about 2 seconds to produce the spool file and unlock the keyboard on our 170, about half a second to do so on our E4A, about 24 seconds to do so on the customer's old box (an M25), and
11 seconds to unlock the keyboard and come back with "Print operation complete to the default printer device file" (but no actual spool file) on the customer's new box (also an M25).

I don't suppose there's something that bypasses spool files entirely, is there?

QPRINT and QSYSPRT both exist, and they're both PRTFs. QPRINT is in QGPL, and while QGPL is not in the default *LIBL, adding it has no effect on the weird behavior.

--
JHHL
--


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.