SUBROUTINE PRINT.MAP.LEVEL(map.code,print.level,is.call) * EQUATE INDENT TO 3 * COMMON local.md.file,map.file,remote.md.file COMMON key.stack port.no = FIELD(OCONV('','U50BB'),' ',1) * sub.sec = '' tree.level = print.level<1> + 1 sub.print.level = print.level sub.print.level<1> = tree.level sub.print.level<2,tree.level> = 1 * IF sub.print.level<3>>0 THEN FOR Z=1 TO tree.level IF Z>1 THEN sub.sec := STR(' ',2) IF sub.print.level<2,Z> THEN sub.sec := '|' ELSE sub.sec := ' ' NEXT Z END ELSE FOR Z=1 TO tree.level IF Z>1 THEN sub.sec := STR(' ',2) sub.sec := '|' NEXT Z END * base.acct = FIELD(map.code,'*',1) n.fields = DCOUNT(map.code,'*') IF n.fields>1 ELSE PRINT ' - nothing to print' RETURN END routine.name = FIELD(map.code,'*',n.fields) IF n.fields>2 THEN assumed.catalog.file = FIELD(map.code,'*',2) END ELSE assumed.catalog.file = '' END * READ catalog.ptr FROM remote.md.file,routine.name ELSE catalog.ptr = 'vr' * catalog.ptr<4> = assumed.catalog.file:' ':routine.name END GOSUB 1000; * Interpret the catalog pointer map.key = module.acct:'*':module.file:'*':module.id * PL = '' IF print.level<1>>0 THEN PL := sub.sec[1,LEN(sub.sec) - 3 - 1]:'+' IF is.call THEN PL := STR('-',3 - 1) END ELSE PL := STR('-',3 - 2):'>' END END PL := map.key * LOCATE map.key IN key.stack<1> SETTING stack.pos THEN PL = PL'L#57':' - recursive call to ':map.key PRINT PL END ELSE READ map.rec FROM map.file,map.key THEN IF map.rec<1>='' ELSE PL = PL'L#57':' - ':map.rec<1> LOCATE map.key IN key.stack<2> SETTING stack.pos THEN PL := ' ++' PRINT PL END ELSE PRINT PL key.stack<1,-1> = map.key key.stack<2,-1> = map.key no.of.subs = DCOUNT(map.rec<8>,CHAR(253)) FOR PC=1 TO no.of.subs IF (PC=no.of.subs) AND (map.rec<14>='') THEN sub.print.level<2,tree.level> = 0 sub.map.code = base.acct:'*':catalog.ptr<1>:'*':map.rec<8,PC> PRINT sub.sec CALL PRINT.MAP.LEVEL(sub.map.code,sub.print.level,1) NEXT PC no.of.subs = DCOUNT(map.rec<14>,CHAR(253)) FOR PC=1 TO no.of.subs IF (PC=no.of.subs) THEN sub.print.level<2,tree.level> = 0 sub.map.code = base.acct:'*':catalog.ptr<1>:'*':map.rec<14,PC> PRINT sub.sec CALL PRINT.MAP.LEVEL(sub.map.code,sub.print.level,0) NEXT PC LOCATE map.key IN key.stack<1> SETTING stack.pos THEN key.stack = DELETE(key.stack,1,stack.pos) END END END ELSE PL = PL'L#57':' - unmapped' PRINT PL END END * RETURN * 1000 * * catalog.error = 0 * module.acct = base.acct module.file = assumed.catalog.file module.id = routine.name * BEGIN CASE CASE catalog.ptr<1>='P' AND catalog.ptr<2>='E6' catalog.ptr = catalog.ptr<5> CASE catalog.ptr<1>='VR' catalog.ptr = catalog.ptr<4> CASE 1 catalog.ptr = '' END CASE * catalog.ptr<2> = FIELD(catalog.ptr,' ',2) catalog.ptr<1> = FIELD(catalog.ptr<1>,' ',1) IF catalog.ptr<2>='' THEN catalog.ptr = INSERT(catalog.ptr,1;'') IF catalog.ptr<1>='' THEN catalog.ptr<1> = module.file * IF catalog.ptr<1>='' ELSE module.file = catalog.ptr<1> IF catalog.ptr<2>='' ELSE module.id = catalog.ptr<2> * file.type = '' remote.file.file = remote.md.file FOR file.level=1 TO 10 UNTIL file.type='D' OR catalog.error READ file.ptr FROM remote.file.file,module.file ELSE file.ptr = '' file.type = file.ptr<1>[1,1] BEGIN CASE CASE file.type='D' NULL CASE file.type='Q' module.acct = file.ptr<2> module.file = file.ptr<3> q.rec = 'Q' q.rec<2> = module.acct q.key = '$CK$':port.no q.key.ok = 1 READU xxx FROM local.md.file,q.key THEN q.key.ok = xxx<1>[1,1]#'D' q.key.ok = q.key.ok AND xxx<1>#'vr' AND xxx<1>[1,1]#'P' END IF q.key.ok THEN WRITEU q.rec ON local.md.file,q.key END RELEASE local.md.file,q.key IF q.key.ok THEN OPEN q.key TO remote.file.file ELSE q.key.ok = 0 IF q.key.ok ELSE catalog.error = 1 CASE 1 catalog.error = 1 END CASE NEXT file.level IF catalog.error ELSE catalog.error = (file.type#'D') * IF catalog.error ELSE END * RETURN