Snippets
Created by
Aaron Bartell
last modified
Andrei Tyuhai
Going the iDB2Call route works in chroot (done on Litmis Spaces). I've probably broken some Python rules with my itool.call(...)
line :-)
File rtvjoba.py:
from itoolkit import *
from itoolkit.db2.idb2call import *
import ibm_db
itool = iToolKit(iparm=0, iret=0, ids=1, irow=0)
itool.add( iCmd('rtvjoba', 'RTVJOBA USRLIBL(?) SYSLIBL(?) CCSID(?N) OUTQ(?)', {'error':'on'}) )
itool.call( iDB2Call( ibm_db.connect("*LOCAL", None, None) ) )
rtvjoba = itool.dict_out('rtvjoba')
print (rtvjoba)
if 'error' in rtvjoba:
print (rtvjoba['error'])
exit()
else:
print('USRLIBL = ' + rtvjoba['USRLIBL'])
print('SYSLIBL = ' + rtvjoba['SYSLIBL'])
print('CCSID = ' + rtvjoba['CCSID'])
print('OUTQ = ' + rtvjoba['OUTQ'])
Output:
% python rtvjoba.py
{'SYSLIBL': 'QSYS QSYS2 QHLPSYS QUSRSYS', 'USRLIBL': 'QGPL QTEMP', 'CCSID': '37', 'success': '+++ su
ccess RTVJOBA USRLIBL(?) SYSLIBL(?) CCSID(?N) OUTQ(?)', 'OUTQ': '*DEV'}
USRLIBL = QGPL QTEMP
SYSLIBL = QSYS QSYS2 QHLPSYS QUSRSYS
CCSID = 37
OUTQ = *DEV
Comments (0)
You can clone a snippet to your computer for local editing. Learn more.