I wrote a quick test program to lock a record. When I run it the first time, no problems. When I run it a second time, I get RNX1211 - I/O operation was applied to closed file PFDLRREPS. Why?
**free
/if defined(*crtRPGBND)
ctl-opt actGrp(*new) dftActGrp(*no);
/endIf
ctl-opt main(entry) option(*noDebugIO);
dcl-f pfDlrReps keyed usage(*update);
dcl-proc entry;
dcl-pi entry extPgm('T_REP_LOCK');
dealer char(6);
end-Pi;
dcl-s response char(1);
chain dealer dealerReps;
if %found();
drAuth = 'lock';
dsply 'Rec locked until you press enter' '' response;
update dealerReps;
endIf;
close pfDlrReps;
end-Proc;
#Support#IBMi#SupportMigration