[CLOSED] HELP - Trying to merger files with MORE command
I am trying to put together a prototype MORE Concatenation with the CAR file for a later coding problem. I've looked at the techsupport and it is deficient with an example for a nonexistent EXPERSON file.
Here is what I have so far...
I have created the 2 hold files I like to merge for my report.
TABLE FILE CAR
SUM SALES
BY COUNTRY
ON TABLE HOLD AS C1
END
-RUN
?FF C1
-RUN
TABLE FILE CAR
SUM DC
BY COUNTRY
ON TABLE HOLD AS C2
END
-RUN
?FF C2
-RUN
and my Master defintions look like this:
quote:
FILENAME= C1 COUNTRY E01 A10 SALES E02 I6
FILENAME= C2 COUNTRY E01 A10 DEALER_COST E02 D7
Now I understand that I need to create 1 or more virtual fields but this iw where I got lost.
I'm trying to come up with a request like:
TABLE FILE C1 SUM SALES DEALER_COST BY COUNTRY MORE FILE C2 END
Any insights that anyone can provide, I would appreciate it.
Thanks!This message has been edited. Last edited by: <Kathryn Henning>,
So Dealer Code should be I6 or Sales should be D7.
Also the field names need to be the same.
What happens with the TABLE FILE MORE, is that the TABLE FILE request for C1 is used in the C2 part. If the field names don't exist it will error.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
July 18, 2014, 05:53 AM
Wep5622
Untested, but if you add these virtual fields it should start working:
DEFINE FILE C1
DEALER_COST/D7 = 0;
END
DEFINE FILE C2
SALES/I6 = 0;
END
TABLE FILE C1
SUM
SALES
DEALER_COST
BY COUNTRY
MORE
FILE C2
END
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
Yes, you can concatenate flat files C1 and C2 with the MORE command:
APP PREPENDPATH IBISAMP
-*
SET ONLINE-FMT = STANDARD
-*
TABLE FILE CAR
SUM SALES
BY COUNTRY
ON TABLE HOLD AS C1
END
-RUN
-*
TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY
ON TABLE HOLD AS C2
END
-RUN
-*
DEFINE FILE C1
DEALER_COST/D7 = SALES;
END
-*
TABLE FILE C1
PRINT DEALER_COST
BY COUNTRY
ON TABLE HOLD AS TOM
MORE
FILE C2
END
-RUN
-*
TABLE FILE TOM
PRINT DEALER_COST AS 'Combo,Amount'
BY COUNTRY AS 'Country'
END
-EXIT
Combo
Country Amount
------- ------
ENGLAND 12,000
37,853
FRANCE 0
4,631
ITALY 30,200
41,235
JAPAN 78,030
5,512
W GERMANY 88,190
54,563
This message has been edited. Last edited by: David Briars,