home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR9
/
COBXREF.ZIP
/
PROGRAM.CBL
< prev
next >
Wrap
Text File
|
1993-05-25
|
17KB
|
518 lines
000002 IDENTIFICATION DIVISION.
000003 PROGRAM-ID. ICL8TRMXPROG.
000004*
000005*AUTHOR N H JENNINGS.
000006*COPYRIGHT TRANTOR Ltd.
000007*
*
* Part of a MANTIS cross reference program for ICL VME
* This module converts a MANTIS program from internal
* tokenised format into source lines.
* It is an inverted program which returns one source line at a
* time to the calling program.
* It was created by COBFORM from a structured original.
*
000008 ENVIRONMENT DIVISION.
000009 CONFIGURATION SECTION.
000010*
000011 SOURCE-COMPUTER. ICL-2900.
000012 OBJECT-COMPUTER. ICL-2900.
000013 SPECIAL-NAMES. SYSICL8TRCTRLKEY IS ICL8TRCTRLKEY,
000014/
000015 .
000016 DATA DIVISION.
000017 WORKING-STORAGE SECTION.
000018 01 DISP-ITEM.
000019 03 DISP-X PIC X
000020 OCCURS 40.
000021
000022 01 ICL8TRMXPROG-WS.
000023 03 WC-ENTITY PIC S9(4) COMP.
000024 03 WD.
000025 05 WD-NUMBER PIC -(18).
000026 05 WD-NUM REDEFINES WD-NUMBER.
000027 07 WD-DIGIT PIC X
000028 OCCURS 18.
000029
000030 05 WD-BINARY PIC S9(17) COMP.
000031 05 WD-GROUP REDEFINES WD-BINARY.
000032 07 WD-E PIC X.
000033 07 WD-F PIC X.
000034 07 WD-G PIC X.
000035 07 WD-H PIC X.
000036 07 WD-A PIC X.
000037 07 WD-B PIC X.
000038 07 WD-C PIC X.
000039 07 WD-D PIC X.
000040 05 WD-FLOAT REDEFINES WD-BINARY COMP-2.
000041 05 WD-SHORT REDEFINES WD-FLOAT.
000042 07 FILLER PIC X(4).
000043 07 WD-SHORT-FLOAT COMP-1.
000044 03 WD-MORE.
000045 05 WD-DISP-FLOAT PIC +V9(16)E+99.
000046 05 WD-XX REDEFINES WD-DISP-FLOAT.
000047 07 WD-FIXNUM PIC 9(17).
000048 07 FILLER REDEFINES WD-FIXNUM.
000049 09 WD-DATA-SIGN
000050 PIC X.
000051 09 WD-FILLER PIC 9(16).
000052
000053 07 FILLER PIC X.
000054 07 WD-SIGN PIC X.
000055 07 WD-MANT PIC 99.
000056 05 WD-FIXED REDEFINES WD-XX.
000057 07 WD-FDIGIT PIC X
000058 OCCURS 21.
000059 03 WD-RESULT.
000060 05 WD-X PIC X
000061 OCCURS 78.
000062
000063 03 WD-EXTERNAL.
000064 05 WD-CHAR PIC X
000065 OCCURS 18.
000066 03 WE-VAL.
000067 05 WE-DISP PIC 999.
000068 03 WF-STACK-AREA.
000069 05 WF-PTR PIC S9(9) COMP SYNC.
000070 05 WF-STACK.
000071 07 WF-TYPE PIC X(8)
000072 OCCURS 50.
000073 03 WK-CHECK.
000074 05 WK-VAL PIC S9(4) COMP.
000075 05 WK-BYTES REDEFINES WK-VAL.
000076 07 PIC X.
000077 07 WK-BYTE PIC X.
000078 03 WK-DOT PIC X.
000079 03 WK-COBNAME PIC X(32).
000080 03 WK-STATUS PIC X(32).
000081 03 WK-KEY.
000082 05 WK-USER-CODE PIC 1(8) COMP-5.
000083 05 WK-ENTITY PIC S9(4) COMP.
000084 05 WK-ITEM PIC X(32).
000085 05 WK-LV PIC X.
000086 03 DUMMY PIC S9(4) COMP.
000087 03 CURRENT-ENTITY PIC S9(4) COMP.
000088 03 CURRENT-USER PIC 1(8) COMP-5.
000089 03 ENTITY-SUBSCRIPT PIC S9(4) COMP.
000090 03 WK-FIELD-SIZE PIC S9(9) COMP SYNC.
000091 03 WS-EOD PIC S9(9) COMP SYNC.
000092 03 REC-NO PIC S9(9) COMP SYNC.
000093 03 REC-PTR PIC S9(9) COMP SYNC.
000094 03 B-PSV PIC S9(9) COMP SYNC
000095 VALUE 1.
000096 03 I PIC S9(9) COMP SYNC.
000097 03 J PIC S9(9) COMP SYNC.
000098 03 K PIC S9(9) COMP SYNC.
000099 03 L PIC S9(9) COMP SYNC.
000100 03 LK-WHEN PIC S9(9) COMP SYNC.
000101 03 LK-PTR PIC S9(9) COMP SYNC.
000102 03 LK-OFFSET PIC S9(9) COMP SYNC.
000103 03 WS-SIZE PIC S9(9) COMP SYNC.
000104 03 WS-INDENT PIC S9(9) COMP SYNC.
000105 03 WS-LEN PIC S9(9) COMP SYNC.
000106 03 WS-END PIC S9(9) COMP SYNC.
000107 03 Z-ERROR PIC S9(9) COMP SYNC.
000108 03 WS-TOKEN-PTR PIC S9(9) COMP SYNC.
000109 03 WS-EXTRA-TOKEN PIC S9(9) COMP SYNC.
000110 03 WS-POINTER PIC S9(9) COMP SYNC.
000111 03 WS-DATA-POINTER PIC S9(9) COMP SYNC.
000112 03 WK-TYPE PIC X.
000113 03 WK-RESULT PIC S9(9) COMP SYNC.
000114 03 WS-WK PIC S9(9) COMP SYNC.
000115 03 WS-HEX.
000116 05 WS-OFFSET PIC S9(4) COMP.
000117 05 WS-DATATYPE PIC 1(8) COMP-5.
000118 05 WS-LENGTH PIC 1(8) COMP-5.
000119 05 WS-OCCURS PIC 1(8) COMP-5.
000120 05 WS-VO PIC 1(8) COMP-5.
000121 05 WS-HO PIC 1(8) COMP-5.
000122 05 FILLER PIC X(1).
000123 03 WS-TEMP.
000124 05 WS-TYPE PIC X(10).
000125 05 WS-NAME PIC X(20).
000126 05 FILLER PIC X.
000127 05 WS-LINE PIC 999.
000128 05 FILLER PIC X.
000129 05 WS-COL PIC 99.
000130 05 FILLER PIC X.
000131 05 WS-DATA PIC X(20).
000132 03 CURRENT-VAL.
000133 05 X PIC S9(4) COMP.
000134 05 FILLER REDEFINES X.
000135 07 FILLER PIC X.
000136 07 Y PIC X.
000137 03 WK-FUNCTION PIC X.
000138 03 WS-WORK.
000139 05 WS-SYS1-X.
000140 07 WS-SYS1 PIC 1(8) COMP-5.
000141 05 WS-USER-X.
000142 07 WS-USER PIC 1(8) COMP-5.
000143 03 NEXT-KEY PIC X(36).
000144 03 WS-CTRL PIC X.
000145 03 CALLED-MODULES.
000146 05 READ-CLUSTER PIC X(20) VALUE
000147 "ICL8TRMXREADCL".
000148
000149
000150 01 WK-RECORD.
000151 03 RM-RECORD.
000152 05 ENT-HDR.
000153 07 RM-KEY.
000154 09 MAIN-KEY.
000155 11 RM-USER PIC 1(8) COMP-5.
000156 11 RM-ENTITY PIC S9(4) COMP.
000157 11 RM-ITEM PIC X(32).
000158 11 RM-LV PIC 1(8) COMP-5.
000159 05 REST-REC.
000160 07 REST-VAL PIC 1(8) COMP-5
000161 OCCURS 31964.
000162 03 CLUST-REC REDEFINES RM-RECORD.
000163 05 CLUST-BYTE OCCURS 32000.
000164 07 CLUST-VAL PIC 1(8) COMP-5.
000165 01 WS-STRING.
000166 03 WS-X PIC X
000167 OCCURS 0 TO 100 DEPENDING ON
000168 WS-SIZE.
000169
000170
000171 LINKAGE SECTION.
000172 01 LK-USER PIC X(16).
000173 01 LK-TYPE PIC X(12).
000174 01 LK-NAME-FROM PIC X(32).
000175 01 LK-NAME-TO PIC X(32).
000176 01 LK-INDICATOR PIC X.
000177 COPY COPYPC.
000178
000179
000180 01 LK-NAME-OUT PIC X(32).
000181 01 LK-DESC PIC X(60).
000182 01 LK-ITEM.
000183 03 LK-CHAR PIC X
000184 OCCURS 500.
000185 01 LK-RESULT PIC S9(9) COMP SYNC.
000186 PROCEDURE DIVISION USING LK-USER,
000187 LK-TYPE,
000188 LK-NAME-FROM,
000189 LK-NAME-TO,
000190 LK-INDICATOR,
000191 LK-PROG-CONTROL,
000192 LK-NAME-OUT,
000193 LK-DESC,
000194 LK-ITEM,
000195 LK-RESULT.
000196/
000197 A-MAIN SECTION.
000198 AAA-START.
000199 PERFORM B-INVERTED
000200 EXIT PROGRAM.
000201 AAA-EPROC.
000202 EXIT.
000203**
000204*
000205
000206/
000207 B-INVERTED SECTION.
000208 BAA-START.
000209 GO TO BAA-JUMP-TABLE.
000210 BAA-0001.
000211 BBA-POSIT.
000212 IF LK-USER = "CONTROL"
000213 MOVE ZERO TO WS-USER
000214 ELSE
000215 PERFORM SYSTEM-RECORD.
000216 MOVE LKP-DOT TO WK-DOT.
000217 MOVE 2 TO CURRENT-ENTITY
000218 MOVE 0 TO LK-INDICATOR
000219 MOVE SPACES TO LK-NAME-OUT,
000220 LK-DESC,
000221 LK-ITEM
000222 MOVE LOW-VALUES TO WK-KEY
000223 MOVE LK-NAME-FROM TO WK-ITEM
000224 MOVE WS-USER TO WK-USER-CODE,
000225 CURRENT-USER
000226 MOVE CURRENT-ENTITY TO WK-ENTITY
000227 MOVE WK-KEY TO RM-KEY
000228 MOVE "S" TO WK-FUNCTION
000229 PERFORM E-READ-RECORD
000230 IF WK-RESULT NOT = 0
000231 GO TO BBA-ADMIT.
000232 BCA-UNTIL.
000233 IF RM-ENTITY NOT = CURRENT-ENTITY
000234 OR RM-USER NOT = CURRENT-USER
000235 OR RM-ITEM > LK-NAME-TO
000236 THEN
000237 GO TO BCA-END.
000238 MOVE SPACES TO LK-NAME-OUT
000239 UNSTRING RM-ITEM DELIMITED LOW-VALUES INTO LK-NAME-OUT
000241 MOVE 54 TO WS-POINTER
000242 PERFORM UN-STRING
000243 MOVE WS-STRING TO LK-DESC
000244 MOVE 0 TO LK-OFFSET,
000245 LK-WHEN
000246 PERFORM G-END-POINTER
000247 MOVE 0 TO X
000248 MOVE CLUST-BYTE(WS-POINTER) TO Y.
000249 BDA-UNTIL.
000250 IF X > 190
000251 OR WS-POINTER > 32000
000252 THEN
000253 GO TO BDA-END.
000254 PERFORM S-KEYCHECK
000255 PERFORM R-DECODE
000256 MOVE 0002 TO B-PSV.
000257 GO TO BAA-EPROC.
000258 BAA-0002.
000259 IF WS-POINTER < 32000
000260 MOVE 0 TO X
000261 MOVE CLUST-BYTE(WS-POINTER) TO Y
000262 ELSE
000263 MOVE 255 TO X.
000264 GO TO BDA-UNTIL.
000265 BDA-END.
000266 MOVE 1 TO LK-INDICATOR
000267 MOVE 0003 TO B-PSV.
000268 GO TO BAA-EPROC.
000269 BAA-0003.
000270 MOVE "N" TO WK-FUNCTION
000271 PERFORM E-READ-RECORD
000272 GO TO BCA-UNTIL.
000273 BCA-END.
000274 MOVE 2 TO LK-INDICATOR
000275 MOVE "C" TO WK-FUNCTION
000276 PERFORM E-READ-RECORD
000277 IF WK-RESULT NOT = 0
000278 GO TO BBA-ADMIT.
000279 MOVE 0 TO LK-RESULT
000280 GO TO BBA-END.
000281 BBA-ADMIT.
000282 MOVE WK-RESULT TO LK-RESULT.
000283 BBA-END.
000284 MOVE 1 TO B-PSV.
000285 GO TO BAA-EPROC.
000286 BAA-JUMP-TABLE.
000287 IF B-PSV < 1
000288 OR > 0004
000289 THEN
000290 MOVE 1 TO B-PSV.
000291 GO TO BAA-0001,
000292 BAA-0002,
000293 BAA-0003,
000294 BAA-0004,
000295 DEPENDING ON B-PSV.
000296 BAA-0004.
000297 BAA-EPROC.
000298 EXIT.
000299**
000300*
000301/
000302 E-READ-RECORD SECTION.
000303 CAA-START.
000304 CALL READ-CLUSTER USING WK-KEY,
000305 WK-FUNCTION,
000306 WK-RECORD,
000307 WK-RESULT.
000308 CAA-EPROC.
000309 EXIT.
000310**
000311*
000312
000313/
000314 G-END-POINTER SECTION.
000315 DAA-START.
000316 MOVE WS-POINTER TO WS-END
000317 PERFORM H-NUMBER
000318 COMPUTE WS-EXTRA-TOKEN = WD-BINARY + WS-END + 3
000319 PERFORM H-NUMBER
000320 COMPUTE WS-TOKEN-PTR = WD-BINARY + WS-END + 5
000321 PERFORM H-NUMBER.
000322 DAA-EPROC.
000323 EXIT.
000324**
000325*
000326
000327/
000328 H-NUMBER SECTION.
000329 EAA-START.
000330 MOVE 0 TO WD-BINARY
000331 MOVE CLUST-BYTE(WS-POINTER) TO WD-C
000332 ADD 1 TO WS-POINTER
000333 MOVE CLUST-BYTE(WS-POINTER) TO WD-D
000334 ADD 1 TO WS-POINTER
000335 PERFORM K-BINTOCHAR.
000336 EAA-EPROC.
000337 EXIT.
000338**
000339*
000340
000341/
000342 I-DECODE-DATANAME SECTION.
000343 FAA-START.
000344 ADD 1 TO WS-POINTER
000345 ADD I,
000346 CLUST-VAL(WS-POINTER)
000347 GIVING WK-VAL
000348 MOVE WS-TOKEN-PTR TO I
000349 MOVE 1 TO J.
000350 FBA-UNTIL.
000351 IF J > WK-VAL
000352 THEN
000353 GO TO FBA-END.
000354 ADD 1 TO I
000355 IF CLUST-BYTE(I) = SPACE
000356 ADD 1 TO J.
000357 GO TO FBA-UNTIL.
000358 FBA-END.
000359 ADD 1 TO I.
000360 FBB-UNTIL.
000361 IF CLUST-BYTE(I) = SPACE
000362 OR LK-PTR > 80
000363 THEN
000364 GO TO FBB-END.
000365 MOVE CLUST-BYTE(I) TO LK-CHAR(LK-PTR)
000366 ADD 1 TO I,
000367 LK-PTR
000368 GO TO FBB-UNTIL.
000369 FBB-END.
000370 FAA-EPROC.
000371 EXIT.
000372**
000373*
000374
000375
000376
000377/
000378 K-BINTOCHAR SECTION.
000379 GAA-START.
000380 MOVE SPACES TO WD-NUM
000381 MOVE WD-BINARY TO WD-NUMBER
000382 MOVE 1 TO I,
000383 J
000384 MOVE SPACES TO WD-EXTERNAL.
000385 GBA-UNTIL.
000386 IF I > 18
000387 THEN
000388 GO TO GBA-END.
000389 IF WD-DIGIT(I) = SPACE
000390 ADD 1 TO I
000391 ELSE
000392 MOVE WD-DIGIT(I) TO WD-CHAR(J)
000393 ADD 1 TO I,
000394 J.
000395 GO TO GBA-UNTIL.
000396 GBA-END.
000397 GAA-EPROC.
000398 EXIT.
000399**
000400*
000401
000402/
000403 M-PLACES SECTION.
000404 HAA-START.
000405 MOVE 0 TO WD-RESULT
000406 MOVE 1 TO I,
000407 L
000408 MOVE WD-MANT TO K
000409 IF WD-SIGN = "-"
000410 SUBTRACT K FROM 0 GIVING K.
000411 IF WD-DATA-SIGN = "-"
000412 MOVE "-" TO WD-X(1)
000413 ADD 1 TO I.
000414 ADD 5 TO WD-FIXNUM
000415 IF WD-DATA-SIGN = 0
000416 MOVE 2 TO J
000417 ELSE
000418 ADD 1 TO K
000419 MOVE 1 TO J.
000420 HBA-SELECT.
000421 IF K < 0
000422 THEN
000423 NEXT SENTENCE
000424 ELSE
000425 GO TO HBA-TEST-0001.
000426 HBA-CASE-0001.
000427 SUBTRACT K FROM 0 GIVING K
000428 MOVE WK-DOT TO WD-X(1)
000429 ADD 1 TO I.
000430 HCA-UNTIL.
000431 IF L > K
000432 THEN
000433 GO TO HCA-END.
000434 MOVE 0 TO WD-X(I)
000435 ADD 1 TO I,
000436 L
000437 GO TO HCA-UNTIL.
000438 HCA-END.
000439 HCB-UNTIL.
000440 IF I > 78
000441 OR J > 15
000442 THEN
000443 GO TO HCB-END.
000444 MOVE WD-FDIGIT(J) TO WD-X(I)
000445 ADD 1 TO I,
000446 J
000447 GO TO HCB-UNTIL.
000448 HCB-END.
000449 GO TO HBA-END.
000450 HBA-TEST-0001.
000451 HCC-UNTIL.
000452 IF L > K
000453 THEN
000454 GO TO HCC-END.
000455 IF J NOT > 15
000456 MOVE WD-FDIGIT(J) TO WD-X(I)
000457 ADD 1 TO J.
000458 ADD 1 TO I ,
000459 L
000460 GO TO HCC-UNTIL.
000461 HCC-END.
000462 HCD-UNTIL.
000463 IF I > 78
000464 OR J > 15
000465 THEN
000466 GO TO HCD-END.
000467 MOVE WD-FDIGIT(J) TO WD-X(I)
000468 ADD 1 TO I,
000469 J
000470 GO TO HCD-UNTIL.
000471 HCD-END.
000472 HBA-TEST-0002.
000473 HBA-END.
000474 MOVE 78 TO I.
000475 HBB-UNTIL.
000476 IF WD-X(I) NOT = 0
000477 OR I < 1
000478 THEN
000479 GO TO HBB-END.
000480 MOVE SPACE TO WD-X(I)
000481 SUBTRACT 1 FROM I
000482 GO TO HBB-UNTIL.
000483 HBB-END.
000484 IF WD-X(I) = "."
000485 MOVE SPACE TO WD-X(I).
000486 HAA-EPROC.
000487 EXIT.
000488**
000489*
000490
000491
000492
000493
000494/
000495 N-NUMBER SECTION.
000496 IAA-START.
000497 MOVE 0 TO WD-BINARY
000498 MOVE CLUST-BYTE(WS-POINTER) TO WD-A
000499 ADD 1 TO WS-POINTER
000500 MOVE CLUST-BYTE(WS-POINTER) TO WD-B
000501 ADD 1 TO WS-POINTER
000502 MOVE CLUST-BYTE(WS-POINTER) TO WD-C
000503 ADD 1 TO WS-POINTER
000504 MOVE CLUST-BYTE(WS-POINTER) TO WD-D
000505 ADD 1 TO WS-POINTER
000506 PERFORM K-BINTOCHAR.
000507 IAA-EPROC.
000508 EXIT.
000509**
000510*