- Login to the workshop system using the given URL, username, and password, and follow the steps your instructor provides
- You are in the secure cloud environment which runs VSCode and is connected to the Mainframe
- Make sure the initial build process has been completed successfully (exit code: 0 message in the active terminal)
- Close the terminal from it's right top corner
- Go to Zowe Explorer (Z icon in the VSCode Activity Bar)
- Hover the “zosmf” item in the DATA SET section in the sidebar and click on the magnifier icon
- Fill in the data set: CUST0xy.PUBLIC to add all data sets with this prefix to Zowe Explorer (Use your userID number instead of CUST0xy)
- Expand the CUST0xy.PUBLIC.JCL data set and right-click on the RUNDOG
- Select “Submit Job” menu item, then click "Submit" from the pop-up window
- Click on the JOB number in the pop-up message in the right bottom corner to see the JOB output (if the notification disappears, you can hit the bell icon from the bottom-right corner to see)
- Expand the “RUNDOG(JOBxxxxx)” and click on the RUN:OUTREP item to browse the program output (Repeat the 6th step if you cannot expand the job output)
- Breeds not specified in the COBOL code, fall into the OTHER section in the execution report. Now, your task is to add one more breed to the program to result in printing it in this report
- Go to Explorer for Endevor extension from the Activity Bar
- Wait for the initializing process to be completed
- Expand endevor and endevor-location wait for fetching the elements (connection and location settings have already been pre-configured prior the workshop)
- Fetching the elements will result in a warning due to your empty dev sandbox
- Map the changes from the prod environment using the up-arrow
- Now you have all of the DOGGOS applications in your cloud VSCode IDE.
- Find the COBOL code associated with your user under the [MAP] folder by expanding as shown below
- Right-click, select edit, and start coding to add a new dog breed.
- Copy block of code (lines 59-61)
- Paste it after line 61 (You can use CTRL+G to jump into the given line number)
- Change JINGO to another dog breed name (e. g. HUSKY) in the whole pasted block of code
- For HUSKY-INDEX-VALUE change VALUE to 9 (line 63)
- For OTHER-INDEX-VALUE change VALUE to 10 (line 66)
- Change PIC 9(1) to PIC 9(2) for OTHER-INDEX-VALUE (line 66)
- Change OCCURS value to 10 (line 71)
- Copy block of code (lines 208-210)
- Paste it after line 210
- Change JINGO to the dog breed name you picked in step 3 (HUSKY) within the pasted block of code
- Copy block of code (lines 139-142)
- Paste it after line 142
- Change JINGO to the dog breed name you picked in step 3 (HUSKY) within the pasted block of code
- Use CTRL+S (or COMMAND+S) to save the changes and bring the file to your sandbox
- A prompt will ask for the Endevor path to upload the COBOL element. Hit enter to approve the pre-filled value
- Add your mainframe username as CCID, and add a change comment (e.g 'new breed added').
- Select Yes from the list to generate the object modules
- Wait for upload&fetch elements
- Expand the LNK folder, find the element associated with your user under the [MAP] folder, right click and select edit
- Without any edit, use CTRL+S (or COMMAND+S) to bring the file to your sandbox
- A prompt will ask for the Endevor path to upload the link element. Hit enter to approve the pre-filled value
- Add your mainframe username as CCID, and add a comment (e.g 'bring link element').
- Select Yes from the list to generate the load modules
- Wait for upload&fetching elements
- Collapse the [MAP] folders to see your edited LINK element
- At this step your Explorer for Endevor tab would look like the following:
- Go to Zowe Explorer (Z icon in the VSCode Activity Bar)
- Hover the “zosmf” item in the DATA SET section in the sidebar and click on the magnifier icon.
- Click on the CUST0xy.PUBLIC.INPUT data set to edit it
- Add the following line with the name of the dog breed you chose in the code change (HUSKY)
- Use CTRL+S (or COMMAND+S) to save the change
- Expand the CUST0xy.PUBLIC.JCL data set and right click on the NDRUNDOG
- Select “Submit Job” menu item, then click "Submit" from the pop-up window
- Click on the JOB number in the pop up message in the right bottom corner to see the JOB output
- Expand the “NDRUNDOG(JOBxxxxx)” and click on the RUN:OUTREP item to browse the program output (Repeat 8th step if you cannot expand the job output)
The new dog breed “HUSKY” is listed and the counter reports 11 adopted HUSKY dogs. 🎉
- Let’s introduce a bug in the program data 🙂 Go to the input file again and change the breed from “JINGO” to “JINGA”.
- Use CTRL+S (or COMMAND+S) to save the change
- Rerun the application repeating the steps in the previous section (from 6th step)
- Open the output file and see that report is wrong, it now contains 0 for JINGO and 6 for the OTHER
- Let’s debug the program
- Go to debugger extension by clicking the play icon with a bug
shortcut: CTRL+SHIFT+D (or COMMAND+SHIFT+D)
- We already have the debugging session preconfigured for DOGGOS application, make sure you choose the one for Endevor from the dropdown
- Click the play button to start the debugging
- You will be asked for your Mainframe password. It is the same as your mainframe userID. Now the debugger will fetch the extended source and start the session.
- Now where to put a breakpoint?
- The report for JINGO breed was wrong, so let’s put a breakpoint where the value is updated. Let’s find the first place in the code by searching for JINGO with Ctrl+F (CMD+F on Mac).
- We can see that processing for JINGO breed is handled by these variables.
- Let’s find all instances where JINGO-BREED-NAME by right-clicking on it, and selecting Peek → Peek references. Go through the references to find where the amount is updated. It will be here around line 238 in extended source:
- Double-click on the 238 line in the editor window to move there.
- Now let’s add a breakpoint after this condition to see if we get there. Click on the left area on line 239. The red dot will appear
- The value for OTHER breeds was wrong in the repo. Let’s put there a breakpoint as well That would be on line 245
- We now have 2 breakpoints (you can see them in breakpoints section in the bottom left corner):
- Now let’s continue the execution by clicking the play button on the left of the debug toolbar (or F5):
- We can see that while looping through the breeds the debugger skipped the breakpoint on line 239 and stopped at line 245
- Let’s check the variables. Click on the INP-ADOPTED-AMOUNT variable, right-click, and “Add to watch”
- Do the same for the INP-DOG-BREED variable on line 216 to understand which breed we are analyzing
- You can see in your watch section the value of the variables (BTW, a quick way is just to hover over a variable name in your extended source and the value will pop up)
- As you can see we have encountered a wrong breed name “JINGA”, which means that our input file is corrupted! We also never entered a section for the JINGO breed, which means we never actually encountered this breed while parsing.
- Now we found our problem - wrong breed in the input file :)
- Stop the debug session by clicking the stop icon from the debugging toolbar.