Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ILE-style output from CL program

102 views
Skip to first unread message

Robert N Meyer/Rochester/IBM

unread,
Jan 20, 2000, 3:00:00 AM1/20/00
to
Is there some way to display ILE-style output from a CL program? ...
perhaps some API I can call? I can get the results that I desire by
invoking QSH with an echo command, but that seem quite crude to me.
I've also considered writing a small C program to printf/puts a
passed-in string and binding them together, but this seems a bit
complicated. I figured I'd ask whether there's an easier way. Thanks!
--
- Robert N. (Bob) Meyer, KB0GT
SDWB (DEV/2000, CMVC95) System Administration, IBM Rochester, MN, USA
Work mailto:RNM...@US.IBM.com Web: http://w3.rchland.IBM.com/~rnmeyer
Home mailto:KB...@ARRL.net Web: http://members.AOL.com/RNMeyer

Carey Evans

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Robert N Meyer/Rochester/IBM <RNM...@US.IBM.com> writes:

> Is there some way to display ILE-style output from a CL program? ...
> perhaps some API I can call?

You can call some of the C APIs, such as puts(), from an ILE CL
program. It's a little more trouble to compile.

For example:

------------------------------------------------------------
PGM

DCL VAR(&STR) TYPE(*CHAR) LEN(50)

CHGVAR VAR(&STR) VALUE('Hello, world!')
CALLPRC PRC('puts') PARM(&STR)

ENDPGM
------------------------------------------------------------

Compile this with CRTCLMOD to create a *MODULE, then CRTPGM to bind it
into a program. You'll need to pass the BNDDIR(QC2LE) parameter on
CRTPGM to tell the compiler where to find the puts() function.

--
Carey Evans http://home.clear.net.nz/pages/c.evans/

This message was composed from the finest electrons
used by many of the world's greatest writers.

Robert N Meyer/Rochester/IBM

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to Carey Evans
This is exactly the kind of solution that I was hoping for! Thanks
lots!

In case you're wondering, I'm VERY new to AS/400, though I did quite a
lot of System/38 CL programming back in the very early '80s. I've been
amazed to see that the CL programming stuff is coming back fairly
easily, but hooking it to the modern stuff on the AS/400 will be my big
challange ... the modern stuff like C. ;-)

--

0 new messages