<div dir="ltr">

<p class="">Hi Nancy,</p>

<p class="">
I believe I am doing the lookup the same way you mentioned.<span style="mso-spacerun:yes">  </span>I am looking up by PO# via an index that
sorts by PO#, Line, then Release.<span style="mso-spacerun:yes">  </span>Then
I'm stepping through all records for the PO match and only updating those
releases for the line I'm on.<span style="mso-spacerun:yes">  </span>I'm also
skipping the record I'm standing on by checking to see if the release #'s match
(I'm already matched for PO# and line # at this point so it is unique).<span style="mso-spacerun:yes">  </span>I have some questions about lookups: <br></p>

<p class="">1.<span style="mso-spacerun:yes">  </span>What is the
rule of thumb for closing lookups?<span style="mso-spacerun:yes">   </span>I
used to close them every time but now I find things run faster if I put a line
that says IF @RS eq @TS, then close. That way I close it at the end on the last
record.<span style="mso-spacerun:yes">  </span></p>

<p class="">2.<span style="mso-spacerun:yes">  </span>Does the close
command affect anything with record locking?<span style="mso-spacerun:yes"> 
</span></p>

<p class="">Thanks,<br>Josh</p>

</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 17, 2016 at 10:33 AM, Nancy Palmquist via Filepro-list <span dir="ltr"><<a href="mailto:filepro-list@lists.celestial.com" target="_blank">filepro-list@lists.celestial.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Josh,<br>
<br>
If you are sitting on one record in a group and you want to update all the records in that group, you can do lookups to each record and before trying to post to them, check to see if the record you just found is the current record number.<br>
<br>
For example,<br>
<br>
lookup mypo=myporecords k=(ponum) i=a -nxp      'index A is built on PO Number and variable ponum is defined appropriately.<br>
loopit  If not mypo<br>
        Then: goto finish<br>
       if: mypo(1){"~" ne 1{"~"   'assumed number might be literal<br>
    then;goto finish<br>
        if: mypo(@rn) eq @rn                    'this is checking to see if I am looking at myself<br>
       then: 5=5+whatever;getnext mypo;goto loopit<br>
    If:                                                    'this is updating all the others.<br>
    then: mypo(5)=mypo(5)+whatever;getnext mypo;goto loopit<br>
<br>
All this assumes you are on one of the records assigned to that PONumber that you want to adjust.<br>
<br>
Some things might cause this to conflict with other users.  You want to do your lookup in such  way that you start on your PO number and go next to next until you hit the next po number and then stop.  If you are looking at all the records, you could certainly hit another user's record.<br>
<br>
I hope my rough programming is readable.<br>
<br>
Another way to deal with record locking is to put the users in another file entirely and just do lookups to the file(s) in question.  I use this method on complex processing and I know one user is never going to be dealing with the data another user might use.  Eliminates all kinds of issues, but the programming can be a bit more complex since all data must be pulled in, processed and written out again.<br>
<br>
Nancy<br>
<br>
<br>
<br>
On 6/15/2016 4:57 PM, Josh Reader via Filepro-list wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
1.  CentOS 7 and filePro v5.8<br>
<br>
2.  It's triggered on save<br>
<br>
3.  Yes there could be someone else updating or creating a new record but<br>
it shouldn't be for the same PO #<br>
<br>
On Wed, Jun 15, 2016 at 4:47 PM, Richard Kreiss <<a href="mailto:rkreiss@verizon.net" target="_blank">rkreiss@verizon.net</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
First Question: what Operating system and version of filePro are being run?<br>
<br>
Second question: Is this subroutine triggered by an @key?  If so, that<br>
will lock the record the user is looking at.  There really is no way around<br>
that issue.<br>
<br>
Third Question: Are multiple people putting in details at the same time as<br>
someone is trying to run this routine?<br>
<br>
<br>
Richard Kreiss<br>
GCC Consulting<br>
<br>
<br>
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-----Original Message-----<br>
From: Filepro-list [mailto:<a href="mailto:filepro-list-" target="_blank">filepro-list-</a><br>
bounces+rkreiss=<a href="mailto:verizon.net@lists.celestial.com" target="_blank">verizon.net@lists.celestial.com</a>] On Behalf Of Josh<br>
</blockquote>
Reader via<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Filepro-list<br>
Sent: Wednesday, June 15, 2016 3:27 PM<br>
To: filePro Mail Group <<a href="mailto:filepro-list@lists.celestial.com" target="_blank">filepro-list@lists.celestial.com</a>><br>
Subject: Record lock issue when performing lookup within current file<br>
<br>
Hi All,<br>
<br>
I am trying to program a feature for our purchasing dept and running<br>
</blockquote>
into some<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
lock issues.  Currently when our buyers have a PO line with multiple<br>
</blockquote>
releases they<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
have to manually add the total cost of the line and then hand-type that<br>
</blockquote>
into<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
filePro for each release.  If they make a mistake, then they have to<br>
</blockquote>
touch all<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
releases on the line to manually synchronize the line cost.  I added<br>
</blockquote>
code to do a<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
lookup within the file and to only apply for my own ID while I tested<br>
</blockquote>
it. During<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
test everything worked perfectly.<br>
I didn’t have to enter the line cost field at all.  As I added releases<br>
</blockquote>
it<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
automatically added the totals and then went back through the other<br>
</blockquote>
records<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and synchronized as expected.   Once I made it live however, and multiple<br>
people were using it at the same time, I started getting calls about a<br>
</blockquote>
message<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
saying waiting for record # to unlock.  I commented out the subroutine<br>
</blockquote>
that runs<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the sync after the screen command @update, got everyone back to the main<br>
menu and in again and they proceeded on the old way.  Is it possible to<br>
</blockquote>
sync a<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
field across multiple records of a file that<br>
2-3 people are adding records to regularly?  If so what is the proper<br>
</blockquote>
way to do<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the lookup?<br>
<br>
Below is the subroutine that does 2 lookups.  The first lookup adds up<br>
</blockquote>
the qty<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and cost for the line and stores them in variables.  The second lookup<br>
</blockquote>
applies<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
those values to all releases for the line.  This happened a few weeks<br>
</blockquote>
ago and I<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
believe I removed the close command from the lookups thinking that may<br>
</blockquote>
make<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
a difference but hadn’t tested it since then.  Also I’m using the same<br>
</blockquote>
lookup<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
name but it is my understanding that only one lookup to a file is<br>
</blockquote>
allowed at once<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and when a second lookup is invoked the first one closes automatically.<br>
</blockquote>
We are<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
on filePro v5.8 running on CentOS 7.  Any help would be greatly<br>
</blockquote>
appreciated.<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
syncLN:' ---------------------------------------------------------------:<br>
' Subroutine to sync line qty and line cost:<br>
:' Set variables for line cost and line qty :lc=79; lq=43:<br>
:' Lookup within reqform by po #<br>
:lookup req = reqform  k=24   i=E -nx:<br>
:loopSYN:not req<br>
:goto syncLN2:<br>
:req(24) ne 24           ' PO #'s no longer match, return<br>
:goto syncLN2:<br>
:req(22) ne 22           ' Lines are not equal, get next record<br>
:getnext req; goto loopSYN:<br>
:req(23) eq 23           ' Don't access current record<br>
:getnext req; goto loopSYN:<br>
:' Add line cost and line qty<br>
:lc=lc+req(79); lq=lq+req(43):<br>
:' Get next record in lookup and process it :getnext req; goto loopSYN:<br>
syncLN2:' Lookup within reqform by po #<br>
:lookup req = reqform  k=24   i=E -npx:<br>
loopSY2:not req<br>
:return:<br>
:req(24) ne 24           ' PO #'s no longer match, return<br>
:return:<br>
:req(22) ne 22           ' Lines are not equal, get next record<br>
:getnext req; goto loopSY2:<br>
:req(23) eq 23           ' Don't access current record<br>
:getnext req; goto loopSY2:<br>
:' Update record with line cost and qty<br>
:req(78)=lc; req(44)=lq:<br>
:' Get next record in lookup and process it :getnext req; goto loopSY2:<br>
<br>
<br>
Thanks,<br>
Josh<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.celestial.com/pipermail/filepro-" rel="noreferrer" target="_blank">http://mailman.celestial.com/pipermail/filepro-</a><br>
list/attachments/20160615/9c378937/attachment.html><br>
_______________________________________________<br>
Filepro-list mailing list<br>
<a href="mailto:Filepro-list@lists.celestial.com" target="_blank">Filepro-list@lists.celestial.com</a><br>
Subscribe/Unsubscribe/Subscription Changes<br>
<a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" rel="noreferrer" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
</blockquote>
<br>
</blockquote>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20160615/4d768f00/attachment.html" rel="noreferrer" target="_blank">http://mailman.celestial.com/pipermail/filepro-list/attachments/20160615/4d768f00/attachment.html</a>><br>
_______________________________________________<br>
Filepro-list mailing list<br>
<a href="mailto:Filepro-list@lists.celestial.com" target="_blank">Filepro-list@lists.celestial.com</a><br>
Subscribe/Unsubscribe/Subscription Changes<br>
<a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" rel="noreferrer" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Nancy Palmquist         MOS & filePro Training Available<br>
Virtual Software Systems    Web Based Training and Consulting<br>
PHONE: (412) 835-9417           Web site:  <a href="http://www.vss3.com" rel="noreferrer" target="_blank">http://www.vss3.com</a><br>
<br>
_______________________________________________<br>
Filepro-list mailing list<br>
<a href="mailto:Filepro-list@lists.celestial.com" target="_blank">Filepro-list@lists.celestial.com</a><br>
Subscribe/Unsubscribe/Subscription Changes<br>
<a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" rel="noreferrer" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
</font></span></blockquote></div><br></div>