On Mon, 13 Feb 2017 09:44:51 -0600, John McKown wrote:
>
>> 3.  Is it possible to have the Assembler routine place the extracted data 
>> into a unix
>>      pipe or a C type=memory file and then i can retrieve it ?
>
>​You can call the UNIX BPX* routines from COBOL, so you can use something
>like BPX1PIP to create an unnamed pipe. The COBOL program could then ​pass
>the "write_file_descriptor" to the HLASM program as a parm. The COBOL
>program would use BPX1RED to read from the read_file_descriptor. The HLASM
>
Is this better than using BPXWDYN('ALLOC ...') the descriptor and using
conventional COBOL I/O)?

>would use BPX1WRT to write to the passed in descriptor. But critically
>important is that the HLASM program must be ATTACHX'd (BPX1ATM service can
>do this) and not LINK'd to (as a normal COBOL CALL would do). Otherwise
>
Does BPX1ATM dup() descriptors as spawn() does?  If so the parent must
close() its copy of the input descriptor or it never sees EOF.  Happens to
me all the time.

>you'll most likely get a lock out with either the TCB either waiting in the
>COBOL code for the HLASM to write some thing, or in the HLASM code waiting
>(buffer full) for the COBOL to read something. I just wanted to throw this
>last in for completeness. You might also need some way to communicate to
>the COBOL routine that the HLASM routine has written an "EOF" and has ended.
> 
close() the input end of the pipe should suffice.  COBOL should see EOF.


On Mon, 13 Feb 2017 16:45:33 +0100, Peter Hunkeler wrote:
>
>Any you'd need to run the Cobol and the assembler routine in parallel, not as 
>main routine calling a subroutine. UNIX pipes need both ends to be acitve for 
>them to work.
> 
I've sometimes cheated on this, mostly with stderr, assuming that
any error messages will fit in a 131KB buffer.  Hard to handle both
stdout and stderr otherwise in a Rexx parent.  Is there a select()
SYSCALL?

-- gil

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

Reply via email to