PDA

View Full Version : Clear columns 1-5 in Source Member



kitvb1
5th February 2009, 20:47
To clear columns 1-5 in a source member:


cl: OVRDBF FILE(qrpglesrc) TOFILE(mylib/qrpglesrc) MBR(mymbr);
Update QRPGLESRC a
set a.srcdta = ' ' concat substr(a.srcdta, 6, 100)
where substr(a.srcdta, 1, 5) <> ' '
and a.srcseq < (select min(b.srcseq)
from qrpglesrc b
where substr(b.srcdta, 1, 2) = '**')


Notes:
If in a batch program, you will need to add an OVRSCOPE to the override command.
This will only remove entries until the first '**' (possible CTDATA entry) is found.

kitvb1
15th August 2009, 08:07
The code posted was run from Navigator - including the CL:... - hence the ";" at the end of the statement and no OVRSCOPE.