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



lol, yes too easy :))

By tying your code into the platform you lose modularity and agility.
That is the strength of modular programming, and that is why nearly
everything on Unix/Linux/PASE and even windows, uses stdout and stdin
along with piping and redirection.

your php script does something and writes the result to stdout. At
some point you may want to deploy your code on another non i platform,
or may want to do something else based on the output.

Regards,
Shalom Carmel
-----------------------
www.hackingiseries.com




from: Vern Hamberg <vhamberg@xxxxxxxxxxx>
subject: Re: [WEB400] Getting PHP to write back to a data queue

Too easy!!

BMay@xxxxxxxxx wrote:
Why not just use i5_dtaq_send directly in the PHP code?

Brian May
Project Lead
Management Information Systems
Garan, Incorporated
Starkville, Mississippi

Young i Professionals
http://www.youngiprofessionals.com



Shalom Carmel <shalom@xxxxxxxxxx>
Sent by: web400-bounces@xxxxxxxxxxxx
09/15/2009 09:42 AM
Please respond to
Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>


To
web400@xxxxxxxxxxxx
cc

Subject
[WEB400] Getting PHP to write back to a data queue






It is actually simpler than it seems. The xargs utility is great at
intercepting standard output and doing stuff with it, like passing it
to another program.

Step 1: Write a CL program wrapper for the QSNDDTAQ API. Let's call it
P1 and let it accept a string and a queue name.
Step 2: pipe the stdout of the php script to the xargs PASE tool, like
this:

yourPHPscript.sh | xargs -i system "call P1 '{}' queuename"

I like this approach because it promotes writing modular programs,
although there is a slight performance penalty.

Regards,
Shalom Carmel
-----------------------
www.hackingiseries.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.