These are the steps to create
a Visual Studio project comprising all the parts of your application, such as the COBOL source and the IMS files.
You build the demonstration application in
Visual Studio, deploy and run it on an Enterprise Server configured for IMS support, and debug it dynamically.
Create a Project
To create a native COBOL project to hold the files from the demonstration program:
- Create a working folder on your machine such as
c:\tutorials.
- Start
Visual Studio.
- Click
File >
New >
Project >
COBOL Projects >
Native >
Mainframe Subsystem Application.
- Specify a name for your project such as
ims.
- Specify a working folder in the
Location field.
This is the folder you defined in step 1 above.
- Uncheck
Create directory for solution.
- Click
OK.
This creates an
ims folder in your
working foldercurrent workspace that holds your solution and project.
Import the Files from the Demonstration Program
To import the files from the demonstration program into your project:
- In
Solution Explorer, right-click your project and select
Add >
New > Folder.
- Create the following subfolders in your project:
cbl, dbd, mfs, psb, loadlib, and
system.
- Right-click a subfolder of your project and select
Add > Existing Item.
- Browse to the
%ProgramFiles(x86)%\Micro Focus\Studio Enterprise Edition x.x\Examples\Visual Studio Integration\Tutorials\Mainframe\IMS directory (default location).
- Set
Objects of type filter to
All Files (*.*).
- Select the files to add and click
Add.
Add the following demonstration files to the subfolders of your project as detailed in the table below:
Folder name
|
File
|
Comments
|
cbl
|
DEMO001T.CBL
RGHTJUST.CBL
|
|
dbd
|
DEMO03DD.DBD
|
|
loadlib
|
TRANCODE.TXT
DEMO03DD.DBU
|
Contains the data files and will contain the executables required at runtime.
|
mfs
|
DEMO90.MFS
DEMO91.MFS
DEMO92.MFS
|
|
psb
|
DEMO001T.PSB
|
|
system
|
|
Will contain system files such as the cics resource definitions files,
dfhdrdat.*.
|
This creates copies of the files in the respective subfolders of your project.
Specify Project Properties
To specify properties for your project:
- In Solution Explorer, double-click the
Properties folder.
- On the
COBOL tab, set
Configuration to
Debug.
- Ensure
Platform target is set to
x86.
- Ensure
COBOL dialect to
Enterprise COBOL for z/OS.
- Set
Source Format to
Fixed.
- In the
Additional Directives field, enter
CHARSET(ASCII).
- Ensure
Compile for debugging is checked.
- In the
Output path field, specify the path to the
loadlib subfolder of your project:
.\loadlib.
- On the
IMS tab, enter
c:\tutorials\ims\loadlib in the
Generated files,
MFS Path and
Database path fields.
This redirects the output from generation of the IMS files into the
loadlib subfolder.
- In
DBD Build Settings section, check
Generate Map for DBD.
- On the
Debug tab, select
IMS from the drop down list for
Choose Active Settings.
- Click
File > Save All to save the changes in the project properties.
Build the Solution
To build the solution:
- Right-click the solution in Solution Explorer.
- Click
Build Solution.
The build creates different executables and other system files in the following subfolders of the project:
- C:\tutorials\ims
-
- C:\tutorials\loadlib
-
- IMSCONFG.idx
- DBDGEN2.DAT
- DBDGEN2F.DAT
- PSBGEN3.DAT
- DEMO001T.ACB
- DEMO03DD.ACB
- The MFS files generation creates some
.mid,
.mod,
.dif and
.dof files as well as
imsconfg.dat and
imsconfg.idx. These files contain system configuration data. You should move them only if you know how to configure your enterprise server.
- Building the DBD and the PSB files produces respectively
dbdgen2.dat,
dbdgen2f.dat and
psbgen3.dat.
- Copy the
IMSCONFG.* and the
DEMO0*.* files from the project directory to the
loadlib subfolder.
Update the Resource Definition File
IMS support includes two transactions, /CIC and /IMS, that you use to switch enterprise servers to CICS or IMS mode respectively. In order for these new transactions to be available you need to update your resource definition file using the
caspcupg command.
- Using Windows Explorer, copy the
dfhdrdat
and
dfhdrdat.idx
files from the
%ProgramFiles(x86)%\Micro Focus\Studio Enterprise Edition x.x\Base\FILES\SYS (default location) to the
system subfolder in your project directory.
It is a good practice to create copies of the product
dfhdrdat
and
dfhdrdat.idx
files for your project rather than using the files that are in the installation of this COBOL development system.
- Start a COBOL command prompt:
Click
Start > All Programs > Micro Focus Studio Enterprise Edition x.x > Compatibility Tools > Net Express Command Prompt, 32-bit.
- Type the following at the command line:
caspcupg /dp=C:\tutorials\ims\system
The
DP parameter specifies the path to the system subfolder in which you copied the resource definition files.
Load the IMS Database
To load the IMS database:
- From the COBOL command environment navigate to the loadlib subfolder of your project.
- Execute the following command:
MFIMS IMSDBU LOAD DEMO03DD NOCLS
Set Up a List of IMS Transactions
To set up the list of IMS transactions for the IMS configured enterprise server:
- Execute the following from the COBOL command environment starting in loadlib:
MFIMS STAGE1IMP TRANCODE.TXT