Here's the thing I did to get UTF-8 output in QShell, which doesn't
natively do that - this is in a RPGLE program where I have to modify a
value in an XML file (for and XLSX file) that I don't know until I've
finished processing all the rows.
sedCmd = 'QSH CMD(+
''export QIBM_CCSID=1208 +
&& sed "' + %char(pLineFrom) + ',' +
' s/' + pSearchFor +
'/' + pReplaceWith + '/';
sedCmd += 'g';
sedCmd += '" ' + pFile + ' > /tmp/temp' + jobNbr + '.tmp +
&& mv /tmp/temp' + jobNbr + '.tmp ' + pFile + ''')';
The command becomes something like this -
export QIBM_CCSID=1208 && sed "5, 6 s/tagname/realvalue/g" pFile >
/tmp/temp123456.tmp && mv /tmp/temp123456.tmp pFile
The point here is that the && continuations put everything in the same
QShell job - I think that mattered when I first found this solution for
replacing the changes from sed into the from file - Qshell version of
sed does not have the "replace-in-place" option that other versions of
sed do - and I don't remember if PASE' version does, or if there were
other problems I had.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.