Skip to content

Commit 652b033

Browse files
committed
Fix line number with current lab files
Signed-off-by: Hartanto Ario Widjaya <[email protected]>
1 parent 075023b commit 652b033

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

COBOL Programming Course #1 - Getting Started/COBOL Programming Course #1 - Getting Started.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ The first thing you will notice when editing COBOL source code is that VSCode wi
421421

422422
### Variable expansion
423423

424-
As you browse through CBL0001 type `CTRL + G` to jump to a specific line of code. A small dialog will open asking you for the line you wish to jump to, type `68` and press the enter key. VSCode will highlight that line of code and navigate you directly to it, as shown in Figure 1.
424+
As you browse through CBL0001 type `CTRL + G` to jump to a specific line of code. A small dialog will open asking you for the line you wish to jump to, type `87` and press the enter key. VSCode will highlight that line of code and navigate you directly to it, as shown in Figure 1.
425425

426426
![](Images/image006.png)
427427

@@ -453,7 +453,7 @@ Within the explorer side bar of VSCode, there is an outline view that will be po
453453

454454
### Breadcrumb view
455455

456-
Similarly, the breadcrumb view across the top of the editor can show where the current line of code exists within the structure of the COBOL source code. As you navigate the source code in the editor, the breadcrumb trail will automatically update to reflect where you are in the structure of the program and provides you a mechanism to move to a different element of the code. Again, if you open CBL0001 in VSCode and jump to line 36, this line is a declaration of the field USA-STATE within the structure ACCT-FIELDS, in the FILE-SECTION of the DATA-DIVISION. Across the top of the editor the breadcrumb trail will show the information displayed in Figure 4.
456+
Similarly, the breadcrumb view across the top of the editor can show where the current line of code exists within the structure of the COBOL source code. As you navigate the source code in the editor, the breadcrumb trail will automatically update to reflect where you are in the structure of the program and provides you a mechanism to move to a different element of the code. Again, if you open CBL0001 in VSCode and jump to line 50, this line is a declaration of the field USA-STATE within the structure ACCT-FIELDS, in the FILE-SECTION of the DATA-DIVISION. Across the top of the editor the breadcrumb trail will show the information displayed in Figure 4.
457457

458458
![](Images/image013.png)
459459

@@ -467,9 +467,9 @@ Clicking on any of the items in the breadcrumb trail will highlight that element
467467

468468
### Jump to declaration / reference
469469

470-
As you browse through code you will come across COBOL PERFORM statements or variable references. Often you will need to navigate to the definition of that paragraph or variable to follow the execution of the code. At line 50 of CBL0001 we see a set of perform statements. Place the cursor within the name, READ-RECORD, on line 51, right click and select **Go to Definition** . The editor then navigates to the READ-RECORD paragraph on line 63. Instead of the right click, the same function can be reached by using the F12 key.
470+
As you browse through code you will come across COBOL PERFORM statements or variable references. Often you will need to navigate to the definition of that paragraph or variable to follow the execution of the code. At line 64 of CBL0001 we see a set of perform statements. Place the cursor within the name, READ-RECORD, on line 65, right click and select **Go to Definition** . The editor then navigates to the READ-RECORD paragraph on line 82. Instead of the right click, the same function can be reached by using the F12 key.
471471

472-
"Go to References" does the reverse of this operation and allows you to navigate from the definition of a paragraph or variable to all the places within the application that reference that paragraph or variable. To demonstrate this, navigate to line 63 of CBL0001, which again is the declaration of the READ-RECORD paragraph. To see all of the places where this paragraph is called, right click and select **Go to References** , or hit the key combination **SHIFT+F12** . This will summon a new pop up dialog which shows all the references to this paragraph in the code, shown in Figure 6.
472+
"Go to References" does the reverse of this operation and allows you to navigate from the definition of a paragraph or variable to all the places within the application that reference that paragraph or variable. To demonstrate this, navigate to line 82 of CBL0001, which again is the declaration of the READ-RECORD paragraph. To see all of the places where this paragraph is called, right click and select **Go to References** , or hit the key combination **SHIFT+F12** . This will summon a new pop up dialog which shows all the references to this paragraph in the code, shown in Figure 6.
473473

474474

475475

@@ -507,13 +507,13 @@ Working with source code is seldom just about the initial creation, during a pro
507507

508508
### Renaming variables
509509

510-
During maintenance of existing code, you might need to refactor variable names or paragraph names. Doing this manually can be a painful process, as you probably need to update both the original declaration and all the references within the source code. Fortunately, there is a function for that, let's work through an example. Back in CBL0001 hit **CTRL+G** to bring up the go to line function and go to line 29. This is the declaration of the variable ACCT-NO. Right click on the variable and select "**Find All References** ". From this we can see that apart from the declaration, the variable is also referenced on line 68. So, if we rename the variable, we probably need to update this reference as well. To perform the rename, ensure that the cursor is on the variable and then press **SHIFT/Fn+F2** . This will bring up a small pop-up asking you to provide a new variable name, as shown in Figure 8. Enter `ACCT-NO-TEST` and press **enter** .
510+
During maintenance of existing code, you might need to refactor variable names or paragraph names. Doing this manually can be a painful process, as you probably need to update both the original declaration and all the references within the source code. Fortunately, there is a function for that, let's work through an example. Back in CBL0001 hit **CTRL+G** to bring up the go to line function and go to line 40. This is the declaration of the variable ACCT-NO. Right click on the variable and select "**Find All References** ". From this we can see that apart from the declaration, the variable is also referenced on line 88. So, if we rename the variable, we probably need to update this reference as well. To perform the rename, ensure that the cursor is on the variable and then press **SHIFT/Fn+F2** . This will bring up a small pop-up asking you to provide a new variable name, as shown in Figure 8. Enter `ACCT-NO-TEST` and press **enter** .
511511

512512
![](Images/image021.png)
513513

514514
*Figure 8. Renaming variables*
515515

516-
You will note that both the declaration of the variable and the reference on line 68 have been updated to the new value. As stated previously, the same process also works for paragraph names. For example, go ahead and refactor the name of the paragraph READ-RECORD to be READ-NEW-RECORD.
516+
You will note that both the declaration of the variable and the reference on line 88 have been updated to the new value. As stated previously, the same process also works for paragraph names. For example, go ahead and refactor the name of the paragraph READ-RECORD to be READ-NEW-RECORD.
517517

518518
### Handling errors
519519

@@ -523,7 +523,7 @@ The IBM Z Open Editor plugin also provides a level of syntax checking for local
523523

524524
*Figure 9. Problems view*
525525

526-
Now we need to introduce an error into the code. After line 68, add the line:
526+
Now we need to introduce an error into the code. After line 87, add the line:
527527

528528
`MOVE ACCT-NO TO ACCT-NO-NO.`
529529

@@ -1948,7 +1948,7 @@ That is because you submitted the job from the .CBL data set and not the .JCL da
19481948

19491949
The difference is the return/completion code associated with each job output, located both next to the job output name within the JOBS section as shown above, or at the end of the compile output as, 0Return code ##. A return code of 12 means there was an error, but how do we know what that error was? Continue to find out!
19501950

1951-
7. Observe the text associated with IGYPA3146-S on line 137 within the job output (compile), illustrated in Figure 6.
1951+
7. Find the compile error, IGYPA3146-S, in the job output, illustrated in Figure 6.
19521952

19531953
![](Images/image121.png)
19541954

@@ -3359,7 +3359,7 @@ This lab utilizes two COBOL programs, CBL0004 and CBL0005, located within your i
33593359

33603360
5. Modify id.CBL(CBL0005) to include the dollar currency symbol in the report.
33613361

3362-
**Hint: Compare with CBL0004 line 25**
3362+
**Hint: Compare with CBL0004 line 33**
33633363

33643364

33653365
6. Re-submit job: CBL0005J

0 commit comments

Comments
 (0)