I want to combine the output (flat file) of 2 TABLE FILEs. Thus, I’m doing the following:
TABLE FILE table1
ON TABLE SAVE FILENAME file.txt
The above works fine. However, I want to make a slight change and use a DEFINE’d field instead of a real field in the SUM and BY. Thus, I put a DEFINE above the TABLE FILE and I used the DEFINEd field in the SUM and BY. That works fine if I just have one normal TABLE FILE. But if I want to use the DEFINEd field in the original, combined MORE, I get this error:
(FOC952) NO MATCH IS FOUND FOR THE FIELD OF MAIN REQUEST: REAL_NAME
If I put the DEFINE FILE above both the TABLE FILE table1 and the FILE table2, I get this error:
(FOC001) THE NAME OF THE FILE OR THE WORD 'FILE' IS MISSING
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND
(FOC1517) UNRECOGNIZED COMMAND FILE FY2019
(FOC1517) UNRECOGNIZED COMMAND WHERE VENDOR_NO GE '1000000000'
(FOC1517) UNRECOGNIZED COMMAND AND AOBJ GE '0101'
(FOC1517) UNRECOGNIZED COMMAND AND AOBJ LE '0220';
Is there a way to combine output using MORE along with a DEFINEd field?
MarkThis message has been edited. Last edited by: folkie,
Windows Server 2016
I think you need to create your defined field for both table1 and table2. Did you try Something like this :
DEFINE FILE table1
DEFINE FILE table2
Then your TABLE FILE with MORE
When using MORE, all combined files must have the same number of field, same field name/format/length
TABLE FILE CAR PRINT RETAIL_COST BY COUNTRY BY CAR BY MODEL WHERE SEATS EQ 2; ON TABLE HOLD AS TBL1 END -RUN TABLE FILE CAR PRINT RETAIL_COST BY COUNTRY BY CAR BY MODEL WHERE MODEL CONTAINS '2 DOOR'; ON TABLE HOLD AS TBL2 END -RUN DEFINE FILE TBL1 FLD /A10V = 'TABLE 1'; END DEFINE FILE TBL2 FLD /A10V = 'TABLE 2'; END TABLE FILE TBL1 PRINT RETAIL_COST BY FLD BY COUNTRY BY CAR BY MODEL MORE FILE TBL2 END -RUN
WF versions : Prod 188.8.131.52M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
Jean-Claude and Martin,
Thanks for both of your replies. I went with the first, and simpler one. I moved the 2nd DEFINE right under the first DEFINE and before the (first) TABLE FILE and it worked.
Windows Server 2016
|Powered by Social Strata|