× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Bob,

> the following should work:
> > QSH CMD('/qsys.lib/XXX.lib/producer.pgm |
> /qsys.lib/ZZZ.lib/consumer.pgm')

using;

/*--  PGMA --*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main( int argc, char **argv)
{
    fprintf( stdout, "Hello, here is some input for you :\n" );
    fprintf( stdout, "An input line of data number 1.....\n" );
    fprintf( stdout, "An input line of data number 2.....\n" );
    fprintf( stdout, "An input line of data number 3.....\n" );

    return 0;
}

and;

/*--  PGMB --*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main( int argc, char **argv)
{
    char buffer[200];

    fread( buffer, 144, 1, stdin );

    printf( "Echo:\n" );
    printf( "%s\n", buffer );

    return 0;
}

And the following QSH cmdline;

QSH CMD('/qsys.lib/phil_src@.lib/##s1.pgm |
/qsys.lib/phil_src@.lib/##s2.pgm')

Does create the correct behaviour/output of;

Echo:
Hello, here is some input for you :
An input line of data number 1.....
An input line of data number 2.....
An input line of data number 3.....
Press ENTER to end terminal session.

--phil


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.