Its an RPGLE pgm...When I invoke the function on IBMi instance, how does the PJS.CALL connect to the the RPGLE pgm object in my library. Here's
the config file for my IBMi instance
module.exports = {
"port": 8182,
"staticFilesDirectory": "/www/profoundui/htdocs",
"pathlist": [
"pjssamples",
"KUMA",
"NEGLETTER"
],
"initialModules": {
"/hello": "pjssamples/hello",
"/hello2": "pjssamples/hello2",
"/connect4": "pjssamples/connect4",
"/crtnegltr": "negletter/crtnegltr",
"/upload": "pjssamples/upload"
},
"dbDriver": "IBMi",
"timeout": 3600
}
here's the code in the script named crtnegltr and calling an RPGLE pgm in my library
// Define Parameters
pjs.define("ordnum", { type: "char", length: 6});
pjs.define("data", { type: "char", length: 1000});
// Call Program
pjs.call("GETDATA", ordnum, data);
Here's the RPG pgm code
Columns . . . : 6 100 Browse KUMA/QRPGLESRC
SEU==> GETDATA
FMT * *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0
*************** Beginning of data ***************************************************************************************
0001.00 180404
0002.00 D getData PR EXTPGM('GETDATA') 180404
0003.00 D ORDNUM_ 6A 180404
0004.00 D DATE_ 1000A 180404
0005.00 180404
0006.00 D getData PI 180404
0007.00 D ORDNUM 6A 180404
0008.00 D DATA 1000A 180404
0009.00 180404
0010.00 180404
0011.00 /free 180404
0012.00 180404
0013.00 data = '{"ORDER_NUM": "061846", "CARRIER_NAME": "DEEP BLU,INC",' + 180404
0014.00 '"CARRIER_ADDR1":"1111Sherwin Road","CARRIER_ADDR2": " ",' + 180404
0015.00 '"CARRIER_CITY": "Winnipeg","CARRIER_STATE": "MB",' + 180404
0016.00 '"CARRIER_ZIP": "R3H OT8","CARRIER_CONTACT": "Mike Smith",' + 180404
0017.00 '"CARRIER_PHONE": "121-212-2222", "CARRIER_FAX":"212-212-3333",' + 180404
0018.00 '"CARRIER_EMAIL": "
msmith@gmail.com",' + 180404
0019.00 '"payterms": [{ "term" :"This is the first payment term"},' + 180404
0020.00 '{ "term" :"This is the second payment term"},' + 180404
0021.00 '{ "term" :"This is the third payment term"},' + 180404
0022.00 '{ "term" :"This is the fourth payment term"}' + 180404
0023.00 '] }' ; 180404
0024.00 180404
0025.00 return ; 180404
0026.00 *inlr = *on ; 180404
0027.00 /end-free 180404