Unparsable results from stored proc call

Issue #18 resolved
Jesse G created an issue

I encounter a JSON parsing error when trying to run QSH commands via "CALL DB2JSON.DB2PROCJR(?)"

Position 62 seems to be the first newline, but there seem to be issues beyond that, with "R2" (row 2) starting mid-row on later records

***********************************************
*****JSON PARSE ERROR: SyntaxError: Unexpected token
 in JSON at position 62
***********
in:
{"script":[{"cmd":{"qsh":"ls -1 /QOpenSys"}}]}
********************
output (unparsable):
{"script":[{"cmd":["ls -1 /QOpenSys",{"records":[{"R1":"austin
austin.20180129.105931.tmp
austin.20180129.105949.tmp
bin
build"},{"R2":"r
c"},{"R3":"rt
c"},{"R4":"rt.crt
c"},{"R5":"rt.k"},{"R6":"y
c"},{"R7":"rt.p12
c"},{"R8":"rtificat"},{"R9":".p12
c"},{"R10":"rtificat"},{"R11":".p"},{"R12":"m
chroot1
db2sock
d"},{"R13":"v
"},{"R14":"tc
git
git."},{"R15":"nv
git.job
git.log
hom"},{"R16":"
j"},{"R17":"nkins
lib
lib64
myd"},{"R18":"bug.txt
n"},{"R19":"w_chroot
nod"},{"R20":"4
nod"},{"R21":"6
opt
pkgs
QIBM
QOp"},{"R22":"nSys
QOp"},{"R23":"nSys.bak
QSR
rang"},{"R24":"r
sbin
tmp
tools
tools-int"},{"R25":"rnal
usr
vac101
var
yum
yum2
z"},{"R26":"nd5
z"},{"R27":""}]}]}]}

The following is the actual result of running this command in an SSH terminal:

QIBM
QOpenSys
QOpenSys.bak
QSR
austin
austin.20180129.105931.tmp
austin.20180129.105949.tmp
bin
builder
cert
cert.crt
cert.key
cert.p12
certificate.p12
certificate.pem
chroot1
db2sock
dev
etc
git
git.env
git.job
git.log
home
jenkins
lib
lib64
mydebug.txt
new_chroot
node4
node6
opt
pkgs
ranger
sbin
tmp
tools
tools-internal
usr
vac101
var
yum
yum2
zend5
zend7

Comments (3)

  1. Former user Account Deleted

    remote ... qsh ls -l (laptop db2procjr)

    Ok, fix for remote via db2procjr (laptop).

    • Yips Super Driver - test driver - 1.1.2-sg9 - remote db2procjr various differences (Jesse G.)

    Generally, stored procedure db2procjr path was intended for remote development. Not an async interface. Many CCSID, other problems, slow, etc. Should work, but not tested much by me. Thanks for help.

    =============================
    test5000_sql400json_procjr64 ../json/j0361_cmd_qsh_ls
    =============================
    input(5000000):
    {"cmd":{"qsh":"ls -1 /QOpenSys"}}
    
    
    output(855):
    {"script":[{"cmd":["ls -1 /QOpenSys",
    {"records":[
    {"R1":"QIBM"},
    {"R2":"QOpenSys"},
    {"R3":"QOpenSys.bak"},
    {"R4":"QSR"},
    {"R5":"austin"},
    {"R6":"austin.20180129.105931.tmp"},
    {"R7":"austin.20180129.105949.tmp"},
    {"R8":"bin"},
    {"R9":"builder"},
    {"R10":"cert"},
    {"R11":"cert.crt"},
    {"R12":"cert.key"},
    {"R13":"cert.p12"},
    {"R14":"certificate.p12"},
    {"R15":"certificate.pem"},
    {"R16":"chroot1"},
    {"R17":"db2sock"},
    {"R18":"dev"},
    {"R19":"etc"},
    {"R20":"git"},
    {"R21":"git.env"},
    {"R22":"git.job"},
    {"R23":"git.log"},
    {"R24":"home"},
    {"R25":"jenkins"},
    {"R26":"lib"},
    {"R27":"lib64"},
    {"R28":"mydebug.txt"},
    {"R29":"new_chroot"},
    {"R30":"node4"},
    {"R31":"node6"},
    {"R32":"opt"},
    {"R33":"pkgs"},
    {"R34":"ranger"},
    {"R35":"sbin"},
    {"R36":"tmp"},
    {"R37":"tools"},
    {"R38":"tools-internal"},
    {"R39":"usr"},
    {"R40":"vac101"},
    {"R41":"var"},
    {"R42":"yum"},
    {"R43":"yum2"},
    {"R44":"zend5"},
    {"R45":"zend7"}]}]}]}
    
    result:
    success (0)
    
  2. Log in to comment