You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: COBOL Programming Course #1 - Getting Started/COBOL Programming Course #1 - Getting Started.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -421,7 +421,7 @@ The first thing you will notice when editing COBOL source code is that VSCode wi
421
421
422
422
### Variable expansion
423
423
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.
425
425
426
426

427
427
@@ -453,7 +453,7 @@ Within the explorer side bar of VSCode, there is an outline view that will be po
453
453
454
454
### Breadcrumb view
455
455
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.
457
457
458
458

459
459
@@ -467,9 +467,9 @@ Clicking on any of the items in the breadcrumb trail will highlight that element
467
467
468
468
### Jump to declaration / reference
469
469
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.
471
471
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.
473
473
474
474
475
475
@@ -507,13 +507,13 @@ Working with source code is seldom just about the initial creation, during a pro
507
507
508
508
### Renaming variables
509
509
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** .
511
511
512
512

513
513
514
514
*Figure 8. Renaming variables*
515
515
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.
517
517
518
518
### Handling errors
519
519
@@ -523,7 +523,7 @@ The IBM Z Open Editor plugin also provides a level of syntax checking for local
523
523
524
524
*Figure 9. Problems view*
525
525
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:
527
527
528
528
`MOVE ACCT-NO TO ACCT-NO-NO.`
529
529
@@ -1948,7 +1948,7 @@ That is because you submitted the job from the .CBL data set and not the .JCL da
1948
1948
1949
1949
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!
1950
1950
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.
1952
1952
1953
1953

1954
1954
@@ -3359,7 +3359,7 @@ This lab utilizes two COBOL programs, CBL0004 and CBL0005, located within your i
3359
3359
3360
3360
5. Modify id.CBL(CBL0005) to include the dollar currency symbol in the report.
0 commit comments