× 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 Richard,

I should have included that in the rpg code.

I have set
QIBM_QSH_CMD_ESCAPE_MSG 'Y'
QIBM_MULTI_THREADED 'Y'

I will have a look at the link provided.




Don Brown
Director

MSD Information Technology
t: 07 3368 7888
m: 0408 751 644
e: dbrown@xxxxxxxxxx
www.msd.net.au



From: "Richard Schoen" <richard@xxxxxxxxxxxxxxxxx>
To: "midrange-l@xxxxxxxxxxxxxxxxxx" <midrange-l@xxxxxxxxxxxxxxxxxx>
Date: 02/09/2021 02:29 PM
Subject: RE: curl works from strqsh but not from QSH
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>



Probably threading issues.

Most likely this one is the issue:
ADDENVVAR ENVVAR(QIBM_MULTI_THREADED) VALUE(Y) REPLACE(*YES)

Or try to install and use the QSHEXEC command to run your curl stuff or
analyze the QSHEXECC program and check the environment variables.

QShell on i
https://github.com/richardschoen/qshoni

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx

------------------------------

message: 5
date: Thu, 2 Sep 2021 14:21:57 +1000
from: Don Brown via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx>
subject: curl works from strqsh but not from QSH

If I start qshell (STRQSH) I can run a command like;

/QOpenSys/pkgs/bin/curl -k -XPOST https://<address>:<port>gelf -d
''{"short_message": "|QSYS-QHST|CPF1124|Low|","full_message
<more_information_in_here> }'' ')

This runs successfully.

But if I try and run that from an RPG program like;

cmd = 'QSH CMD(''/QOpenSys/pkgs/bin/curl -k '
+ '-XPOST https:<address>:<port>/gelf -d
+ '''''{"short_message": "' + %trim(shortMessageZ1)
+ '"full_message":"' + %trim(fullMessageZ1) + '", '
+ '"host":"' + %trim(hostZ1) + '", '
+ '"version":"' + versionZ1 + '", '
+ '"timestamp":' + %char(msgTimeStampZ1)
+ %subst(msgTimeStampA: 20: 4) + ', '
+ '"level":' + %trim(levelZ1) + ' }'''''')';

cmdLen = %len(%trim(cmd));
callp(e) QCmdExc(Cmd:CmdLen);

I get error qsh: 001-0014 Command /QOpenSys/pkgs/bin/curl not found.

What am I missing ?

Thank you

Don

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.