$!=================================================================='f$verify(0) $! DEBUG.COM - Harrison Spain $! McDonnell Douglas Manufacturing & Engineering Systems Company $! Internal Mail Code K34-C649-5W $! 5701 Katella Avenue $! Cypress, CA 90630 $! (714)952-6114 $!============================================================================== $ say := write sys$output $ version := 3.2 $ on control_y then goto control_y_cleanup $ pass_one = 1 $ say "" $ say " D C L D E B U G U T I L I T Y V''version'" $ say "" $! $ say "This utility will check DCL procedures for: $ say "" $ say " o Unresolved GOTO Labels" $ say " o Unresolved GOSUB Labels" $ say " o Unresolved /ERROR= Labels" $ say " o Unresolved /END= Labels" $ say "" $ say "Note: Enter EXIT at any prompt to EXIT this utility." $inquire_file: $ if p1 .nes. "" then file_spec = p1 $ if p1 .nes. "" then goto check_file $ say "" $ inquire file_spec "* What file(s) do you want to check [*.COM]" $ if file_spec .eqs. "EXIT" then goto cleanup $ if file_spec .eqs. "" then file_spec = "*.COM" $check_file: $ if f$search("''file_spec'",1) .eqs. "" then goto inquire_file $ say "" $ xxx = f$search("xxx",1) $search_file: $ search_filespec = f$search("''file_spec'",1) $ if search_filespec .eqs. "" then goto cleanup $ if .not. pass_one then - if f$loc("*",file_spec) .eq. f$len(file_spec) then goto cleanup $ pass_one = 0 $ say "Checking ''search_filespec' file..." $ close /nolog search_file $ if f$search("sys$login:search.tmp") .nes. "" then - delete /nolog sys$login:search.tmp;* $ if p2 .nes. "DEBUG" then define /user sys$output nl: $ if p2 .nes. "DEBUG" then define /user sys$error nl: $ search 'search_filespec' "/END=","/ERROR=","GOTO ","GOSUB " - /out=sys$login:search.tmp $ if f$search("sys$login:search.tmp") .eqs. "" then goto end_search_file $ open /end=end_search_file /error=error_cleanup search_file - sys$login:search.tmp $search_loop: $ read /end=end_search_file /error=error_cleanup search_file search_line $ search_line = f$edit(search_line,"upcase") $ if (f$loc("/ERROR",search_line) .eq. f$len(search_line)) .and. - (f$loc("/END",search_line) .eq. f$len(search_line)) then - search_line = f$edit(search_line,"compress") $! $ n = 0 $goto_loop: $ search_label = f$element('n'," ",search_line) $ if search_label .eqs. " " then goto search_loop $ m = n + 1 $ if search_label .eqs. "GOTO" then found_label = f$element('m'," ",search_line) $ if search_label .eqs. "GOTO" then goto end_goto_loop $ if search_label .eqs. "GOSUB" then found_label = f$element('m'," ",search_line) $ if search_label .eqs. "GOSUB" then goto end_goto_loop $ if f$extract(0,7,search_label) .eqs. "/ERROR=" then - found_label = f$element(1,"=",search_label) $ if f$extract(0,7,search_label) .eqs. "/ERROR=" then - goto end_goto_loop $ if f$extract(0,5,search_label) .eqs. "/END=" then - found_label = f$element(1,"=",search_label) $ if f$extract(0,5,search_label) .eqs. "/END=" then - goto end_goto_loop $ n = n + 1 $ goto goto_loop $end_goto_loop: $ if f$loc("'",found_label) .nes. f$len(found_label) then goto search_loop $ found_label = found_label + ":" $ msg_label = found_label - ":" $ if p2 .nes. "DEBUG" then define /user sys$output nl: $ if p2 .nes. "DEBUG" then define /user sys$error nl: $ search 'search_filespec' "''found_label'" $ if $status .nes. "%X08D78053" then goto search_loop $ if f$loc("/ERROR=",search_label) .ne. f$len(search_label) then - search_label = "/ERROR=" $ if f$loc("/END=",search_label) .ne. f$len(search_label) then - search_label = "/END=" $ say "%DEBUG-F-NOLABEL, ""''search_label'"" Label ""''msg_label'"" unresolved!" $ goto search_loop $! $end_search_file: $ close /nolog target_file $ goto search_file $! $parse_qual_label: $ found_label = $ found_label = found_label + ":" $ msg_label = found_label - ":" $ if p2 .nes. "DEBUG" then define /user sys$output nl: $ if p2 .nes. "DEBUG" then define /user sys$error nl: $ search 'search_filespec' "''found_label'" $ if $status .eqs. "%X08D78053" then say "%DEBUG-F-NOLABEL, ''search_label' Label ""''msg_label'"" unresolved!" $ goto search_loop $! $error_cleanup: $ say "%DEBUG-I-ERROR, Exiting due to ERROR." $ close /nolog search_file $ if f$search("sys$login:search.tmp") .nes. "" then - delete /nolog sys$login:search.tmp;* $ exit $control_y_cleanup: $ say "%DEBUG-I-CONTROL_Y, Exiting due to CONTROL_Y." $ close /nolog search_file $ if f$search("sys$login:search.tmp") .nes. "" then - delete /nolog sys$login:search.tmp;* $ exit $cleanup: $ close /nolog search_file $ if f$search("sys$login:search.tmp") .nes. "" then - delete /nolog sys$login:search.tmp;* $ say "%DEBUG-I-EXIT, Exiting DEBUG utility." $ exit