IBM / python-itoolkit

itoolkit is a Python interface to the XMLSERVICE toolkit for the IBM i platform.
MIT License
19 stars 13 forks source link

Error calling Receive DataQ API - QRCVDTAQ #86

Closed sgonchigar closed 1 year ago

sgonchigar commented 1 year ago

python -c "import itoolkit; print(itoolkit.version)"
1.6.1
python -V
Python 3.6.12 OS400 = 7.4 /qsys.lib/qxmlserv.lib/xmlver.pgm XML Toolkit 2.0.2-dev

from itoolkit import * from itoolkit.transport import DatabaseTransport import ibm_db_dbi import json

conn = ibm_db_dbi.connect() itransport = DatabaseTransport(conn) itool = iToolKit()

itool.add( iPgm('pgm_results','QRCVDTAQ') .addParm(iData('paDtaqNam','10a','SC3270DQI')) .addParm(iData('paDtaqLib','10a','TESTSG')) .addParm(iData('paDtaqLen','5p0','0')) .addParm(iData('paDtaqDta','5000','')) .addParm(iData('pnWaitTme','5p0','5')) .addParm(iData('paKeyorder','2a','EQ')) .addParm(iData('pnDtaqKeyLen','3p0','50')) .addParm(iData('paDtaqKeyDta','50a','jobkey')) )

itool.call(itransport)

mypgm_results = itool.dict_out('pgm_results')

Pretty Printing JSON string back

print(json.dumps(mypgm_results, indent = 4)) print('\n')


Output: {
"error": "** error QRCVDTAQ",
"version": "XML Toolkit 2.0.2-dev",
"xmlhint": "p(320) <data type=\"5000\" var=\"paDtaqDta\"/>",
"xmlhint1": "p(345) <data type=\"5000\" var=\"paDtaqDta\"/",
"xmlhint2": "p(345) 0000000000000000",
"xmlhint3": "p(320) <parm io=\"both\" var=\"p4\"",
"xmlhint4": "p(320) <data type=\"5000\" var=\"paDtaqDta\"/>",
"xmlhint5": "<pgm error=\"fast\" name=\"QRCVDTAQ\" var=\"pgm_results\"><parm i", "xmlhint6": "p(320) <parm io=\"both\" var=\"p4\"",
"xmlhint7": "p(320) <data type=\"5000\" var=\"paDtaqDta\"/>",
"jobipc": "
na",
"jobipcskey": "FFFFFFFF",
"jobname": "QSQSRVR",
"jobuser": "QUSER",
"jobnbr": "191004",
"curuser": "SGONCHIGAR",
"ccsid": "37",
"dftccsid": "37",
"paseccsid": "819",
"syslibl": "SSSYS QSYS QSYS2 QHLPSYS QUSRSYS", "usrlibl": "QTEMP ..............." }

kadler commented 1 year ago

Looks like it's complaining about your definition of paDtaqDta. Does it work if you change to 5000a?

sgonchigar commented 1 year ago

Thank you. That was it. It worked.