Previous Topic Next topic Print topic


Creating and Building an IMS Application

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:

  1. Create a working folder on your machine such as c:\tutorials.
  2. Start Visual Studio.
  3. Click File > New > Project > COBOL Projects > Native > Mainframe Subsystem Application.
  4. Specify a name for your project such as ims.
  5. Specify a working folder in the Location field.

    This is the folder you defined in step 1 above.

  6. Uncheck Create directory for solution.
  7. 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:

  1. In Solution Explorer, right-click your project and select Add > New > Folder.
  2. Create the following subfolders in your project: cbl, dbd, mfs, psb, loadlib, and system.
  3. Right-click a subfolder of your project and select Add > Existing Item.
  4. Browse to the %ProgramFiles(x86)%\Micro Focus\Studio Enterprise Edition x.x\Examples\Visual Studio Integration\Tutorials\Mainframe\IMS directory (default location).
  5. Set Objects of type filter to All Files (*.*).
  6. 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:

  1. In Solution Explorer, double-click the Properties folder.
  2. On the COBOL tab, set Configuration to Debug.
  3. Ensure Platform target is set to x86.
  4. Ensure COBOL dialect to Enterprise COBOL for z/OS.
  5. Set Source Format to Fixed.
  6. In the Additional Directives field, enter CHARSET(ASCII).
  7. Ensure Compile for debugging is checked.
  8. In the Output path field, specify the path to the loadlib subfolder of your project: .\loadlib.
  9. 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.

  10. In DBD Build Settings section, check Generate Map for DBD.
  11. On the Debug tab, select IMS from the drop down list for Choose Active Settings.
  12. Click File > Save All to save the changes in the project properties.

Build the Solution

To build the solution:

  1. Right-click the solution in Solution Explorer.
  2. Click Build Solution.

    The build creates different executables and other system files in the following subfolders of the project:

    C:\tutorials\ims
    • IMSCONFG.DAT
    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.
  3. 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.

  1. 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.

  2. Start a COBOL command prompt:

    Click Start > All Programs > Micro Focus Studio Enterprise Edition x.x > Compatibility Tools > Net Express Command Prompt, 32-bit.

  3. 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:

  1. From the COBOL command environment navigate to the loadlib subfolder of your project.
  2. 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:

  1. Execute the following from the COBOL command environment starting in loadlib:
    MFIMS STAGE1IMP TRANCODE.TXT
Previous Topic Next topic Print topic