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



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

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.