Define Files - Duplicate Files
Nancy Palmquist
Nancy.Palmquist at vss3.com
Mon Oct 20 13:44:23 PDT 2014
Richard I think you misunderstand her.
She wants to add fields to mainfile and have a way to add and shuffle
other files with the same fields.
On 10/20/2014 3:35 PM, Richard Kreiss wrote:
>
>> -----Original Message-----
>> From: Filepro-list [mailto:filepro-list-
>> bounces+rkreiss=verizon.net at lists.celestial.com] On Behalf Of Tracy LeBlanc
>> Sent: Monday, October 20, 2014 2:24 PM
>> To: filepro-list at lists.celestial.com
>> Subject: Define Files - Duplicate Files
>>
>> Without using qualified files, is there an easy way to update specific multiple
>> files when I add/update fields (thru Define Files) from one file?
>>
>>
>>
>> I have one file that handles the programming. This file will save the
>> information to other files based on a year. When I update fields in the
>> 'programming file', I am manually having to update multiple files with the
>> same fields.
>>
>>
>>
>> filePro 5.7.00 running on Linux.
>>
>>
>>
>> Tracy
> Without seeing your file layout and knowing your indexes, I am going to make some assumptions.
>
> Since you haven't listed your file names or how many, you could setup an array with the file names to be updated. Then declare a variable such as filename.
>
> Then create your lookup using (filename). To post the information, increment an array counter setting filename to the file to be updated do the lookup postings until all of the files have been updated.
>
> Yr(4,.0)=year wanted
>
> If:
> Then:Dim files(NN);ct(2,.0)="1"
> If:
> Then: files["1"]="first file;files["2"]="second file" etc
> Loop If:
> Then: lookup foo = (filename) -k yr i=A -nx
> If:
> Then: foo(1);foo(2) or whatever field number is being posted to.
> If: ct lt NN
> Then ct=ct+"1";GOTO loop
> If:
> Then: END
>
> If the field numbers are not the same, you could have a number of posting lines.
>
> If: ct = "1"
> Then: foo(1);foo(2);write foo;ct=ct+"1";GOTO loop
> If: ct = "2"
> Then: foo(3);foo(4) ;write foo;ct=ct+"1";GOTO loop
>
> At the last posting, just do an end or exit.
>
> My question, why no use qualifiers id the file structures for these files are all the same. This would make things much easier as you could then read the file qualify to get all of the qualifiers to post to. It also solves the problem of having to make changes in multiple maps if a field is changed or added. This hold true for screens and reports. Do the work once.
>
>
> Richard Kreiss
> GCC Consulting
>
> Office: 410-653-2813
>
Richard I think you misunderstand her.
She wants to add fields to mainfile and have a way to add and shuffle
other files with the same fields.
You could do it by making a copy of the map on the second (etc.)files
called map.new. Update data in that file and save then shuffle.
However, I might say this is a dangerous method, and if you are not
familiar with the map file structure and contents, you could easily
corrupt the file entirely.
Qualifiers were designed to avoid these kinds of issues.
Nancy
--
Nancy Palmquist
Owner
Virtual Software Systems - www.vss3.com
(412) 835-9417
More information about the Filepro-list
mailing list