Set up Jazz for Micro Focus (Mainframe)

Set up Jazz for Micro Focus (Mainframe) 1

Introduction. 1

Before you go on with this chapter 1

What this chapter covers. 1

Step 1.     Create a suitable project with Visual Studio. 2

Step 2.     Set up a Micro Focus Server to Test our Programs. 3

Create a Server 3

Edit it 4

Prepare project MFJazz1 to work with MicroFocus. 4

Optional: Test Server MFJazz with the JCL Tutorial 5

Step 3.     Configure the Jazz Workbench. 6

Workbench Tab – Locate and initialise folders. 6

Common Path. 7

Project 7

Jazz Objects – Programs, Copy Code, COBOL, and JCL. 8

Click [Initialise Project] 8

Lang Tab. 9

Step 4.     Generate COBOL and JCL from a Jazz Program.. 10

Step 5      Running our First Test 11

5.1    Adding the COBOL Program to the Visual Studio Project 11

5.2    Testing a Program (Batch) 13

5.3    Debugging the COBOL program.. 15

Step 6.     Program Changes – Interacting with Jazz. 16

Review.. 18

Next 18

Glossary. 18

Disclaimer:  This material is written by and represents the opinions of Jazz Software Ltd. The use of Micro Focus examples in this and related Help pages do not imply any contractual relationship between Micro Focus and Jazz Software, nor that Micro Focus supports or recommends Jazz.  

Material like this, written in the normal text, but coloured green, either describes features that haven’t been implemented yet, or discuss various future implementation options.

Introduction

Before you go on with this chapter

With Jazz Version 14 and earlier, Jazz copy code (extension .jzc) and programs (extension .jzz) are processed into COBOL, JCL, and other objects, which are then submitted to a mainframe for processing with FTP/FTPS.  Jazz Version 15 and later retain this ability, but also provide direct communication (FTP is not needed) with the emulated mainframe environment of Micro Focus Enterprise Developer (MFED)

This chapter shows you how to set up Jazz to use it with Visual Studio and MF Enterprise Developer for mainframe development.  Before continuing, you should be familiar with using MF Cobol in this environment: and be aware of the Mainframe Tutorials in Micro Focus Online Documentation.  You will have downloaded Jazz, and you may have already used it to generate COBOL programs which you sent to a z/OS mainframe for testing.

This material is illustrated using MFED 3.0 and VS2017.  There may be detail differences using other versions of MFED and VS, or using Eclipse instead of VS.  Please let us know of any issues where we need to upgrade this documentation with alternate examples or more explanation.

MANASYS support for Eclipse will be developed when we have a customer that we can work with who wants this feature, and can assist us by telling us what is required.

What this chapter covers

This chapter shows you how to set up Jazz so that it works with Micro Focus Enterprise Developer, generating COBOL, JCL, etc into the appropriate folders so that they can be compiled and tested by MFED. 

First we set up a COBOL project called MFJazz1 using the Mainframe Server Application template. 

We set up a Micro Focus Server to test our programs.

In Step 3 we configure Jazz so that as we process our Jazz programs the resulting objects (COBOL and JCL) are written directly into the project’s folders.  For the first test we have to make DTIN1.CBL and DTIN1.JCL known to the MFJazz1 project with Add/Existing Item, but on later changes we only have to rebuild the solution to test the later changes.

If we want to, we can use COBOL-level interactive debugging, pausing at checkpoints, stepping through the program, and examining data.

Step 1.       Create a suitable project with Visual Studio

We start with our IDE (Visual Studio) and create a new Native COBOL project with template Mainframe Subsystem Application. 

·         Give it a name - in this example I’ve called it MFJazz1

·         Set its location – here I’ve used the same location, C:\tutorials, as the Micro Focus tutorials

·         Uncheck Create Directory for Solution: -

Click OK.  This creates the following folders and files within C:\tutorials: -

MFJazz1

Bin

Obj

Properties

MFJazz1.cblproj

MFJazz1.dep

      MFJazz1.sln

 

In Solution Explorer: double click MSJazz1/Properties, and then click the COBOL tab.  Check that

·         the project’s COBOL dialect is set = Enterprise COBOL for z/OS, and

·         Character Set = ASCII: -

Step 2.       Set up a Micro Focus Server to Test our Programs

To test a Mainframe Subsystem Application we need a suitable server.  We will create one as we did with the Micro Focus JCL tutorial, except that we’ll call it MFJazz, and it will include an initiator for Class A.

Open Server Explorer, and expand Micro Focus Servers:-

Create a Server

1.            Right-click LocalHost,  click New Enterprise Server

2.            Type MFJazz in the Name field,

3.            Select template JCLTemplate.xml for a batch-only project.  (Select template CICStemplate.xml if you also want to include CICS and Web Service programs, as in the next chapter)

4.            Check Associate with Projects:  MFJazz1

5.            Click OK

The server is added to the list: -

Edit it

Right-click Micro Focus Server and choose Administration.  Edit MFJazz: -

1.            General Page: set Configuration Information to

[ES-Environment]

JCLPROJ=c:\tutorials\MFJazz1

Click [OK]

 

2.            MSS/JES/General.  Set program paths to: -

JES Program Path                              $JCLPROJ\bin\x86\Debug

System Catalog                                  $JCLPROJ\catalog\catalog.dat

Default Allocated Dataset Location    $JCLPROJ\catalog\datasets

Click [Apply], then Home

 

3.            MSS/JES/Initiators.

Define an Initiator that will handle class A (unlike the JCL tutorial which has only class B).

 

Close the Administrator page. 

Prepare project MFJazz1 to work with MicroFocus

Create folder catalog: In Solution Explorer, right-click the MFJazz1 project, click Add/New Folder.   Name the folder “catalog”.  

Set COBOL properties: in Solution Explorer, double-click the Properties folder and click the COBOL tab

·         Confirm the COBOL dialect is set to Enterprise COBOL for z/OS, source format is Fixed

·         Set Character Set to ASCII

Set Active Settings: in the Debug Tab, ensure Active Settings is set to JCL.  This setting is appropriate for MFJazz1, which is going to have only batch programs.  For other projects you may wish to set this to CICS or Any.

Click <ctrl>S to save these settings

Build the solution: right-click the solution in Solution Explorer, and select Build Solution from the context menu

Associate project MFJazz1 with Enterprise Server MFJazz: right-click MFJazz in Server Explorer, click Associate with Project.  It should already be associated with MFJazz1, if not choose MFJazz1

Start server MFJazz:  right-click MFJazz in Server Explorer, click Start.  If the Enterprise Server Sign On dialog appears, click [OK]: -

In about a second the server is started: -

Optional: Test Server MFJazz with the JCL Tutorial

You may choose to test server MFJazz by completing the JCL tutorial using this project and server.  See the Micro Focus Tutorial (Mainframe/JCL) for information on how to do this: start at the step “Import the files from the Demonstration Program”, importing them into your MFJazz1 project.  If you do this Solution Explorer will show

and when you right-click ESJCL.jcl and click Submit JCL, Server MFJazz will be started if necessary: -

The job will be run, and results returned: -

 

Clicking the link will show the same output as when the JCL tutorial was run in its own project.

Close project MFJazz1, and continue with Step 3

Step 3.       Configure the Jazz Workbench

Next we configure Jazz to work with this project.   If you are not familiar with Jazz, more information about configuring Jazz is available here.

Start Jazz, Click [Configure]

Workbench Tab – Locate and initialise folders

Set IDE to Visual Studio,

Click [Set Defaults] to set paths to their default value, and then to initiate dialogs to locate or create them.

Common Path

Click [Locate] and navigate to the folder that you gave as the location when we created the COBOL project, i.e. C:\tutorials . 

Project

Now the same process is followed for the Project folder.  On clicking [Locate] the dialog opens within the common folder, showing our current VS projects.  Select MFJazz1.

 

Because we’re using Visual Studio Jazz recognises the VS folder structure and that this folder contains a solution (.sln) and a COBOL Project (.cblproj) file.  If we had left “Create Directory for Solution” checked when we created the COBOL project then Visual Studio would have created another folder level for the project file, and the project name would have become MFJazz1\MFJazz1

Jazz Objects – Programs, Copy Code, COBOL, and JCL.

With Jazz Programs, Jazz Copy Code, and Jazz_LocalJCL click [Create] to create subfolders within the project folder.  Generated COBOL is blank, so the COBOL will be written directly into the project folder.

Click [Initialise Project]

With the folders defined, click [Initialise Project] Jazz to copy some initial objects that may be required.   A dialog box appears with the list of possible objects: to select everything (which is what we want to do) click the first, then with Shift pressed click the last.  Click [Open], and all the selected objects are added to appropriate folders in the project.

Since MFJazz1 is going to be a tutorial project, click [Add Training] and add some or all of the objects in the list. 

If you choose to be selective, you can always return to configuration at any time and click [Initialise Project] or [Add Training] to add the missing objects.

The folder structure from C:\Users\Advanced Computers\source\repos\MFJazz1 is now: -

Lang Tab

Click the Lang tab, and check that COBOL Dialect is set to Enterprise COBOL for z/OS, and the Test Environment to IDE: -

Close Configuration.   You’ll be returned to the Jazz workbench.

Step 4.       Generate COBOL and JCL from a Jazz Program

One of the programs put into Jazz_Programs by [Add training] is DTIN1.jzz.  Click File/OpenOpen and select it from the Jazz_Programs folder.  It opens in the Jazz workbench: -

Note that the 6th button is “MFJazz1”, which is the name of our Visual Studio COBOL project, and also the name that we set as our Jazz Project when we configured Jazz above.   Don’t click this – we’ll come back to it later.

Instead, right-click [Process]: the Process Form opens, with options for IDE testing: -

When you click [Process] normally, it is as if this form is opened, and Jazz goes through the four stages of Checking your Jazz program, Generating COBOL, Generating JCL if relevant, and then testing it.  With a right-click the form is opened and you can run the individual stages.  For example, if you click [Generate] the process stops after COBOL generation, and

·         [Find COBOL] becomes [Review COBOL].  You can click this to review and edit the COBOL before continuing.

·         The checkbox JCL is checked, so that clicking [JCL] or [Test] will resume using your generated [and edited?] COBOL.

Do this: click [Generate] and then [Review COBOL].   Close Notepad.

Now open a Windows Explorer, and navigate to your Project folder (C:\tutorials\MFJazz1\).   You’ll see that it now includes

 

Now click [JCL] and then [Review JCL].  Because this is a batch program a job has been created to run it.  If you wish, use Windows Explorer to navigate to the JCL subfolder (C:\tutorials\MFJazz1\Jazz_JCL\).  You’ll see that DTIN1.JCL has been added to this.

Now click [Test].  The Process Form closes, and you return to the Jazz Workbench.  Now we click the sixth button, [MFJazz1], which has turned green.  A Visual Studio session opens the MFJazz1 project that we created in Step 1 so that we can test our program.

Step 5        Running our First Test

5.1        Adding the COBOL Program to the Visual Studio Project

Open Solution Explorer.  If necessary, you can open it from the View menu.  According to Solution Explorer, DTIN1.CBL is not in our project.  All it contains are the objects that we copied into it from the JCL tutorial: -

Yet when we look at the project folder C:\Tutorials\MFJazz1 with Windows Explorer we could clearly see that it is present, together with a lot of other stuff that was copied in when we clicked [Initialise Project] and [Add Training] in Step 3. 

What’s going on?

Objects are not part of the project just because they’re in the project folder.  If they haven’t been created with Visual Studio as part of the solution editing, then they have to be added. 

In Solution Explorer, right-click the project (the highlighted line [cbl] MFJazz1 above) and click Add/Existing Item from the context menu.  Windows Explorer opens, initially showing the project folder.  Click on DTIN1.CBL.   Repeat this, adding DTIN1.JCL from the Jazz_LocalJCL subfolder.  Now Solution Explorer looks like this, and we can open either or both of these objects in Visual Studio by double clicking them. 

5.2        Testing a Program (Batch)

Right-click the solution, and click Build Solution. The output window shows: -

To test batch program DTIN1.CBL, right-click DTIN1.JCL, and click Submit JCL.  Now the output window shows: -

<Ctrl>Click the Job Output link.  A browser window opens: -

Click JESYSMSG to see the JCL and JES messages: -

 

and click REPNBR1 to see the output written to this SYSOUT file: -

This is correct: it is the results that we expect from this program, and the same as the results obtained from direct z/OS testing when the COBOL and JCL were sent to a remote mainframe with FTP[1], and the job results returned to Jazz in Windows: -

Printed at 16 Feb 2018, 21:52:45 RepNbr1 Page   1

 

*---------------Names---------------*

 

BANFIELD, Nora Joyce Annie          

BARKMAN, Olivia Martha              

BARNES, Albert Paul                  

BARNES, Ann                         

BARNES, Arthur Cyril                

BARNES, Caroline                    

BARNES, Edward John                 

BARNES, Edward                      

BARNES, Hannah Francis              

BARNES, Harold Victor                

BARNES, Harriet Francis             

BARNES, Henry Maurice               

BARNES, Henry                       

BARNES, Hilda                       

BARNES, Jessie Crawford  

5.3        Debugging the COBOL program

Hopefully we won’t need to – if its function is wrong, we’ll go back and change it in Jazz – but as with any similar COBOL program it can be interactively debugged in Visual Studio. 

1.            In Solution Explorer, double-click DTIN1.CBL to open it

2.            Click in the left-hand column to put a checkpoint against a statement.  Here I’ve put a checkpoint on the first procedural statement: -

3.            Start debugging: click Start in the Visual Studio toolbar, or click menu Debug/Start Debugging, or press F5.  The Output Window shows output from Debug, and is currently clear.

4.            Right-click DTIN1.JCL, and click Submit JCL.  Your program starts running in debug mode: it stops on reaching the first checkpoint: -

5.            As usual you can step through the program with F10 and F11.  F10 will move the current (= highlighted) line through 5780, 5790, 5800 etc.  F11 will take the PERFORM branch on line 5790, branching to 6730

before eventually returning to 5800.   You can examine variables with Watch, and so on.  Click Continue to go to the next checkpoint, or finish running the program if there are none. 

6.            On completion open the Output Window, and choose output from Enterprise server.  The final link of this will be Job Output, which will show results as before.

Step 6.       Program Changes – Interacting with Jazz

Now that we’ve set up our COBOL Project and Enterprise Server we can continue development with Jazz, modifying program DTIN1 and adding new programs.  As we do this the generated COBOL and JCL are written into the MFJazz1 project.  For new programs these objects will have to be made known to the project with Add/Existing Item, but once known they will be updated. 

For example, let’s make a change to DTIN1, printing the name subscript as well as the name.  We make this change, adding “JZ.IX1,” to the PRINT statement.  Click [Process] and the message “COBOL Generated” appears, and [MFJazz1] turns green.

Click [MFJazz1] and control is passed to the Visual Studio solution.  It will be started if necessary, but if it is already active the current instance will be displayed, with this message: -

Click [Yes]. 

Now build the solution (in Solution Explorer, right-click the solution, click Build Solution from the context menu).  If you had left Visual Studio in debugging mode, you’ll be prompted to end debugging: reply OK.

Then run your program as before, by right-clicking DTIN1.JCL and clicking Submit JCL.

Click the Job Output link in the Output Window to open a browser on the job output, and then examine file REPNBR1.  Results are what we expect, with the report now including the index variable

Review

We set up a COBOL project (MFJazz1) with the Mainframe Server Application template.  This included a Micro Focus Server to test our programs.

We then configured Jazz so that when we processed program DTIN1.jzz the COBOL (DTIN1.CBL) and JCL (DTIN1.JCL) were written directly into the project’s folders.  From the Jazz workbench, [MFJazz1] opens the MFJazz1 project in Visual Studio.

For the first test we have to make DTIN1.CBL and DTIN1.JCL known to the MFJazz1 project with Add/Existing Item.  After building the solution we can test it by submitting DTIN1.JCL. We can use COBOL-level interactive debugging as normal, pausing at checkpoints, stepping through the program, and examining data.

If we change our Jazz program then within project MFJazz1 we simply rebuild the solution and retest

Next

The next chapter in this Users’ Guide series shows you how to create files (sequential and VSAM) that are used in Jazz demonstrations and tutorials, and how to use facilities such as Convert COBOL (which reads COBOL record layouts and converts them to Jazz) and create COBOL copy books for use by manually-written COBOL programs. 

Glossary 

MF

Micro Focus

IDE

Integrated Development Environment.   For example Visual Studio (Microsoft), Eclipse (Open Source)

VS

Visual Studio

VS2017

Visual Studio 2017

.NET

Microsoft’s development framework – a series of support classes used by programs generated with Visual Studio.

MFED

Micro Focus Enterprise Developer

FTP

File Transfer Protocol

FTPS

File Transfer Protocol (Secure)

JCL

Job Control Language    A language used to control jobs (particularly batch jobs) in z/OS systems

z/OS

Z-system Operating System.  Controls IBM Mainframes

 



[1] Actually FTPS – secure FTP.  Jazz automatically uses FTPS if the FTP port is correctly set up.