Yes, you will delete the record after you write a copy out to TRCMASRR
:
C DELETE OEORH4R
You will want to delete the record format name, not the file name. In my code above I've assumed the record format name in OEORH4
is OEORH4R
.
My guess is you would also want to delete all addresses, etc. that are related to the customer record you're deleting. Otherwise you end up having "orphans"...
Also, in your *INZSR
I recommend you clear your files in a more efficient manner. Make TRCMA1
, VRCST1
and ZDRES1
USROPN
files like this:
FTRCMA1 UF A E K DISK USROPN
FVRCST1 UF A E K DISK USROPN
FZDRES1 UF A E K DISK USROPN
and then use QCMDEXC
to execute a CLRPFM *LIBL/TRCMA1
, CLRPFM *LIBL/VRCST1
and CLRPFM *LIBL/ZDRES1
. And of course you would have to OPEN
all three files afterwards.
This will be faster than deleting each record individually and could have some other benefits as well depending on how the files are set up.