Focal Point
Merging of HOLD tables

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

August 28, 2006, 06:27 AM
<Torque>
Merging of HOLD tables
Hi,
I have just started working on WebFocus and hope that my queries aren't too amature and silly.
I have 3 seperate HOLD files each having some data for each month, say from Jan to March.
Eg.
HOLD1 has data
Jan
10
20
30
HOLD2 has data
Feb
1
20
11
etc.
I want to combine these 3 files so that i have a file that looks like this
Jan Feb
10 1
20 20
30 11

Is this even possible?? I was trying MORE n MATCH but got no success. Any suggestions??
Thanks in advance guys..
August 28, 2006, 08:49 AM
<Tim Howard_ABCBS>
Try using the USE statement. I've had success with the following:

TABLE FILE MONTH1
PRINT ....
ON TABLE HOLD AS HOLD1 FORMAT FOCUS
END

TABLE FILE MONTH2
PRINT ...
ON TABLE HOLD AS HOLD2 FORMAT FOCUS
END

USE
HOLD1 AS HOLD1
HOLD2 AS HOLD1
END

After the USE statement, the data from both HOLD1 and HOLD2 should be in the HOLD1 file. Make sure you hold the file in the FOCUS format. The USE statement will not work otherwise.

Hope this helps.
August 28, 2006, 09:40 AM
susannah
MORE and MATCH are also very good ways, but we'ld have to see your code to see where your source data is coming from.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 28, 2006, 09:55 AM
Leah
Are you really wanting your data to look as you posted it?
Jan Feb
10 1
20 20
30 11

That is the first record is the months and so on or am I missinterpreting.


Leah
August 28, 2006, 10:07 AM
GCohen
Try this..
DEFINE FILE HOLD1
RECNUM/I5=RECNUM+1;

END
DEFINE FILE HOLD2
RECNUM/I5=RECNUM+1;

END
DEFINE FILE HOLD3
RECNUM/I5=RECNUM+1;
END
MATCH FILE HOLD1
SUM DATA
BY RECNUM
RUN
FILE HOLD2
SUM DATA BY RECNUM
RUN
FILE HOLD3
SUM DATA BY RECNUM
ON TABLE HOLD OLD-AND-NEW
END
TABLE FILE HOLD
PRINT E01 AS 'JAN' E02 AS 'FEB' E03 AS 'MAR'
END


Release 7.6.9
Windows
HTML
August 28, 2006, 11:59 PM
<Torque>
First of all, thanks for all the replies. I woudl try them on right away.
The HOLD files are genarated dynamically, one for each month. At the beginning the number of months/ dynamic files isn't known. I then need to combine all the data into a single hold file.
@Leah
The first record need not be the month. I want to display the data in that format finally. The HOLD table could have records in any way.
@Susannah
Should i post my code right here for you to investigate??

Thanks a lot guys..