Cobol program with error
Contents
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.
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.
The Repository View lists the Cobol Components for your application.
A message will be displayed providing you with your new Assignment name.
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.
A message will be displayed to inform you that the task has been added to your Assignment.
Your Assignment has been created and you should now have a Cobol program in it.
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.
To see the Life-Cycle, path structure, that was constructed for the Application:
A picture of the Life-Cycle is presented.
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.
The version's source will be presented in the DevX Workbench Cobol editor.
DevX Workbench downloads the copybooks.
Note the Operation, Date/Time, and User ID fields have been updated to reflect the change in the Task status.
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.
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.
DevX Workbench allows you to display the Compile Diagnostics integrated with the source.
DevX Workbench displays the source positioned at the error on which you double-clicked.
For our purposes, we are going to resolve the errors by merging with the version in Production.
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.
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.
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.
You are now ready to generate your program.
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.
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.
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).
Let us assume all the testing at the QA1 level has been successfully completed and you are ready to promote to the STG level.
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)
This screen shot shows:
- The promotion has completed
- All the Parts have successfully been promoted to STG
Assuming all the testing at the STG level has been successfully completed, you are now ready to promote the Tasks to the PRD level.
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.
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:
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
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.
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.
A Close confirmation panel is presented.
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.