If this occasional problem is consistently the same lines then just
validate the insert afterwards:

0106.1 MV.CNT = DCOUNT(SUPREC<2>,@VM)
0107: SUPREC = INSERT(SUPREC,2,1,0,POLREC<6>)
0107.1 IF SUPREC<2,1> NE POLREC<6> THEN
0107.2    MV.CNT2 = DCOUNT(SUPREC<2>,@VM)
0107.3    IF MV.CNT = MV.CNT2 THEN GOSUB REPORT.ERROR
0107.4 END

With this logic, you're verifying the value and that a new value is, in
fact, being created in the attribute.  You may want to tweak the logic a
bit to match your exact specifics, like if POLREC<6> is a non-null
value, but this should give you an idea.

BobW

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of dale kelley
Sent: Friday, July 26, 2013 6:42 AM
To: U2 Users List
Subject: Re: [U2] [UD] BASIC Code Failing

This is all very interesting to hear.  I have a customer who has
occasional instances when they complain that a supply receipt has failed
to update the "last receipt" fields.  This is the code:

0092: 
***********************************************************************
0093: 7000:* UPDATE SUPPLIES
0094: 
***********************************************************************
0095: SUPKEY = POLREC<2>
0096: GOSUB 7300   * reads suprec
0097: IF SUPREC EQ "" THEN
0098:    RETURN
0099: END
0100: SUPREC<16,1> = SUPREC<16,1> + OCONV(POLREC<13,RCPSUB>,"MD4")
0101: NEWQTY = 0
0102: LOCCNT = DCOUNT(SUPREC<15>,@VM)
0103: FOR LOCSUB = 1 TO LOCCNT
0104:    NEWQTY = NEWQTY + SUPREC<16,LOCSUB>
0105: NEXT LOCSUB
0106: SUPREC<3> = NEWQTY
0107: SUPREC = INSERT(SUPREC,2,1,0,POLREC<6>)
0108: SUPREC = INSERT(SUPREC,11,1,0,POLREC<11,RCPSUB>)
0109: SUPREC = INSERT(SUPREC,12,1,0,FIELD(POLKEY,".",1))
0110: SUPREC = INSERT(SUPREC,13,1,0,VNDKEY)
0111: GOSUB 7400    * writes suprec
0112: RETURN
----:

I have never been able to figure out why line 106 gets executed but 107
- 110 do not.

My customer refers to it as "the lawnmower man".

dale

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to