<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
color:black;}
span.hoenzb
{mso-style-name:hoenzb;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Consolas","serif";
color:black;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";
color:black;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></head><body bgcolor="white" lang="EN-US" link="blue" vlink="purple"><div class="WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Nancy,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><br>Thanks for taking the time to explain everything, now I know what commands are needed and when to use them properly. I’ll change my matching to go off record # and I added a write command to the lookup that is doing the updating about 10 minutes ago and activated it live. So far no calls from the purchasing team…</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Josh</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> Nancy Palmquist [mailto:<a href="mailto:nlp@vss3.com">nlp@vss3.com</a>] <br><b>Sent:</b> Friday, June 17, 2016 11:36 AM<br><b>To:</b> Josh Reader; <a href="mailto:nancy.palmquist@vss3.com">nancy.palmquist@vss3.com</a><br><b>Cc:</b> filePro Mail Group<br><b>Subject:</b> Re: Record lock issue when performing lookup within current file</span></p></div></div><p class="MsoNormal"> </p><p class="MsoNormal" style="margin-bottom:12.0pt">Josh,</p><div><p class="MsoNormal">On 6/17/2016 11:02 AM, Josh Reader wrote:</p></div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><div><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi Nancy,</p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I believe I am doing the lookup the same way you mentioned. I am looking up by PO# via an index that sorts by PO#, Line, then Release. Then I'm stepping through all records for the PO match and only updating those releases for the line I'm on. 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). I have some questions about lookups: </p></div></blockquote><p class="MsoNormal">Better to check RECORD NUMBER than checking for matching data. You may not get the same results.<br><br></p><div><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">1. What is the rule of thumb for closing lookups? 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. </p></div><p class="MsoNormal">If you are making changes to the records, use WRITE to post the changes. When you are done with the lookup section, you can use CLOSE to release the handle to that lookup. A WRITE unlocks the record and writes the record. A CLOSE does that and in addition disconnects the connection to that file. So if you do a new lookup to that file, you have to reconnect. You will find that in a posting processes, issuing a WRITE instead of a CLOSE on each record will speed up the process in a noticeable way.<br><br>BTW - CLOSING at @RS eq @TS is a waste of effort since the end of the process will close everything anyway. But you should issue WRITE commands on each record as you complete your posting to that lookup.<br><br></p><div><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">2. Does the close command affect anything with record locking? </p></div><p class="MsoNormal">YES - CLOSE unlocks the record as does WRITE.<br><br></p><div><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks,<br>Josh</p></div><div><p class="MsoNormal"> </p><div><p class="MsoNormal">On Fri, Jun 17, 2016 at 10:33 AM, Nancy Palmquist via Filepro-list <<a href="mailto:filepro-list@lists.celestial.com">filepro-list@lists.celestial.com</a>> wrote:</p><p class="MsoNormal">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:</p><p class="MsoNormal" style="margin-bottom:12.0pt">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">rkreiss@verizon.net</a>> wrote:</p><p class="MsoNormal" style="margin-bottom:12.0pt">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></p><p class="MsoNormal">-----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</p><p class="MsoNormal">Reader via</p><p class="MsoNormal">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</p><p class="MsoNormal">into some</p><p class="MsoNormal">lock issues. Currently when our buyers have a PO line with multiple</p><p class="MsoNormal">releases they</p><p class="MsoNormal">have to manually add the total cost of the line and then hand-type that</p><p class="MsoNormal">into</p><p class="MsoNormal">filePro for each release. If they make a mistake, then they have to</p><p class="MsoNormal">touch all</p><p class="MsoNormal">releases on the line to manually synchronize the line cost. I added</p><p class="MsoNormal">code to do a</p><p class="MsoNormal">lookup within the file and to only apply for my own ID while I tested</p><p class="MsoNormal">it. During</p><p class="MsoNormal">test everything worked perfectly.<br>I didn’t have to enter the line cost field at all. As I added releases</p><p class="MsoNormal">it</p><p class="MsoNormal">automatically added the totals and then went back through the other</p><p class="MsoNormal">records</p><p class="MsoNormal">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</p><p class="MsoNormal">message</p><p class="MsoNormal">saying waiting for record # to unlock. I commented out the subroutine</p><p class="MsoNormal">that runs</p><p class="MsoNormal">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</p><p class="MsoNormal">sync a</p><p class="MsoNormal">field across multiple records of a file that<br>2-3 people are adding records to regularly? If so what is the proper</p><p class="MsoNormal">way to do</p><p class="MsoNormal">the lookup?<br><br>Below is the subroutine that does 2 lookups. The first lookup adds up</p><p class="MsoNormal">the qty</p><p class="MsoNormal">and cost for the line and stores them in variables. The second lookup</p><p class="MsoNormal">applies</p><p class="MsoNormal">those values to all releases for the line. This happened a few weeks</p><p class="MsoNormal">ago and I</p><p class="MsoNormal">believe I removed the close command from the lookups thinking that may</p><p class="MsoNormal">make</p><p class="MsoNormal">a difference but hadn’t tested it since then. Also I’m using the same</p><p class="MsoNormal">lookup</p><p class="MsoNormal">name but it is my understanding that only one lookup to a file is</p><p class="MsoNormal">allowed at once</p><p class="MsoNormal">and when a second lookup is invoked the first one closes automatically.</p><p class="MsoNormal">We are</p><p class="MsoNormal">on filePro v5.8 running on CentOS 7. Any help would be greatly</p><p class="MsoNormal">appreciated.</p><p class="MsoNormal"><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-" 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" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a></p><p class="MsoNormal"> </p><p class="MsoNormal">-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <<a href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20160615/4d768f00/attachment.html" 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" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a></p><p class="MsoNormal"><span style="color:#888888"><br><span class="hoenzb">-- </span><br><span class="hoenzb">Nancy Palmquist MOS & filePro Training Available</span><br><span class="hoenzb">Virtual Software Systems Web Based Training and Consulting</span><br><span class="hoenzb">PHONE: (412) 835-9417 Web site: <a href="http://www.vss3.com">http://www.vss3.com</a></span><br><br><span class="hoenzb">_______________________________________________</span><br><span class="hoenzb">Filepro-list mailing list</span><br><span class="hoenzb"><a href="mailto:Filepro-list@lists.celestial.com" target="_blank">Filepro-list@lists.celestial.com</a></span><br><span class="hoenzb">Subscribe/Unsubscribe/Subscription Changes</span><br><span class="hoenzb"><a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a></span></span></p></div><p class="MsoNormal"> </p></div><p class="MsoNormal"><br><br></p><pre>-- </pre><pre>Nancy Palmquist MOS & filePro Training Available</pre><pre>Virtual Software Systems Web Based Training and Consulting </pre><pre>PHONE: (412) 835-9417 Web site: <a href="http://www.vss3.com">http://www.vss3.com</a> </pre></div></body></html>