Step 1
/SET-FILE-LINK LINK-NAME=INPFIL, FILE-NAME=INP /START-EXECUTABLE-PROGRAM FROM-FILE = MOBS % BLS0517 MODULE 'MOBS' LOADED 9089 INTERRUPT-CODE= 60 AT PC= 00000C46 % EXC0732 ABNORMAL PROGRAM-TERMINATION. ERROR-CODE 'NRT0101': /HELP-MSG NRT0101 |
The input file INP is assigned to the program. The MOBS program is started. The program run is aborted due to a data error (EC=60).
Step 2
/SET-FILE-LINK LINK-NAME=BLSLIB00,FILE-NAME=$.SYSLNK.CRTE /SET-FILE-LINK LINK-NAME=INPFIL,FILE-NAME=INP /LOAD-EXE (BIBLIO,MOBS),DBL-PARA=(RESOLUTION=(ALT-LIB=YES)),TEST-OPTIONS=*AID % BLS0517 MODULE 'MOBS' LOADED |
The program is loaded once more, this time with LSD information. It is not started immediately so as to allow AID commands to be entered first.
/%ON %ANY;%RESUME |
The %ON %ANY is intended to ensure that it is possible to enter further AID commands before the end of the program. The program is subsequently started again with %RESUME.
9089 INTERRUPT-CODE = 60 AT PC= 00000C46 , COMPILATION UNIT MOBS STOPPED AT V'F4DCBC' = IT0TRM@ + #2C'' , EVENT: TERM (ABNORMAL,STEP,NODUMP)
The program encounters the known error.
|
The %DISPLAY command determines the symbolic address at which the data error occurs. It is the source reference S’58ADD’.
/%display number(j) |
The aim here in the program, after the character from the input record has been assigned to A-Z-TAB accordingly, is to increment the counter for this letter by 1. A %DISPLAY command relating to the table location referenced by index in the COBOL statement ADD is rejected by AID. As was apparent from the previous output relating to the high level location (%HLLOC) of the current interrupt point, this is contained in the IT0TRM@ module of the runtime system. Symbolic addresses in the MOBS program must therefore be qualified in AID commands. AID requires the S and PROC qualification here, or the PROG qualification can be used for the short PROGRAM-ID ’MOBS’.
/%d prog=mobs.number(j) % AID0400 Dimension 01 of array NUMBER out of range or array has no element |
The new error message indicates that the index J for number has an invalid value. AID cannot work with this address either.
/%qualify prog=mobs |
The prequalification is defined so as not to have to write the qualification repeatedly in further AID commands. In subsequent commands all that is necessary is to insert a period in front of a symbolic address instead of the qualification.
/%d .j J = +42 |
AID outputs the content of J. The maximum value of the index is 26; however, J contains 42. This resulted in the data error.
/%d .item(k) ITEM( 6) = |I| |
The data error occurred during processing of the sixth character from the input record.
/%d .k,.i K = +6 I = +9 |
The value of index I is 9. It is correctly positioned at the location of the letter ’I’ in the alphabet.
/%d .recd 01 RECD 02 ITEM(1:61) ( 1) |D| ( 2) |I| ( 3) |E| ( 4) |S| ( 5) | | ( 6) |I| ( 7) |S| ( 8) |T| ( 9) | | ( 10) |E| ( 11) |I| ( 12) |N| ( 13) |E| ( 14) | | ( 15) |D| ( 16) |A| ( 17) |T| ( 18) |E| ( 19) |I| ( 20) |,| ( 21) | | ( 22) |D| ( 23) |I| ( 24) |E| ( 25) | | ( 26) |A| ( 27) |L| ( 28) |S| ( 29) | | ( 30) |E| ( 31) |I| ( 32) |N| ( 33) |G| ( 34) |A| ( 35) |B| ( 36) |E| ( 37) | | ( 38) |D| ( 39) |I| ( 40) |E| ( 41) |N| ( 42) |T| ( 43) | | ( 44) |F| ( 45) |U| ( 46) |E| ( 47) |R| ( 48) | | ( 49) |E| ( 50) |I| ( 51) |N| ( 52) | | ( 53) |P| ( 54) |R| ( 55) |O| ( 56) |G| ( 57) |R| ( 58) |A| ( 59) |M| ( 60) |M| ( 61) |,| |
The entire input record is output with %DISPLAY. AID edits it as a table in accordance with the definition in the source program.
Step 3
|
The program is loaded again. The %TRACE in the PROCESSING paragraph is used to show the context of the ADD statement.
Step 4
/%control1 %assgn in Processing <con1: %d item(k),i,j> |
CON1 subcommand is to be executed. The character to be processed from the input record and the status of indices I and J are then output.
/%in s'54if' <ins1: (%.con1 gt 10): %stop> |
The run is to be interrupted after the CON1 subcommand has been executed 10 times.
/%in s'58add' <ins2: (j gt 26): %stop> /%r |
Before the addition in NUMBER(J) is executed, AID checks whether index J has a permissible value. If it is too high, AID interrupts the program.
The program is started after input of the %INSERT command.
|
From the AID log of subcommand CON1 it can be seen that processing of the first character from the input file is running correctly. Indices I and J run in parallel. From the second character onwards, J begins to grow more quickly. At the fourth letter, the index increases to 34. Before a data error occurs again at source reference S’58ADD’, the conditional subcommand INS2 is executed, as a result of which execution is interrupted. For the letter ’S’, index I is correctly at position 19 in the A-Z-TAB table.
It can be seen from the log that index I is reset to the initial value of 1 for processing a character, but index J is not.
/%set i into j /%r |
Index J is set to the contents of I and the program is continued.
|
The CON1 subcommand is still active and the associated execution counter has not been changed, and the %STOP in subcommand INS1 is therefore executed again.
/%remove %.ins1;%resume |
The INS1 subcommand is deleted and the program is continued with %RESUME.
|
Once again, the condition (J greater than 26) for subcommand INS2 has been met and the program halted.
/%d item(k),i,j SRC_REF: 58ADD SOURCE: MOBS PROC: MOBS **************************** ITEM( 6) = |I| I = +9 J = +27 |
Index J is again too high. Before the COBOL statement SEARCH is executed index I is set to 1 again, but it was forgotten to assign index J with the initial value as well.
/%insert s'56set' <ins3: %set 1 into j> /%set i into j;%r |
Before the SEARCH statement S’57SEA’ is executed, index J is now also to be assigned the correct initial value via the new %INSERT. To ensure that the statement S’58ADD’, before which the program was interrupted by the %STOP in subcommand INS2, is executed correctly, the value of index I is transferred to J with the single %SET.
ITEM( 6) = |I| I = +9 J = +9 SRC_REF: 55ADD SOURCE: MOBS PROC: MOBS **************************** ITEM( 7) = |S| I = +9 J = +9 SRC_REF: 56SET SOURCE: MOBS PROC: MOBS **************************** ITEM( 7) = |S| I = +9 J = +1 SRC_REF: 58ADD SOURCE: MOBS PROC: MOBS **************************** ITEM( 7) = |S| I = +19 J = +19 SRC_REF: 55ADD SOURCE: MOBS PROC: MOBS **************************** ITEM( 8) = |T| I = +19 J = +19 SRC_REF: 56SET SOURCE: MOBS PROC: MOBS **************************** ITEM( 8) = |T| I = +19 J = +1 SRC_REF: 58ADD SOURCE: MOBS PROC: MOBS **************************** ITEM( 8) = |T| I = +20 J = +20 SRC_REF: 55ADD SOURCE: MOBS PROC: MOBS **************************** ITEM( 10) = |E| I = +20 J = +20 SRC_REF: 56SET SOURCE: MOBS PROC: MOBS **************************** ITEM( 10) = |E| I = +20 J = +1 SRC_REF: 58ADD SOURCE: MOBS PROC: MOBS **************************** ITEM( 10) = |E| I = +5 J = +5 K2-EVENT HAPPENS DURING TERMINAL DISPLAY OF WROUT OUTPUT
As it can be seen that the program is now running correctly, output is interrupted with the K2 key.
|
%SHOW is used to check which %INSERT and %CONTROL commands are still active. The INS2 subcommand is now superfluous and is deleted. The outputs of subcommand CON1 are also no longer required. Only the correction of the third %INSERT is necessary. The program is continued.
LETTER NUMBER PERCENT A 34 9.68 B 13 3.70 C 18 5.12 D 15 4.27 E 56 15.95 F 5 1.42 G 6 1.70 H 18 5.12 I 31 8.83 J 1 0.28 K 4 1.13 L 16 4.55 M 11 3.13 N 29 8.26 O 8 2.27 P 4 1.13 Q 1 0.28 R 17 4.84 S 18 5.12 T 16 4.55 U 8 2.27 V 4 1.13 W 2 0.56 X 1 0.28 Y 1 0.28 Z 8 2.27 TOTAL: 351 98.12
The program now runs through to the end and outputs the result list. As invalid indices were used at the start of the program run, some results may not yet be correct. The program must be executed once more with the AID correction.
Step 5
/LOAD-PROGRAM *M(BIBLIO,MOBS,R-M=A(A-L=V)),T-O=AID % BLS0500 PROGRAM 'MOBS' LOADED /%IN S'56SET' <%SET 1 INTO J> /%R LETTER NUMBER PERCENT A 34 9.68 B 13 3.70 C 18 5.12 D 15 4.27 E 57 16.23 F 5 1.42 G 6 1.70 H 18 5.12 I 32 9.11 J 1 0.28 K 4 1.13 L 15 4.27 M 11 3.13 N 29 8.26 O 8 2.27 P 3 0.85 Q 1 0.28 R 17 4.84 S 18 5.12 T 16 4.55 U 8 2.27 V 4 1.13 W 2 0.56 X 1 0.28 Y 1 0.28 Z 8 2.27 TOTAL: 351 98.12 |
The program is loaded again. With %INSERT you set a test point to the SEARCH statement in line 56. Whenever the program reaches this test point, J is set to 1.
The program is started and outputs the required table.