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



I have a node.js script that runs fine when executed via the QSH command.
But when executed via QP2SHELL or QP2SHELL2 it dies with the CPFB9C6 - PASE for i ended for signal 6, error code 1.

Here is the node.js script. It simply performs an HTTPS GET via a forward proxy and writes the response to a flat file.

// ADDENVVAR ENVVAR(QIBM_MULTI_THREADED) VALUE(Y) is required before running this script to avoid signal 5.
// To run enter the following command QSH CMD('node /home/pjctest/node/proxyTest2.js')

var request = require('/QOpenSys/QIBM/ProdData/Node/lib/node_modules/npm/node_modules/request');
var fs = require('fs');
var outfile = '/tmp/proxyTest.txt';
var url = 'https://ewp.co.nz/admin/login';
var proxy = 'http://10.9.31.37:3128';
const args = process.argv;
console.log(args);
request( {'url': url, 'proxy': proxy }, function(error, response, body) { fs.writeFile(outfile, body); } ).end();

From QSH the outfile is created OK

Here is the RPGLE to invoke QP2SHELL2
*inLR = *on;
pgmnam = '/QOpenSys/QIBM/ProdData/Node/bin/node';
cmd1 = '/home/pjctest/node/proxyTest2.js' + x'00';

C Call 'QP2SHELL2'
C Parm pgmnam 37
C Parm cmd1 33

return;

From RPGLE the outfile is not created and it dies with CPFB9C6.

I'm wondering if the script needs some closing code to end it.

Regards, Peter




##############################################################
This correspondence is for the named person's use only. It may contain confidential or legally privileged information, or both. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this correspondence in error, please immediately delete it from your system and
notify the sender. You must not disclose, copy or rely on any part of this correspondence if you are not the intended recipient. Any views expressed in this message are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Veda. If you need assistance, please contact Veda :-
Australia http://www.veda.com.au/contact-us
New Zealand http://www.veda.co.nz/contact-veda
##############################################################


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.