IIRC, there is not only the "standard assignment" of
stdin == DD:SYSIN
stdout == DD:SYSPRINT
stderr == DD:CEEMSGS
but furthermore you can, like on Unix and Windows platforms,
redirect stdin and stdout using the < and > characters on the JCL parm ...
at least if you have some compile or run time options properly set ...
that is:
// EXEC SAMPLE,PARM='/ <DD:INPUT >DD:OUTPUT '
should in my opinion redirect stdin to
//INPUT DD ...
and stdout to
//OUTPUT DD ...
if SAMPLE is a C main.
Using other syntax, you can specify DSNs instead of DD-Names
on the redirection (TSO syntax, with or without quotes).
Had no time to try it ...
of course, it's not that useful, because of the length limitations on
the JCL parm;
we overcome this by writing a small program which reads a long parm from a
file and calls the C main (name specified on parm) using a system() call.
This way there is no limit on the length of the parm.
Kind regards
Bernd
Am 03.04.2014 22:15, schrieb Phil Smith:
Thank you John! Armed with that knowledge, this worked a treat:
//SYSPRINT DD DISP=SHR,DSN=PHS.PDS.DATA(STDOUT)
...where that PDS is VB 1024 (but presumably doesn't need to be that long an
LRECL).
That page you pointed to is what I had tried to find; it's sort of written sideways - "When
you use DD statements to redirect standard streams, the standard streams will be associated with
ddnames as follows:" seems like it would have made more sense as something like, "When
you write to standard streams, be aware that they map to the following DD names, and thus output
written to those streams will be redirected if the matching DD is defined:"
I like the example program, named "HOCKEY"!
Owe ya a beer at SCIDS.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN