Professional Documents
Culture Documents
Here is the method through which we can access Mainframe DB2 Data through MFE by
changing some TCP Port Settings in the XDB Settings for MFE .
Step 3: Update 'Hosts' file to map 'remote HOST' name to the IP addresses of
the mainframe.
Open the file 'C:\WINDOWS\system32\drivers\etc\hosts' with Notepad.
Add the following line to the bottom of this file.
On 'Connect' tab, enter DB2G or DB2T on 'Locations' and clear out 'AuthID'.
If the connection is successful, you may see the Transaction dialog. Then you can just
click 'Commit'.
And now you will see the 'Catalog Browser' showing all the databases under DB2T
How to access Mainframe DB2 Through MFE - Ankit D Agarwal CSC
For Eg : For MLJ Model Office : MCQV1D0A
For John Hancock Model Office : MBQV1D0A
Note: In order to Further exploit this Utility , we can Use Load-Unload Utility in MFE. When
we access the Mainframe Database through MFE , we can only Read the Database (Until and
Unless the User has Right to change the Mainframe Database on his Mainframe Id). Therefore ,
we can change the settings as Explained in this Document, use the Unload Utility to export all
the DB2 Tables on Sequential Datasets.
Thereafter we can again redo the Settings to the original Settings , i.e., we will change the
Location to DB2L (our local Database) and use the Load Utility to Load the DB2 Tables in our
Local Database using the Sequential Datasets created after Unloading .
This way we can replicate the Mainframe Database in our Local region and thus we can carry out
the Testing in Our Local Region using the Mainframe Data and play around with that Data.
The best part of all this is that we are not using any Mainframe CPU Time and thus saving a
lot of Client money :-)
The sample Load-Unload Job for MFE is also mentioned below for your reference. You need to
change the Qualifier and the Table name based on your Project Settings.
In my project : Qualifier : MCQV1D0A ( Mainframe Database Qualifier Name )
MCQV1F0A ( MFE Local Database Qualifier Name)
1. DB2 Unload Job : SYSREC00 is the Dataset Created after running this Job. This Dataset
Contains the Unloaded DB2 Table and this will be used for Loading the DB2 Table in your
Local Region. You can modify the JCL based on your requirements like the parameters CYC
and CDATE can be removed based on the requirement.
How to access Mainframe DB2 Through MFE - Ankit D Agarwal CSC
You Need to change the Fields Marked Bold in Red Color based on your Project Settings
How to access Mainframe DB2 Through MFE - Ankit D Agarwal CSC
2. DB2 Load Job : SYSREC00 is the Dataset Created after running Unload Job and thus is
used here to Load the Table. Note here that the Qualifier is changed from MCQV1D0A to
MCQV1F0A. You can modify the JCL based on your requirements like the parameters
CYC and CDATE can be removed based on the requirement.
You Need to change the Fields Marked Bold in Red Color based on your Project Settings
*****************************************************************************
How to access Mainframe DB2 Through MFE - Ankit D Agarwal CSC
There is one Import-Export Utility in MFE which we can use if we want to Import or Export the
Data from One Region to another Region or vice versa. Lets See Step by Step the Procedure to
Import the Data of a Table from One Region to Another Region. Let’s say I want to Import the
Data from Table ROLES of Database TUTORIAL to Database DB2L.
Step 1: We will Export the Table Data from the Table ROLES of Database TUTORIAL using
the Export Option in SQL Wizard as shown here :
Once you select the Export Option, there will be several options that you need to select from. A
sample Screen is shown below. Here you need to select the Location from Column Location: ,
here its selected as TUTORIAL. Thereafter you have to select the Database Qualifier from the
Column AuthId: , here I have selected MCQV1F0A and lastly the selection of the Table to be
Exported is to done from the Column Table Name : , here I have selected Table ROLES. Once
you click OK , it will itself take the Default file name to be created and you can change the File
Location as per your requirement in the Column File Name:.
Note: Here the option FORMAT is always to be selected as DSNTIAUL until and unless you
have specific project requirement. DSNTIAUL Format exports the Table preserving its format
and type.
How to access Mainframe DB2 Through MFE - Ankit D Agarwal CSC
Note: The best part of this Utility is that we can also select the Records which we want to
Export based on some Selection Criterion as I have done. I have selected only those records
from ROLES table where MATER_ID < ‘ 6660050’ . Use the RUN oprion and the data
will be Exported in the File ROLES.DSN.
How to access Mainframe DB2 Through MFE - Ankit D Agarwal CSC
Step 2: The next Step is to Import the Table in the Database DB2L using the File created after
the Export Step ( ROLES.DSN in my case) . First go to File -> Import option.
Thereafter , select the File you want to use (ROLES.DSN in this case) , the Location (DB2L in
my case) , AuthId ( MCQV1F0A in my case ) and Table (ROLES in my case) . Thus the screen
will look like as shown here after you have made the selections.
How to access Mainframe DB2 Through MFE - Ankit D Agarwal CSC
Once you select all these options and click OK , you will get the following screen. Click the
RUN option at the Top and the Data will be imported in the Table. Also you have 2 options
1. Create Table ,
2. Replace Data
which you can use based on your requirement like I have used Replace Data Option as is clear
from the Screen Shot.
Note: We can use this Export-Import Utility to get the Data from Mainframe DB2 or to Export
the Data to Mainframe DB2 . For example if you want to get the data from Mainframe DB2
Table .
1. You will have to first change the Client settings as explained earlier and point to the
Mainframe Database.
2. Next you will Export the Table you want in a file ( as we did in ROLES.DSN)
3. Now to have to again change the Client settings and point to your Local Database.
4. Import the Data from the File in the Table in your Local Database.
How to access Mainframe DB2 Through MFE - Ankit D Agarwal CSC
This utility also serve the purpose of Migrating Data from one region to another . Through this
utility we can Migrate complete Database in one go by creating Batch Scripts which will
migrate multiple Tables in one go .