<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="monospace"><br>
      What I think could cause an issue is that you should never select
      using an index that is built on something you plan to change.<br>
      <br>
      I would say that when you change entries in the index and save the
      record your place in the index also changes.  <br>
      <br>
      I would affect these changes by sitting in one place, do a lookup
      to each file using the index for the account number like this:<br>
      <br>
      <br>
      I want to change </font>10000-00001  to 10000-00001-1<br>
    <br>
    I would not do this by selecting the records and changing them one
    at a time in a report, I would sit on one record, I usually do this
    in clerk - where is not important but maybe the customer definition
    record and do the following:<br>
    <br>
    loop1<br>
    lookup filename k=("10000-00001  ") i=a -nxp<br>
    if not filename<br>
    end<br>
    if "10000-00001~" eq filename(1){"~"  then filename(1)="10000-00001
    -1";write filename<br>
    '  now that just moved the record to another place in the index
    since index A is built on the 13 characters of the account number.<br>
    'so now all I have to do is repeat this logic until I find no more
    entries to change.<br>
    'It is important to include the spaces in the key used in the lookup
    but I also test to make sure I am finding the right thing before I
    make a change to the data.<br>
    <br>
    goto loop1<br>
    <br>
    By this method, you can sit on that one record and make all the
    account number changes in all the files that need to be updated in
    just a few loops.  Now I used data, but you might use variables of
    course.  I just thought it would be clearer with literal data.<br>
    <br>
    This logic is also worthwhile to delete all associated records.  Say
    I want to purge all my files of one invoice number, I would do the
    same type of logic.  Or I want to archive all the stuff related to
    one customer or one invoice.  The indexes are wonderful in this
    regard.  It has to be an automatic index, since it is updated as you
    go.  This is also much faster that running reports on each file you
    want to fix.<br>
    <br>
    <br>
    Nancy<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 3/30/2021 3:55 PM, scooter6--- via
      Filepro-list wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CADpQzqP_wShQ1TKveRQbMdDNBCwwx03mGjuUo9He2BW54-35=w@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">So apparently it's necessary to make  fa  a global in  changeacctnumsel
It works if I put     fa(11,allup,g)=@px     and then run
 /u/appl/fp/dreport filename -f changeacctnum -rx 10000-00001 -u -a -v
changeacctnumsel -ia

FYI




---------- Forwarded message ---------
From: <a class="moz-txt-link-abbreviated" href="mailto:scooter6@gmail.com">scooter6@gmail.com</a> <a class="moz-txt-link-rfc2396E" href="mailto:scooter6@gmail.com"><scooter6@gmail.com></a>
Date: Tue, Mar 30, 2021 at 11:34 AM
Subject: command line process
To: filePro Mailing List <a class="moz-txt-link-rfc2396E" href="mailto:filepro-list@lists.celestial.com"><filepro-list@lists.celestial.com></a>


I have the following

/u/appl/fp/rreport filename -f changeacctnum -u -a -v changeacctnumsel -ia

(Index A is the field to be changed)

changeacctnumsel looks like this

If:  fa=""
Then: input fa(11,allup) "Enter acct to change"

If: 1 lt fa
Then: lookup -  k=fa    i=A  -eg

If: 1 gt fa
Then: la(11,allup)="99999-99999"

If: 1 gt fa
Then:  lookupu -  k=la   i=A -el

If: 1 lt fa
Then: end

If: 1 gt fa
Then: end

If:
Then: select

This works perfectly - my processing  changeacctnum runs fine and does what
I want it to do

However, if I change the first line to be :

If:
Then:  fa(11,allup)=@px

...and rest of code is the same, and I run this from the command line

/u/appl/fp/dreport filename -f changeacctnum -rx 10000-00001 -u -a -v
changeacctnumsel -ia

I get no errors but it doesn't do what  changeacctnum processing is
supposed to do

I have tried it with "10000-00001" in quotes also but same result

What I'm trying to do is write a process that will change acct number if
there needs to be an 'associate' account number - so the field in question
is actually 13 characters long
So I'm wanting to change all records it finds that are  10000-00001 to
10000-00001-1
As I said, this works fine if changeacctnumsel doesn't try to use @px but
there are several files I need to add the -1 to so rather than someone
having to input the account number multiple times, I'm trying to pass it as
-rx flag to the other files so user inputs 10000-00001 just once and it
makes changes to all pertinent files

What am I missing here?

thanks

Scott
PDM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <a class="moz-txt-link-rfc2396E" href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20210330/59488ba1/attachment.html"><http://mailman.celestial.com/pipermail/filepro-list/attachments/20210330/59488ba1/attachment.html></a>
_______________________________________________
Filepro-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a>
Subscribe/Unsubscribe/Subscription Changes
<a class="moz-txt-link-freetext" href="http://mailman.celestial.com/mailman/listinfo/filepro-list">http://mailman.celestial.com/mailman/listinfo/filepro-list</a>
</pre>
    </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>