Focal Point
[CLOSED]MATCH problem

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2567012976

November 05, 2015, 07:48 AM
Ali
[CLOSED]MATCH problem
Hello everyone,
I have an issue with matching two files and for some reason, it generates an error when running the report. The error is:

(FOC063) WARNING. MATCH FIELDS HAVE SAME NAME BUT DIFFERENT FORMATS: PC_ID


-DEFAULT &STARTDT = '20150201';
-DEFAULT &ENDDT = '20150701';

JOIN ID IN PTD TO ALL ID IN PER AS JOIN1
JOIN TYP IN PTD TO ALL ER_ID IN ER AS JOIN2
-*
DEFINE FILE PTD
RID/A10=GETTOK(ID,23,3,'*',10,RID);
PC/A2=GETTOK(ID,23,2,'*',2,PC);
END
-*
TABLE FILE PTD
PRINT
RID
P_DAT
PC_DAT
COMPUTE ND/MDYY = IF PCD EQ MISSING THEN PAD ELSE PCD;
COMPUTE PPD /MDYY = IF PCD EQ MISSING THEN PAD ELSE PCD;
PA
PTET
E_DES
PP_DEP
PGN/A30 AS AGA_ID
PC
PC AS PC_ID
BY RID NOPRINT
WHERE PA GT 0
WHERE (PAD LE '&ENDDT' AND PAD GE '&STARTDT') OR  (PCD LE '&ENDDT' AND PCD GE '&STARTDT')
ON TABLE HOLD AS PART1
END
-*
MATCH FILE PART1
PRINT
RID
P_DAT
PC_DAT
ND
PA
PTET
E_DES
PP_DEP
PGN
PC
BY PC_ID
BY PPD
RUN
FILE TABLEX
SUM
PSD
PED
BY PC_ID
BY PPD
AFTER MATCH HOLD AS PART2
END
.
.
.
.
.


The problem is with "PC_ID" field. Its format in TABLEX is "A2V" and ID format in PTD is "A23V". I tried to make PC "A2V" but get the same error. I am stuck at this point. Any ideas?

Ali

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS Developer Studio 8104 / Windows 7 / HTML and Excel
November 05, 2015, 08:22 AM
Ricardo Augusto
Use a DEFINE to create a field on both files with the same format.


WebFOCUS 8.1.05 / APP Studio
November 05, 2015, 12:07 PM
Ali
I did DEFINE the file and assigned the appropriate format to PC in the beginning. Then I gave PC an alias in the HOLD file. The second file used in MATCH has a filed named PC that has the same format as the defined first field.
Where do you suggest I Define the file. Also, do I need to do it for the Hold file or the original file?

Ali


WebFOCUS Developer Studio 8104 / Windows 7 / HTML and Excel
November 05, 2015, 01:32 PM
MartinY
Both fields PC_ID and PPD from both files PART1 and TABLEX need to have the same format.

In other words:

PART1.PC_ID same format as TABLEX.PC_ID or vice versa
and
PART1.PPD same format as TABLEX.PPD or vice versa

In a MATCH, all same BY field across files must have the same format, name and be in the same order.

The BY fields are the "key" to match your files so they need to be placed in the same order, have the same format and have the same name.

At worst for the name you can do something such as:
MATCH FILE Y
PRINT Fld1
BY Fld2 AS 'BY1'
BY Fld3 AS 'BY2'
RUN
FILE Y
PRINT Fld9
BY BY1
BY BY2
AFTER MATCH HOLD AS Z OLD-AND-NEW
END


It is also important to provide the Matching verb that you want:
OLD-OR-NEW
OLD-AND-NEW
OLD-NOR-NEW
OLD-NOT-NEW
NEW-NOT-OLD
OLD
NEW

It will avoid confusion on action performed by the MATCH.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007