Focal Point
[SOLVED] Copy 3 files with 1 MFD into 1 file

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

September 29, 2009, 03:11 PM
Misha
[SOLVED] Copy 3 files with 1 MFD into 1 file
I have 3 files (file a file b fiel c) with same master file definition. Files are FOC type. MFD has few define fields.

How to copy 3 files into 1 file. So that the new FOC file will be used with same MFD.

File a , file b and file c should be copied into file a. So that file a has it's data + file b and c data


Thanks

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


mainframe focus FOCUS 7.1.1
Mainframe OS 390
Excel,csv
September 29, 2009, 03:22 PM
GinnyJakes
Since they are FOCUS files, you can use the USE statement to concatenate the 3 data bases. You can find documentation on this in the MVS/TSO Guide to Operations chapter of a mainframe FOCUS manual.
USE
file-1 AS mastername
file-2 AS mastername
file-3 AS mastername
END

You can then issue a TABLE request against the mastername and HOLD the output into another file which you must pre-allocate using the DYNAM ALLOC statement. Doc for that is in the same chapter.

Happy reading!


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
September 29, 2009, 03:23 PM
Diptesh Patel
I assume you are talking about mainframe files? If so, why not just concatenate the 3 files in your allocation? That way, you can process them as if thjey were one file. If you need to actually have just one file, simply do this concatenation with some utility program, and copy to a new output file.


Diptesh
WF 7.1.7 - AIX, MVS
September 29, 2009, 03:34 PM
Misha
If I want to prepare a test file or back up file, I use ICEGENER OR IEBGENER to copy into another file with same space and size of source file.

Here copying 3 files into 1 files using utility may not help because of the pointers in data.

I will try USE...and see what happens.


mainframe focus FOCUS 7.1.1
Mainframe OS 390
Excel,csv
September 29, 2009, 03:45 PM
GinnyJakes
These are FOCUS files. You cannot use a utility. You must use USE.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 01, 2009, 05:14 AM
<JG>
Ginny is quite correct and showed how to do it in the second post to the thread.

For FOCUS databases you must issue a USE statement assigning all the files to the same logical name.
(beware the 2 gig limitation)

To use your new FOCUS file with the original master clear the existing USE and issue a new one
associating the new file with it.
October 01, 2009, 06:23 AM
GamP
Couldn't you use the rebuild utility to do this?
1. Rebuild / dump for file b (dump b's contents)
2. Rebuild / load for file a (include b's contents into a)
3. Rebuild / dump for file c (dump c's contents)
4. Rebuild / load for file a (include c's contents into a)
5. Rebuild / rebuild for file a (reorganize file a)
Look up the exact syntax for the Rebuild command.

This will only work correctly if the files have exactly the same segment and field names and if the files do not have equal key values.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
October 02, 2009, 11:05 AM
Misha
GamP, I will try Rebuild now as I am learning will try everything.

I tried USE and got sucess after fixing format issues.

I couldn;t save the file after query on Master File with HOLD AS FORMAT FOCUS.


So I saved the data into HOLD file. Then used
create file
Modify file
match field
nomatch include
match include

This way I was able to create one folcus file with 3 focus files data.


mainframe focus FOCUS 7.1.1
Mainframe OS 390
Excel,csv