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



Thanks everyone for the info. Unfortunately, the OpenSSH is the parameter I
was given until I can prove it is not the best way and the only way to prove
it is to have a working example that is a pain to support. :)

This Hello World was the part that I was really stuck on. The below RPG is
great and will get me where I need to go. And as a bonus, since I finally
got on a 7.3 machine, it also gives me some **free stuff to play with
without searching for syntax.

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Kevin
Bucknum
Sent: Friday, February 1, 2019 3:51 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Calling a program on the i via OpenSSH

As others have pointed out, there are probably easier ways to do this.
From linux, but I don't know why this wouldn't work from windows.

kevin@MN207-U17:~$ ssh -T kevin@172.24.1.20 'system "CALL KEVIN/TESTSTDOUT"'
Hello World

TESTSTDOUT looks like this.
**Free
Ctl-opt Dftactgrp(*NO) Actgrp('CGI') BndDir('KEVIN/CGIBND');
// Needs QTCP/QTMHCGI added during compile. I put it in the CGIBND
binding directory.

Dcl-Pr WriteStdOut Extproc('QtmhWrStout');
*N Char(2048) Const Options(*VarSize); // Buffer
*N Int(10) Const; // Buffer Length
*N LikeDs(Qusec) Options(*VarSize); // Error
End-Pr;

Dcl-S Buffer VarChar(2048);
Dcl-C LineFeed Const(x'0D25');

Dcl-Ds Qusec;
BytesProvided Int(10) Inz(%Size(Qusec));
ByteAvailable Int(10);
ErrorId Char(7);
Filler Char(1);
MessageData Char(500);
End-Ds;



Buffer = 'Hello World' + LineFeed;
WriteStdOut(Buffer:%Len(Buffer):Qusec);

Return;

CGIBND just has one entry.
Work with Binding Directory Entries

Binding Directory: CGIBND Library: KEVIN

Type options, press Enter.
1=Add 4=Remove

-
Opt Object Type Library Activation D

QTMHCGI *SRVPGM QTCP *IMMED 0


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
smith5646midrange@xxxxxxxxx
Sent: Friday, February 01, 2019 2:26 PM
To: 'Midrange Systems Technical Discussion'
Subject: Calling a program on the i via OpenSSH

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: 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
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:
https://amazon.midrange.com


[https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com



CONFIDENTIALITY NOTICE

This document and any accompanying this email transmission contain
confidential information, belonging to the sender that is legally
privileged. This information is intended only for the use of the individual
or entity named above. The authorized recipient of this information is
prohibited from disclosing this information to any other party and is
required to destroy the information after its stated need has been
fulfilled. If you are not the intended recipient, or the employee of agent
responsible to deliver it to the intended recipient, you are hereby notified
that any disclosure, copying, distribution or action taken in reliance on
the contents of these documents is STRICTLY PROHIBITED. If you have
received this email in error, please notify the sender immediately to
arrange for return or destruction of these documents.
--
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: 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
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:
https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.