× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Dec 18, 2007 4:50 PM, Mike Krebs <majkrebs@xxxxxxxxx> wrote:
I wrote my own matching logic program to integrate a batch update to a live file. I did it in free form. In 20 years of programming in this environment (system 36/38/as400) I saw one or two MR programs (and that might have been in school!) Also, it just seemed easier to me.


I am not at work, so I don't have the exact code available, but the logic is not very hard and looks something like this. Obviously without the exact code, I improvised and use some psuedo code. But, the guts are pretty straight forward.


ffile1 prefix(old)
ffile2 prefix(new)


/free
read file1;
read file2;
dow (not %eof(file1) or not %eof(file2));
select;
when old.key = new.key;
update file1; //matched records logic...
read file1;
read file2;
when old.key < new.key;
delete file1; // old file record no longer needed.
read file1;
other; // old.key > new.key = New record!
write file1; // using file2 fields
read file2;
endsl;
enddo;
*inlr = *on;


/end-free

Indeed. I have a generic matching record program (I use it for
regression testing) and the code is very similar:

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
* * * Mainline * * *
* * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/free
init();
read1();
read2();
DoW (Not %Eof(input1) Or Not %Eof(input2));
testVar = compKey();
Select;
When (testVar = L_LESS);
error1();
read1();
When (testVar = R_LESS);
error2();
read2();
When (testVar = EQUAL);
If (compDta() <> EQUAL);
error3();
EndIf;
read1();
read2();
EndSl;
EndDo;
hndlNoErr();

Return;
/end-free

http://www.brilligware.com/cp1000r.html


Chris
--
chris@xxxxxxxxx
www.brilligware.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.