This is nothing in LE or the C library that allocates DDNAME STDOUT 
automatically for the "stdout" standard stream.   POSIX(ON) has no impact on 
this.     So if you are running a C program directly with PGM= under MVS batch 
(without BPXBATCH), then it won't use DD:STDOUT.

For more information on use of standard streams with DDs, see  "Ch 9. Using C 
and C++ standard streams and redirection" in the XLC/C++ Programming Guide.    
In there you will see that DD:SYSPRINT will be used if present, and otherwise 
dynamically allocated.     You will see that there is also a silly way to 
redirect stdout on the PARM statement for a batch job.   

PS> If you C program is using raw fd=1 stdout and not the "FILE* stdout" 
stream, then you can't redirect that to a data set or spool file.   But since 
you said that you were using "printfs", then that would be FILE* stdout.

Kirk Wolf
Dovetailed Technologies
http://dovetail.com

On Thu, Jan 13, 2022, at 2:23 PM, Paul Gilmartin wrote:
> On Thu, 13 Jan 2022 15:09:38 -0500, Phil Smith III  wrote:
> >
> >>I'm curious: What sort of started task has implicit STDOUT and
> >>STDERR? BPXBATCH? I thought BPXBATCH defaults STDIN,
> >>STDOUT, and STDERR to /dev/null.
> > 
> >A started task that's in C and does printfs!
> >
> Must be POSIX=NO.  Does C fopen() use SVC99 INFO and respect
> those DDNAMEs of pre-allocated?
> 
> (At times I've been lazy and simply issued ALLOCATE without REUS
> and ignored the error.)
> 
> -- gil
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
> 

Kirk Wolf
Dovetailed Technologies
http://dovetail.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to