Help list...
Below is a job listing that I setup to remove some bad records from a KSAM
file (classic).
When I run it once, I get confirmation that the keys are found, but when I
fcopy from the ksam file to a flat file, the records are still there. Now, I
run it again, and I get the message that the key is not found! I understand
that ksam records get flagged for deletion, not really deleted, but all the
applications on the system still see the "deleted" records.
What am I missing?
!job agenxcln,mgr.cu1,data
!
!purge except
!
!mpex
listf ksgenxrf,2
setvar infile vefopen('cvmicr.data,old;acc=in')
setvar ksgfile vefopen('ksgenxrf,old;acc=update;shr;multi;lock')
setvar outfile vefopen('except,new;build;rec=-120,,f,ascii;acc=out;&
disc=7000')
while vefreadv("rec",infile) do
echo Info: Processing record: !rec
setvar kskey ntoken (rec,1," ")
if (veffindbykey(ksgfile,kskey,1,"=")) then
echo Info: Record found, deleting.
calc veflock(ksgfile,TRUE)
calc VEFREMOVE(ksgfile)
calc vefunlock(ksgfile)
else
setvar outrec "NO KEY FOUND IN KSGENXRF FOR: " + kskey
calc vefwrite(outfile,outrec)
echo Warning: Record not found, writing exception.
endif
calc vefreadv("rec",infile)
endwhile
calc vefclose(infile)
calc vefclose(outfile,"save")
calc vefclose(ksgfile)
listf ksgenxrf,2
exit
!eod
!
!tellop *** !hpjobname has finished ***
!eoj
Thanks,
Paul Scott
Problem Solved
(707) 451-2611
[log in to unmask]
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|