<div dir="ltr">Thanks for the insight on this Nancy - very useful information for me<div><br></div><div>Scott</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 31, 2021 at 11:17 AM Nancy Palmquist via Filepro-list <<a href="mailto:filepro-list@lists.celestial.com">filepro-list@lists.celestial.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
What I think could cause an issue is that you should never select using <br>
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 <br>
record your place in the index also changes.<br>
<br>
I would affect these changes by sitting in one place, do a lookup to <br>
each file using the index for the account number like this:<br>
<br>
<br>
I want to change 10000-00001 to 10000-00001-1<br>
<br>
I would not do this by selecting the records and changing them one at a <br>
time in a report, I would sit on one record, I usually do this in clerk <br>
- where is not important but maybe the customer definition record and do <br>
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 <br>
-1";write filename<br>
' now that just moved the record to another place in the index since <br>
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 <br>
entries to change.<br>
'It is important to include the spaces in the key used in the lookup but <br>
I also test to make sure I am finding the right thing before I make a <br>
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 <br>
number changes in all the files that need to be updated in just a few <br>
loops. Now I used data, but you might use variables of course. I just <br>
thought it would be clearer with literal data.<br>
<br>
This logic is also worthwhile to delete all associated records. Say I <br>
want to purge all my files of one invoice number, I would do the same <br>
type of logic. Or I want to archive all the stuff related to one <br>
customer or one invoice. The indexes are wonderful in this regard. It <br>
has to be an automatic index, since it is updated as you go. This is <br>
also much faster that running reports on each file you want to fix.<br>
<br>
<br>
Nancy<br>
<br>
<br>
On 3/30/2021 3:55 PM, scooter6--- via Filepro-list wrote:<br>
> So apparently it's necessary to make fa a global in changeacctnumsel<br>
> It works if I put fa(11,allup,g)=@px and then run<br>
> /u/appl/fp/dreport filename -f changeacctnum -rx 10000-00001 -u -a -v<br>
> changeacctnumsel -ia<br>
><br>
> FYI<br>
><br>
><br>
><br>
><br>
> ---------- Forwarded message ---------<br>
> From: <a href="mailto:scooter6@gmail.com" target="_blank">scooter6@gmail.com</a> <<a href="mailto:scooter6@gmail.com" target="_blank">scooter6@gmail.com</a>><br>
> Date: Tue, Mar 30, 2021 at 11:34 AM<br>
> Subject: command line process<br>
> To: filePro Mailing List <<a href="mailto:filepro-list@lists.celestial.com" target="_blank">filepro-list@lists.celestial.com</a>><br>
><br>
><br>
> I have the following<br>
><br>
> /u/appl/fp/rreport filename -f changeacctnum -u -a -v changeacctnumsel -ia<br>
><br>
> (Index A is the field to be changed)<br>
><br>
> changeacctnumsel looks like this<br>
><br>
> If: fa=""<br>
> Then: input fa(11,allup) "Enter acct to change"<br>
><br>
> If: 1 lt fa<br>
> Then: lookup - k=fa i=A -eg<br>
><br>
> If: 1 gt fa<br>
> Then: la(11,allup)="99999-99999"<br>
><br>
> If: 1 gt fa<br>
> Then: lookupu - k=la i=A -el<br>
><br>
> If: 1 lt fa<br>
> Then: end<br>
><br>
> If: 1 gt fa<br>
> Then: end<br>
><br>
> If:<br>
> Then: select<br>
><br>
> This works perfectly - my processing changeacctnum runs fine and does what<br>
> I want it to do<br>
><br>
> However, if I change the first line to be :<br>
><br>
> If:<br>
> Then: fa(11,allup)=@px<br>
><br>
> ...and rest of code is the same, and I run this from the command line<br>
><br>
> /u/appl/fp/dreport filename -f changeacctnum -rx 10000-00001 -u -a -v<br>
> changeacctnumsel -ia<br>
><br>
> I get no errors but it doesn't do what changeacctnum processing is<br>
> supposed to do<br>
><br>
> I have tried it with "10000-00001" in quotes also but same result<br>
><br>
> What I'm trying to do is write a process that will change acct number if<br>
> there needs to be an 'associate' account number - so the field in question<br>
> is actually 13 characters long<br>
> So I'm wanting to change all records it finds that are 10000-00001 to<br>
> 10000-00001-1<br>
> As I said, this works fine if changeacctnumsel doesn't try to use @px but<br>
> there are several files I need to add the -1 to so rather than someone<br>
> having to input the account number multiple times, I'm trying to pass it as<br>
> -rx flag to the other files so user inputs 10000-00001 just once and it<br>
> makes changes to all pertinent files<br>
><br>
> What am I missing here?<br>
><br>
> thanks<br>
><br>
> Scott<br>
> PDM<br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20210330/59488ba1/attachment.html" rel="noreferrer" target="_blank">http://mailman.celestial.com/pipermail/filepro-list/attachments/20210330/59488ba1/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><br>
<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>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20210331/5d3fc375/attachment.html" rel="noreferrer" target="_blank">http://mailman.celestial.com/pipermail/filepro-list/attachments/20210331/5d3fc375/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><br>
</blockquote></div>