<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Josh,<br>
    <br>
    <div class="moz-cite-prefix">On 6/17/2016 11:02 AM, Josh Reader
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAAYW6uTrtq1ar8XAjkwvDAekgd-MmP5eHrgakaAOCcfynWH-FA@mail.gmail.com"
      type="cite">
      <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>
      </div>
    </blockquote>
    Better to check RECORD NUMBER than checking for matching data.  You
    may not get the same results.<br>
    <blockquote
cite="mid:CAAYW6uTrtq1ar8XAjkwvDAekgd-MmP5eHrgakaAOCcfynWH-FA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <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>
      </div>
    </blockquote>
    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>
    <blockquote
cite="mid:CAAYW6uTrtq1ar8XAjkwvDAekgd-MmP5eHrgakaAOCcfynWH-FA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <p class="">2.<span style="mso-spacerun:yes">  </span>Does the
          close
          command affect anything with record locking?<span
            style="mso-spacerun:yes"> <br>
          </span></p>
      </div>
    </blockquote>
    YES - CLOSE unlocks the record as does WRITE.<br>
    <blockquote
cite="mid:CAAYW6uTrtq1ar8XAjkwvDAekgd-MmP5eHrgakaAOCcfynWH-FA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <p class=""><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
              moz-do-not-send="true"
              href="mailto:filepro-list@lists.celestial.com"
              target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:filepro-list@lists.celestial.com">filepro-list@lists.celestial.com</a></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
                moz-do-not-send="true" href="mailto:rkreiss@verizon.net"
                target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:rkreiss@verizon.net">rkreiss@verizon.net</a></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 moz-do-not-send="true"
                    href="mailto:filepro-list-" target="_blank">filepro-list-</a><br>
                  bounces+rkreiss=<a moz-do-not-send="true"
                    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 moz-do-not-send="true"
                    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 moz-do-not-send="true"
                    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 moz-do-not-send="true"
                    href="mailto:Filepro-list@lists.celestial.com"
                    target="_blank">Filepro-list@lists.celestial.com</a><br>
                  Subscribe/Unsubscribe/Subscription Changes<br>
                  <a moz-do-not-send="true"
                    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 moz-do-not-send="true"
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 moz-do-not-send="true"
                href="mailto:Filepro-list@lists.celestial.com"
                target="_blank">Filepro-list@lists.celestial.com</a><br>
              Subscribe/Unsubscribe/Subscription Changes<br>
              <a moz-do-not-send="true"
                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
                  moz-do-not-send="true" href="http://www.vss3.com"
                  rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://www.vss3.com">http://www.vss3.com</a></a><br>
                <br>
                _______________________________________________<br>
                Filepro-list mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:Filepro-list@lists.celestial.com"
                  target="_blank">Filepro-list@lists.celestial.com</a><br>
                Subscribe/Unsubscribe/Subscription Changes<br>
                <a moz-do-not-send="true"
                  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>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Nancy Palmquist         MOS & filePro Training Available
Virtual Software Systems    Web Based Training and Consulting   
PHONE: (412) 835-9417           Web site:  <a class="moz-txt-link-freetext" href="http://www.vss3.com">http://www.vss3.com</a> 
</pre>
  </body>
</html>