Closed arun-01 closed 4 years ago
My guess would be that you substitute the literals with the name of your Python variables, eg.
itool.add(
iPgm('mykey','MYPGM')
.addParm(iData('parm1','10p0',python_var1))
.addParm(iData('parm2','5p0',python_var2))
)
Hi, Thanks for your response. I already tried that way and it didn't work and throwing an error.
It worked for me when I passed a python variable as data to a char parameter.
If your python parameter is numeric, you could try and convert it using "str(num_py_var)".
Hi, I did try converting to string and it works. Thanks a lot for your assistance. So the way to pass numeric values is by casting them. Arun
I've opened #43 to fix this and make clear what the issue is.
Hi,
is there a way to pass variables with addParm of ipgm call instead of quoted values. I checked the documentation, but the examples show using quoted strings for passing values.
For example in the above code I would like to use parm1 & parm2 values to be based on variables defined in my python script dynamically for each call instead of quoted values 345859 and 1253 from above.
I am using XMLSERVICE db2 call for above and running python 3.6.8 in virtual environment on V7R3 machine. Appreciate your suggestions/help.
Thanks, Arun