[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | FOCUS, from INFORMATION BUILDERS |
|
Moderator: | ZAYIUS::BROUILLETTE |
|
Created: | Thu Feb 19 1987 |
Last Modified: | Mon May 05 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 615 |
Total number of notes: | 1779 |
158.0. "Problems with MATCH and ON TABLE HOLD / ALIAS" by EFGV01::LEE () Wed Nov 23 1988 09:33
I had some problems using MATCH. There were no problems when I used
MATCH with data files whose master files were made by myself. But
when I used MATCH after ON TABLE HOLD it didn't work correctly.
I'll make it clear with a example.
There are two data files:
1) TEL: contains a name and a telephone number.
2) JOB: contains a name and a jobname.
There master files and data files are:
======================================================================
FILENAME = TEL, SUFFIX = FIX ,$
SEGNAME = TEL ,$
FIELDNAME = A1NAME ,ALIAS = ,USAGE = A10 ,ACTUAL = A10 ,$
FIELDNAME = A1TEL ,ALIAS = ,USAGE = A03 ,ACTUAL = A03 ,$
======================================================================
Data file: TEL.DAT :
PERSON 508
DOG 555
CAT 999
WORM 444
======================================================================
======================================================================
FILENAME = JOB, SUFFIX = FIX ,$
SEGNAME = JOB ,$
FIELDNAME = B1NAME ,ALIAS = ,USAGE = A10 ,ACTUAL = A10 ,$
FIELDNAME = B1JOB ,ALIAS = ,USAGE = A16 ,ACTUAL = A16 ,$
======================================================================
Data file JOB.DAT :
ZORRO BANDIT
PERSON TRAINEE DEV SPEC
======================================================================
I combine the two files using MATCH:
MATCH FILE TEL
PRINT A1TEL
BY A1NAME
RUN
FILE JOB
PRINT B1JOB
BY B1NAME
AFTER MATCH HOLD AS TELJOB OLD-OR-NEW
END
The result is exactly what one expects; records with matching A1NAME
and B1NAME are matched, the others remain separate and TELJOB has only
one field containing the name.
FILE=TELJOB ,SUFFIX=FIX
SEGNAME=TELJOB
FIELDNAME =A1NAME ,E01 ,A10 ,A10 ,$
FIELDNAME =A1TEL ,E02 ,A03 ,A03 ,$
FIELDNAME =B1JOB ,E03 ,A16 ,A16 ,$
======================================================================
Data file TELJOB.FTM:
CAT 999.
DOG 555.
PERSON 508TRAINEE DEV SPEC
WORM 444.
ZORRO . BANDIT
======================================================================
However, when the file JOB is created by an ON TABLE HOLD, its master file
looks like this:
FILENAME = JOB, SUFFIX = FIX ,$
SEGNAME = JOB ,$
FIELDNAME = B1NAME ,ALIAS = E01 ,USAGE = A10 ,ACTUAL = A10 ,$
FIELDNAME = B1JOB ,ALIAS = E02 ,USAGE = A16 ,ACTUAL = A16 ,$
Now the program gives a different result; TELJOB now has
two fields containing the name, and the values in these fields don't
match! FOCUS sorts the two files and then just combines the first
record of (sorted) TEL with the first record of (sorted) JOB, the
second record of TEL with the second record of JOB, etcetera. It
no longer considers them to be the 'same' field.
FILE=TELJOB ,SUFFIX=FIX
SEGNAME=TELJOB
FIELDNAME =A1NAME ,E01 ,A10 ,A10 ,$
FIELDNAME =A1TEL ,E02 ,A03 ,A03 ,$
FIELDNAME =B1NAME ,E03 ,A10 ,A10 ,$
FIELDNAME =B1JOB ,E04 ,A16 ,A16 ,$
=======================================================================
Data file TELJOB.FTM:
CAT 999PERSON TRAINEE DEV SPEC
DOG 555ZORRO BANDIT
PERSON 508. .
WORM 444. .
=======================================================================
After some testing we discovered that the alias is giving this
problem. When the alias of the sort-fields of the first and the
second file are different then this problems occurs; when they
are exactly the same the MATCH works perfectly.
But ON TABLE HOLD and AFTER MATCH HOLD create master files with
alias's in the format E%% in which % is a figure. So this means
that we can't use MATCH after an ON TABLE HOLD or an AFTER MATCH
HOLD!! Now I am using ON TABLE SAVE and self-made master files but
this can't be done with AFTER MATCH HOLD.
After this long explanation my questions are:
1) shouldn't the way that MATCH works be independent of the
use of alias's?
2) was MATCH already working like this in the old version or is
this a difference between the old and new version (we are now
using version 5.2)? In the old version I never tried this.
T.R | Title | User | Personal Name | Date | Lines
|
---|