Hello,
I have a python script calling a CL program, GETIPADDR. The CL program is created using CRTBNDCL and expects two parameters:
JOBNAME - 26 character
IPV4ADDR - 15 character
If I run the CL from a 5250 session and in debug mode with:
CALL PGM(GETIPADDR) PARM('QPADEV000CGROBINSO 123456' ' ')
I can see that the IPV4ADDR parameter has been populated when I have a breakpoint on the ENDPGM statement.
When calling the CL using iToolKit I do not see the returned value in the IPV4ADDR field. The iToolKit call to the CL program returns successfully.
I am using the following:
from itoolkit import *
from itoolkit.lib.ilibcall import *
itool.add(
iPgm('my_results',' GETIPADDR')
.addParm(iData('JOBNAME','26a','QPADEV000CGROBINSO 123456'))
.addParm(iData('IPV4ADDR','15a',' '))
)
itool.call(itransport)
mypgm_results = itool.dict_out('my_results')
print(mypgm_results)
if 'success' in mypgm_results:
print('Success!')
else:
print('Errors occurred.')
print('\n')
print("Job Name: ", mypgm_results['JOBNAME'])
print("IP V4 Address: ", mypgm_results['IPV4ADDR'])
print("Status of the program call: ", mypgm_results['success'])
I have used the code at this URL as my template
Guru: Calling RPG Programs From Python, Part 1 - IT JungleThis example uses iToolKit to call an RPG program to return a value and I was hoping it would be the same for CL.
So, how do I use iToolKit to return a parameter value from a CL program?
------------------------------
Glenn Robinson
------------------------------