calling a CL from PHP - IBM AS400
This is a discussion on calling a CL from PHP - IBM AS400 ; Hi!
Is it anyone who knows how can I call a CL program at a remote AS/
400 server from a script in other machine via PHP?
I have done it with Visual Basic and ADODB, but I canīt find ...
-
calling a CL from PHP
Hi!
Is it anyone who knows how can I call a CL program at a remote AS/
400 server from a script in other machine via PHP?
I have done it with Visual Basic and ADODB, but I canīt find the way
with PHP...
Thanks a lot!
-
Re: calling a CL from PHP
On May 30, 8:44 am, Vmrincon wrote:
> Hi!
>
> Is it anyone who knows how can I call a CL program at a remote AS/
> 400 server from a script in other machine via PHP?
>
> I have done it with Visual Basic and ADODB, but I canīt find the way
> with PHP...
>
> Thanks a lot!
You can implement the CL as a stored procedure (basically, you use the
SQL CREATE PROCEDURE command and the AS/400) and call it using SQL.
Matt
-
Re: calling a CL from PHP
On 30 mayo, 16:22, matt.h...@thomsonlearning.com wrote:
> On May 30, 8:44 am, Vmrincon wrote:
>
> > Hi!
>
> > Is it anyone who knows how can I call a CL program at a remote AS/
> > 400 server from a script in other machine via PHP?
>
> > I have done it with Visual Basic and ADODB, but I canīt find the way
> > with PHP...
>
> > Thanks a lot!
>
> You can implement the CL as a stored procedure (basically, you use the
> SQL CREATE PROCEDURE command and the AS/400) and call it using SQL.
>
> Matt
Thanks for your answer Matt
The problem is that I can not implement the CL as stored
procedure, because I donīt administrate the machine. I have just
access to the CL interface...
Any idea?
-
Re: calling a CL from PHP
-
Re: calling a CL from PHP
Well,
you could always implement WEB service (Servlet) on iSeries and call it with
opening http link.
We have Tomcat server running on iSeries which have small servlet accepting
commands...
For example
http://as400system:8080/cmds/cmd?id=...fhf7843m3jkd8d
Servlet will parse parameters and do what it does on iSeries and return XML
data (in our case).
If with PHP you can call such links and wait for return data this could be a
simple solution.
Niko.
-
Re: calling a CL from PHP
On 30 mayo, 17:17, "niko" wrote:
> Well,
> you could always implement WEB service (Servlet) on iSeries and call it with
> opening http link.
> We have Tomcat server running on iSeries which have small servlet accepting
> commands...
>
> For examplehttp://as400system:8080/cmds/cmd?id=3456734&p1=QVZT&p2=zfhf7843m3jkd8d
>
> Servlet will parse parameters and do what it does on iSeries and return XML
> data (in our case).
> If with PHP you can call such links and wait for return data this could be a
> simple solution.
>
> Niko.
Hi Niko!
Thanks for your answer... as I answered to another post, the
problem is that I can not implement anything at the serverīs side
because I donīt administrate the server, is someone else who
administrates it... so I can just use the execution of the CL program
that I am given by the serverīs administrator...
Any idea?
As said, thanks a lot!
Victor
-
Re: calling a CL from PHP
> The problem is that I can not implement the CL as stored
> procedure, because I donīt administrate the machine. I have just
> access to the CL interface...
What do you mean by CL interface? Do you mean just the "green screen"
5250 interface? Client Access and FTP both provide a facility for
submitting commands. Ask the administrator if they are available to
you. If they are then look into PHP's Program Execution and FTP
functions.
-
Re: calling a CL from PHP
On 1 Juni, 00:21, Madcap wrote:
> > The problem is that I can not implement the CL as stored
> > procedure, because I donīt administrate the machine. I have just
> > access to the CL interface...
>
> What do you mean by CL interface? Do you mean just the "green screen"
> 5250 interface? Client Access and FTP both provide a facility for
> submitting commands. Ask the administrator if they are available to
> you. If they are then look into PHP's Program Execution and FTP
> functions.
Hi!
Actually what I mean is that I can just call a CL programme to
access information in the server, that's why I call it a CL interface,
because I can only access the server calling that programme, if I do
it via odbc + Visual Basic, or if I do it via a "green screen" is my
problem. but the administrator only gives me that interface... What I
want to do is call that CL programme from a PHP web application...
Thanks for your answer....
Cheers! Victor
-
Re: calling a CL from PHP
Vmrincon wrote:
> Is it anyone who knows how can I call a CL program at a remote AS/
> 400 server from a script in other machine via PHP?
>
> I have done it with Visual Basic and ADODB, but I canīt find the way
> with PHP...
Victor:
If you've done it with VB and ADODB, are you asking how PHP can call
programs on a remote system?
Can you describe what the CL program will do? In particular, will it
return values to PHP?
--
Tom Liotta
http://zap.to/tl400
-
Re: calling a CL from PHP
On 3 jun, 12:21, Thomas wrote:
> Vmrincon wrote:
> > Is it anyone who knows how can I call a CL program at a remote AS/
> > 400 server from a script in other machine via PHP?
>
> > I have done it with Visual Basic and ADODB, but I canīt find the way
> > with PHP...
>
> Victor:
>
> If you've done it with VB and ADODB, are you asking how PHP can call
> programs on a remote system?
>
> Can you describe what the CL program will do? In particular, will it
> return values to PHP?
>
> --
> Tom Liottahttp://zap.to/tl400
Hi Tom!
Yes, that's what I am asking.... Exactly, the CL program will have
an IN parameter (an ID) and will return an OUT parameter (with the
result of the query that the CL shoots, but about this I am not so
sure, because is not me who administrates the AS400)
Thanks a lot for your post!
-
Re: calling a CL from PHP
Vmrincon wrote:
> On 3 jun, 12:21, Thomas wrote:
>> Vmrincon wrote:
>>> Is it anyone who knows how can I call a CL program at a remote AS/
>>> 400 server from a script in other machine via PHP?
>>> I have done it with Visual Basic and ADODB, but I canīt find the way
>>> with PHP...
>> Victor:
>>
>> If you've done it with VB and ADODB, are you asking how PHP can call
>> programs on a remote system?
>>
>> Can you describe what the CL program will do? In particular, will it
>> return values to PHP?
>>
> Yes, that's what I am asking.... Exactly, the CL program will have
> an IN parameter (an ID) and will return an OUT parameter (with the
> result of the query that the CL shoots, but about this I am not so
> sure, because is not me who administrates the AS400)
Victor:
The return parameter is the problem here. In order for a value to be
returned, the remote server needs to be told how to format what it sends
back across the network. An SQL server will use the parameter
declarations from the stored procedure definition to know what to send
back. If there was no return value, you wouldn't need to define a stored
proc; you could simply issue the CALL and it would all work as if a
stored proc was defined.
There are 'remote program call' alternatives, but a stored proc will be
the easiest by far unless you already have support set up on the PHP
side. iSeries Access, for example, provides Remote Command/Distributed
Program Call APIs. In that case, you provide the parm definitions to the
API and it works out the structure with the program call server. I
haven't seen reference to anyone using that in a remote PHP app, but I
can't think of why it couldn't be used.
If the APIs themselves aren't available, the IBM LIPI documents describe
the protocols. The documents used to be available for something like
$500US, but I recall seeing a reference a while back that asserted the
documents could be obtained at no (or minimal) cost.
Another "possible" route would be EDRS which also provides for remote
program calls without stored proc requirements. One or two other
possibilities exist. Via PHP...? Someone probably can suggest some details.
--
Tom Liotta
http://zap.to/tl400