Cobol program with error


Contents


NOTE: If you wish to rerun this Test Drive Script, simply pick the same element if you ended successfully and start over. If you did not end successfully pick another COBOL program (TPROG02, 03, 04, etc.) to use and start the script over. Any other errors will require that you contact BMC Support Central

Getting Started with SCM – BMC AMI DevX Code Pipeline

The goal of this Test Drive is to make a change to a Cobol program using BMC AMI DevX Workbench for Eclipse which introduces an error. You will fix the error, regenerate, and promote it to Production using BMC AMI DevX Code Pipeline. Code Pipeline enables developers to quickly and safely build, and test their mainframe code.

This Test Drive will take you through the following activities:

  • Create an Assignment
  • Make code changes
  • Create compile errors with your code changes
  • Use compile diagnostics to find errors
  • Generate/compile
  • Fix compile errors using Compare/Merge feature
  • Promote to Test and Production runtime environments

Instructions:

  • This guide contains many screenshots to provide a visual reference
  • Please note each place that you must enter your own specific ID or number
  • You must complete each step before proceeding to the next to successfully follow the guide

If at any point during your experience the host connection times out, you may need to log back into the Test Drive host connection.

In this Test Drive the screen shots provided have used specific values that may differ from your assigned values. These were provided in your email notice.

Do This

Start your Test Drive by clicking here.

Code Changes

Your development task in this Test Drive is to change a Cobol program using the DevX Workbench editor and introduce an error. You will then fix it, regenerate it, and promote it through the Application Life-Cycle to Production.

First, you will find and add a Cobol program into an Code Pipeline Assignment from which you can perform all this work.

Do This
  1. Change the Stream to CWEZ.
  2. Change the Application to your assigned application value (Txxx, where xxx is your unique number).
  3. Note: The SubAppl field will be automatically populated with Application.
  4. Set the Level to "PRD" and ensure the Level option is set to "Selected level only" or "All found in level and above." Either setting will return the same results since there is no level above PRD.
  5.  Filter the view even further by setting the Type to COB, this will allow you to focus only on the Cobol program components available in your stream | application at the PRD level. Click Apply (circled).

Screenshot 2023-04-05 113910.png

The Repository View lists the Cobol Components for your application.

ispw2-repository-explorer-2.png 

Do This

Right-Click on "COB TPROG01 PRD" and click Add to Assignment with Checkout.

Screenshot 2023-04-02 094652.png

Do This

From the Add Task dialog box, click the New button to the right of Assignment. This will allow you to create a new Assignment Container to put your Cobol program into.

Screenshot 2023-04-02 094756.png

Do This

Type a description and Click OK.

Screenshot 2023-04-02 094835.png

A message will be displayed providing you with your new Assignment name.

Do This

Click OK.

Screenshot 2023-04-02 094908.png

Your new Assignment has been created and is ready to have Tasks added to it. An Assignment Container is the only Container Type in Code Pipeline that Tasks can be added to. The Assignment Container is where a developer will spend much of their time.

Your new Assignment number will appear in the Assignment field.

Do This

Click OK (screenshot not shown).

A message will be displayed to inform you that the task has been added to your Assignment.

Do This

Click OK.

Screenshot 2023-04-02 094947.png

Your Assignment has been created and you should now have a Cobol program in it.

Do This

If it is not selected, click on the Tasks view and the Task that was added will be listed (screenshot not shown).

Every operation that needs to be performed on this Task and other Components which are impacted by changing this Task (edit, impact analysis, compile, promote, deployment, etc.) can be performed from this Assignment or other Assignments.

Note that the Cobol program in the Assignment is checked out and sitting in the DEV1 level. The checkout date/time and userid is reflected in the Task information. At checkout, a destination level for the checkout was chosen – DEV1.

Screenshot 2023-04-02 095306.png 

To see the Life-Cycle, path structure, that was constructed for the Application:

Do This

Click once on the Task and then Click on the View Life-Cycle icon.

Screenshot 2023-04-02 095306.png

A picture of the Life-Cycle is presented.

Screenshot 2023-04-02 095341.png 

By choosing the DEV1 Level, you have defined the Path to Production ==> DEV1-QA1-STG-PRD. Other versions of these Components may also exist at other levels and may be passing through the other three paths – FIX, DEV2, or DEV3.

Four paths were created for the application – one for emergencies starting at level FIX and three for development starting at DEV1, DEV2, and DEV3. The application level structure is customizable when defining the applications to Code Pipeline. Any number of paths can be defined with a minimum of three Levels.

Now that you have a Version of a Cobol program the next step would be to make changes to it.

Do This

Either right-click on TPROG01 and click Edit or simply double-click on it.

The version's source will be presented in the DevX Workbench Cobol editor.

Do This

If you get the "Copybook Download" prompt, Click Yes.

Screenshot 2023-04-02 095419.png

DevX Workbench downloads the copybooks.

Do This

Type your changes. Make sure you break the program so that it won't compile. As an example, we removed "ID" from PROGRAM-ID and removed the * from line 800. You can do anything you like to break the program.

Once you have made your changes, close the Edit view and click Yes.

Screenshot 2023-04-02 095659.png

Note the Operation, Date/Time, and User ID fields have been updated to reflect the change in the Task status.

Screenshot 2023-04-02 095814.png 

Generate (AKA Compile)

The Cobol program will be generated/compiled, and your Assignment Task List will be updated to reflect the new status.

  • The Operation will be Generate
  • The User ID, Date/Time will be updated
  • The Message will be updated to reflect the completion of the generate

Now it is time to compile/generate the Cobol program, so we can do our testing.

Do This

Right-click on TPROG01 and click Generate.

The status column will display a message showing that the Task is being generated.

Screenshot 2023-04-02 095904.png

Screenshot 2023-04-02 095924.png

The screen will refresh automatically when the generate is done. The Task will be updated with the date and time of the generate and the user who performed the generate.

As expected, the Status column indicates that the generate has failed.

Screenshot 2023-04-02 095956.png 

DevX Workbench allows you to display the Compile Diagnostics integrated with the source.

Do This

Click on the Problems view to Show Compile Diagnostics.


Click the expand button for Errors as shown below.


Screenshot 2023-04-02 100115.png



Do This

To go right to your error in the source code, double-click on the first error message.



If you get the "Copybook Download" prompt, click Yes.

Screenshot 2023-04-02 100208.png

Screenshot 2023-04-02 095419.png

DevX Workbench displays the source positioned at the error on which you double-clicked.

Screenshot 2023-04-02 100330.png 

For our purposes, we are going to resolve the errors by merging with the version in Production.

Do This

Close the source by clicking on the close button.

Do This

Click the Tasks view.

Screenshot 2023-04-02 100432.png

Do This

Right-click on TPROG01 and click Compare/Merge.


Code Pipeline will display a dialog for you to select the version to compare to. Click the current Production version then click OK.

Screenshot 2023-04-02 100513.png


Screenshot 2023-04-02 100813.png

The Compare view opens showing the two versions side by side. The program on the right is TPROG01 at PRD and the program on the left is the one you just changed in DEV1.

Do This

If they are reversed, click the Swap Left and Right View button, circled.

Screenshot 2023-04-02 101015.png

When you hover your cursor over the buttons above the Text Compare, you will see a variety of selections that you can use to help fix your program.

Do This

Click the "Copy All Non-Conflicting Changes from Right to Left" button.

Screenshot 2023-04-02 101158.png

This copies all the differences from the Production version into the current version.

This tool can also be used if you are in a concurrent development situation and you want to compare your version of the program to another developer's version of the program.

Do This

Close the Compare View and click Save.

Screenshot 2023-04-02 101233.png

You are now ready to generate your program. 

Do This

Right-click on the program and select Generate.

Screenshot 2023-04-02 101318.png

Promotion

At this point you have:

  • Edited a Cobol program and made errors in your coding so that the program would not compile successfully
  • Used the Code Pipeline compare/merge feature to fix said errors
  • Generated your program after the errors were fixed

Now you are ready to promote your changes to the QA1 level.

Do This

To promote the Task to the QA1 level, Right-click on the task and click Promote.

Screenshot 2023-04-02 101456.png

This action will create a Set Container. Sets are a special category of container that are used to conduct operations such as promotion and deploy. They are temporary and created by Code Pipeline as needed for the work. This allows you to promote subsets of Tasks within an Assignment container without the need to act on all of the Tasks at once.

Once you click Promote the selected Task(s) are placed in a SET container for the promotion.

The Code Pipeline Set processor will:

  • Perform the promotion of the source to QA1
  • Cleanup the DEV1 level (source and parts if applicable)
  • Perform generates, in order, of all the Task(s) in the SET which require a generation


A notification will appear in the lower right of the DevX Workbench indicating the Promotion has completed. 

PromoteCompleted_1task.png


In the screen shot below you can see the promote operation has completed – the Task has been promoted to QA1 (see the Level value and the Operation in the Task List as well as the highlighted Level in the picture).

Note: the Operation column shows Generate as the last operation. The SET processor performed a promotion and then a generation as Code Pipeline recognized a generate was required for COB types at the QA1 level based on the configuration of this application. This can be configured by the Code Pipeline administrator.


Screenshot 2023-04-02 110848.png 

Let us assume all the testing at the QA1 level has been successfully completed and you are ready to promote to the STG level.

Do This

Select the Task as before, right Click and click Promote.

Screenshot 2023-04-02 110929.png

A Set container is created. The selected Task(s) are placed in a SET container for the promotion. The Code Pipeline Set processor will:

  • Perform the promotions of all the parts to STG
  • Cleanup the QA1 level (source and parts if applicable)


Do This

As the Task(s) in the SET are being processed, you can monitor the progress by clicking the refresh button. worddav61a600228168393a64efc91799e6be9f.png


This screen shot shows:

  • The promotion has completed
  • All the Parts have successfully been promoted to STG

Screenshot 2023-04-02 111104.png

Note: the last Operation shown is Promote. The SET processor performed a promotion and recognized that a Generate was not required for COB types at the STG level based on the configuration of this application.

Assuming all the testing at the STG level has been successfully completed, you are now ready to promote the Tasks to the PRD level.

Do This

Select the Task as before, right-click on it and select Promote.

Screenshot 2023-04-02 111133.png

Note: Code Pipeline uses your installation's security (RACF/Top Secret/ACF2) to manage process security (granular control of permissions by user and function). Process security defines who can perform which commands at which levels in the Life-Cycle.

While a Developer can perhaps request the Promote operation when promoting to the STG and QA1 levels, perhaps a Change Coordinator role is responsible for requesting the Promotion to PRD. One or more approvals can be put in place for each application/level promotion, including but not limited to Application Manager, QA Manager, Impact, DBA, JOB Scheduling, peer, or VP roles.

A Set container will be created. The selected Task(s) are being placed in a SET container for the promotion.

The Code Pipeline Set processor will:

  • Perform the promotions of all the parts to the PRD Level
  • Cleanup the STG level source and parts as applicable


A notification will appear in the lower right of the DevX Workbench indicating the application has been configured to require an approval for the promotion to PRD. The Tasks are locked in a SET for a Promote process, but the SET needs approval before the promote can proceed.

ApprovalRequired.png


Below the STATUS shows the Tasks are locked in a SET for a Promote process but the SET needs approval before the promote can proceed.

The Approval can be performed from:

  • DevX Workbench/Code Pipeline
  • TSO/Code Pipeline in the ISPF interface
  • Web interface (including mobile browser)

For this Test Drive you will do the approval from DevX Workbench/Code Pipeline. To perform the approval:

Do This

Click on the task, then right-click on the STG box in the Life-Cycle diagram.

Click "Approve."

Screenshot 2023-04-02 111258.png

Code Pipeline will now start a SET processor to perform the promotion of the Tasks collected in the SET to the PRD Level.

You can see in the updated screen below that:

  • SET processing has completed
  • The Cobol program has been processed for a Promotion and is now at the PRD level

Screenshot 2023-04-02 111326.png

The Promotion to the PRD level has completed. The source and parts for the Cobol program were moved to the PRD level Life-Cycle libraries and the STG level libraries were cleaned up as appropriate.

Do This

Close the Code Pipeline Tasks view.

Screenshot 2023-04-02 111326.png

As a Developer you are now finished with your Assignment, so it can be closed. Assignments are closed manually and are usually closed to unclutter the Container List View.

Do This

Click on the Containers view.

Right-click on your Assignment and click Close.

Screenshot 2023-04-02 111718.png


Screenshot 2023-04-02 111752.png

A Close confirmation panel is presented.

Do This

Click OK to complete the Close.

Screenshot 2023-04-02 111815.png

For audit purposes, Closed Assignments, Sets, and Releases are never deleted from Code Pipeline. They are just filtered out of the standard day-to-day filtering. Once an Assignment, Set, or Release is closed it is removed from the standard filtered list, but it is still part of Code Pipeline history and can be viewed at any time.

You are done! Your job has been to change a Cobol program and promote to Production. As a part of this exercise, you have been able to use DevX Workbench and Code Pipeline to execute a workflow:

  • Created an Assignment
  • Added and checked out a Cobol program
  • Changed it using the DevX Workbench Editor
  • Created compile errors
  • Compiled/Generated the program
  • Viewed the Compile diagnostics
  • Fixed the compile errors using the Compare/Merge feature
  • Generated the program again
  • Promoted the Task from DEV1 to QA1, QA1 to STG and STG to PRD
  • Approved the promotion to Production
  • Closed your Assignment to complete the change cycle

Congratulations! This completes the Code Pipeline tutorial for BMC Test Drive.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*