On Sat, 2 Sep 2017 21:24:35 +0000, scott Ford wrote:
>
>How can a LE enable application, using COBOL, C , etc. call UNIX services,
>perform a function a UNIX function
>And retrieving output back to COBOL..hence I would have to , have COBOL
>call C issue 'popen' build pipe, send commands
>Etc..,  is this correct ?
> 
First, I'm COBOL-ignorant,

I believe (I'm not doing a lot of research) popen() is not a system call but a 
CRTL function.
You'd probably need a C bridge.

popen() returns a stream pointer (FILE *), not likely to be useful in COBOL.

The command is an argument to popen()  It may be a compound.

I might imagin in C:

    int filedes[ 2 ]

    pipe( filedes )
    popen( "cmd1; cmd2; ...; } >filedes[ 1 ] 2>&1", "r" );  /* omitting needed 
sprintf();  */

(Would it be easier to use spawn() rather than popen()?)

In COBOL (or C):
    call BPXWDYN( alloc dd(DDNAME) path( /dev/fd/filedes[ 0 ] ) filedata(TEXT) 
... " )
(or however you do a DYNALLOC in COBOL.)

Then OPEN and READ command output from DDNAME.

I suspect John M. (or Charles M.) might know far more, if you choose to
impose on them.

-- gil

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

Reply via email to