dknf

brian at aljex.com brian at aljex.com
Tue Apr 10 21:02:53 PDT 2007


I have what should be a simple process.
Given two values (extracted from the text of a pdf from a zip from a mime
attachment by a script called from a users ~/.forward), I want to use one value
to jump to a single matching record in a file (if any), then update a field with
the other value, then exit without looking at any other records.


filepro file usda_inspect has this record:
@rn=148 1=7005564 62=T-011-0290-00605

index A is built on field 1     (9,.0)
index I is built on field 62    (16,*)
several other indexes are built on other fields and a few are multi-field
indexes.

prc.import_certificate:
-------------------------------
  If:
Then: l(9,.0,g)=getenv("LOT") ; t(16,,g)=getenv("TKT")

  If: l eq ""
Then: exit "1"

  If:
Then: lookup - k=l i=A -npx

  If: not -
Then: exit "1"

  If: 62 eq t
Then: exit "0"

  If:
Then: 62 = t

  If:
Then: exit "0"
----------------------------------


and this process is run with this command:

LOT=7005564 TKT=T-011-0290-00608 rreport usda_inspect -fp import_certificate -y
NoAuto -u -a

there is no prc.NoAuto
no index or selection set or selection processing


if field 62 is not touched, no problem.
if field 62 starts out empty and this process fills it, no problem.
if field 62 contains a value and this process changes or empties it,
dknf:


| Deleted key is not found
|
| Index = usda_inspect/index.I
| Key = "T-011-0290-00605"
| recno = 148
| tptr = 0, 1, 3, 1, 0

The value in key= is the value that was in field 62 before the edit.

when run in dreport ... -db
the process does all exactly as I want, starts, jumps to record 148, updates 62,
and the dknf only happens after hitting enter on the final exit "0"

record 148 happens to be the highest record number in the file so I did try the
same tests on some other records and it behaves exactly the same.

starting: @rn=109 1=157000 62=""

# LOT=157000 TKT=test rreport usda_inspect -fp import_certificate -y NoAuto -u
-a
no problem

# LOT=157000 TKT= rreport usda_inspect -fp import_certificate -y NoAuto -u -a
dknf

| Index = usda_inspect/index.I
| Key = "test            "
| recno = 109
| tptr = 0, 1, 3, 1, 0


In all cases the field I want to update does get updated the way I want, and no
other fields (such as the neighboring or any other record) get screwed up, and
so if I set PFMBTO=1 and direct stdout & stderr to null (it's a background
process triggered by receiving email) then I actually get what I want.

fp 5.0.14, opensuse linux 10.2 x86_64
machine has been in production several months with no notable weirdness so
binaries/filesystem/ram/64bit-ness etc... all probably ok

What am I missing? Why must I get, and ignore, a dknf?
It looks completely legal.

bkw

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


More information about the Filepro-list mailing list