You're going to have a lot of problems trying to call an RPG program from
SSH. It's hard enough calling ILE C programs, which are set up to match
Unix stdin/stdout/stderr conventions. Using the PASE system command you
can call it easily and CCSID conversion is even done for you:
hello.c -> KADLER/HELLO
#include <stdio.h>
int main() {
printf("Hello world!\n");
}
-bash-4.4$ system CALL KADLER/HELLO
HELLO-bash-4.4$
Notice that the newline was not converted properly. ILE default newline
character is NL (0x15) which is not converted to the ASCII LF (0x0a) PASE
expects, but to 0x85.
We have recently added a new package available from yum called
itoolkit-utils, which provides a mechanism to call XMLSERVICE from PASE.
yum install itoolkit-utils
Then you can pipe XMLSERVICE XML to it:
/QOpenSys/pkgs/bin/xmlservice-cgi < input.xml > output.xml
or even across ssh
ssh mysystem /QOpenSys/pkgs/bin/xmlservice-cgi < input.xml > output.xml
None of the Python/Node/etc toolkits currently support this transport
mode, but it's in the works.
----- Original message -----
From: smith5646midrange@xxxxxxxxx
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>
To: "'Midrange Systems Technical Discussion'" <midrange-l@xxxxxxxxxxxx>
Cc:
Subject: Calling a program on the i via OpenSSH
Date: Fri, Feb 1, 2019 2:26 PM
I have no clue what I am really talking about here so please bear with
me.
My end goal for this request is for a Windows server to connect to an
IBM I
and issue the command and receive the results without any user
intervention
via a "windows script".
I already have OpenSSH running on the i and I can log in with PuTTY.
Now my request.
Can anyone provide a sample program (or point me to one), preferably
written
in RPGLE that can be run on the iSeries from a Windows 10 PuTTY session
and
have it return data back to the PuTTY session? I would be OK if it just
returned "Hello World". In the real world, I will need to generate data
and
return it to the caller but Hello World would get me started.
Just in case my request is not clear (because I don't know 100% what I
am
asking for), here are the steps I think I need.
1. Start PuTTY on a Windows 10 machine
2. Connect to my IBM i
3. CALL HELLOWORLD on the IBM I <-- if you can provide the correct
syntax too, that would be great
4. See "Hello World" in my PuTTY window.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: [1]
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at [2]
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: [3]
https://amazon.midrange.com
References
Visible links
1.
https://lists.midrange.com/mailman/listinfo/midrange-l
2.
https://archive.midrange.com/midrange-l
3.
https://amazon.midrange.com/
As an Amazon Associate we earn from qualifying purchases.