Focal Point
[CLOSED] HELP - Trying to merger files with MORE command

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

July 17, 2014, 04:58 PM
Tomsweb
[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>,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
July 17, 2014, 05:58 PM
Waz
The fields from C2 must match the fields from C1.

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.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs: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 :
July 18, 2014, 07:23 AM
atturhari
This should help

http://www.informationbuilders.../developer/MergeHold
July 18, 2014, 09:01 AM
George Patton
How about MATCH FILE ?


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
July 18, 2014, 09:53 AM
David Briars
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,