× 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.



I'm using the SMBCLIENT program call to transfer files and parsing the
stdout reponses for success/failure. Works very well, unlike QNTC. :-)

I now have the spawned job sending it's stderr/stdout back to a file in
QTEMP from the calling job so I can parse the results.

Nice !!

Thanks again for the input.

I'm also going to check into using the exit status. That could be
useful.

Regards,
Richard Schoen
RJS Software Systems Inc.
"Get the information you need. Now!"
Document Management, Workflow, Report Delivery, Forms and Business
Intelligence
Email: richard@xxxxxxxxxxxxxxx
Web Site: http://www.rjssoftware.com
Tel: (952) 736-5800
Fax: (952) 736-5801
Toll Free: (888) RJSSOFT


-----Original Message-----

message: 7
date: Mon, 19 Jan 2009 17:47:10 -0600
from: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
subject: Re: spawn II--the Sequel

Richard Schoen wrote:
So when I call spawn(), is the job spawning as part of the same
iSeries
job or separately ?

spawn() is similar, conceptually, to the SBMJOB command. It starts a
new job, and runs a program in that new job.

However, with spawn(), the new job is a "child job" of the current one,
and will report it's status to the current job. Consider looking up
spawn() in the Information Center for more details.

What makes it really attractive in your situation is that you can start
the job with file descriptors open that map to pipes, and you can read
the pipes from your current job. You can't easily do that with SBMJOB.

But, it definitely starts a separate job.


I'm actually calling a CL program that calls the QP2SHELL to call the
SAMBA API's to transfer a file. I need to capture the STDOUT responses
so I'm thinking your RPG spawn example should work as a starting point
and I want to get the data from the pipe that captures STDOUT, correct
?

I've written quite a few RPG spawn examples -- so I'm not sure which one

you're referencing -- but I guess it doesn't matter... spawn() should
be able to run PASE programs and use it to capture the output.
waitpid() should be able to give you the exit status, as well.

That assumes you're running a Samba program -- like smbclient -- as
opposed to an actual API (calling a function in a shared library).



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.