Focal Point
[SOLVED] Merge hold files with different field formats

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

March 08, 2013, 03:45 PM
Daniel G
[SOLVED] Merge hold files with different field formats
I have two hold files that need to be merged into one hold file. The two hold files have the same number of columns and the column names are the same but the formats are different. Is there a way to get these merged?

Hold file 1
column1     A30
column2     A1
column3     I8
column4     I8


Hold file 2
column1     A30
column2     A1
column3     D12.2%
column4     D12.2%


Thanks,

Daniel

This message has been edited. Last edited by: Kerry,


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs
March 08, 2013, 05:54 PM
Francis Mariani
Something like this should work:

SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA

-* create two hold files with different formats

TABLE FILE CAR
SUM SALES/D20.2
BY COUNTRY
ON TABLE HOLD AS H001
END

TABLE FILE CAR
SUM SALES/I8
BY COUNTRY
ON TABLE HOLD AS H002
END

-* merge two files with columns of different formats
DEFINE FILE H001
SALESD/D20.2 = SALES;
END

DEFINE FILE H002
SALESD/D20.2 = SALES;
END

TABLE FILE H001
SUM 
SALESD AS SALES
BY COUNTRY

MORE
FILE H002
END

Even better, if you're working with hold files, why not format the column when you create the hold file?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 08, 2013, 06:19 PM
FrankDutch
I would suggest to add an extra field that gives you information about the origin.
So,mething like A for the first hold file and B for the second.
After merging the two you might want to know where the data came from




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

March 11, 2013, 11:24 AM
Daniel G
Francis,

That worked thank you so much.

Daniel


In Focus since 2012
WebFOCUS 8.0.07
Windows, All Outputs