% Librarian A09-22:E?+Ȝ[J+ȜIJ 5 DCL_CHECK" DiagnosticsExamplesFormatI Installation: Line_countsFl Modifications xOutput`ProblemsVersion B+Ȝ1 DCL_CHECK H The DCL_CHECK procedure detects a variety of DCL coding errors andH displays diagnostic messages that allow you to correct theH problems. See "Diagnostics" for a list of the types of errors thatH DCL_CHECK can detect. See "Problems" for information on the limits of DCL_CHECK. I When you execute DCL_CHECK with "HELP" as the first parameter,H DCL_CHECK invokes the DCL Help utility. If you provide additi onal6 parameters, they are passed to the Help utility.H To exit the Help utility, press Return one or more times until the1 prompt "enter name of file:" is displayed.# Additional information available:E DCL_CHECK Diagnostics Examples Format InstallationK Line_counts Modifications Output Problems VersionwwB+Ȝ 1 Version6 This is version V2.0 of the DCL_CHECK help file.wwB+Ȝ1 Form atH DCL_CHECK is a DCL command procedure. It is executed by the following DCL command:C $ @[:][]DCL_CHECK.COM [ []]B $ @[:][]DCL_CHECK.COM HELP [...]H and/or may be omitted; the current defaults will be used.H The file DCL_CHECK.HLB must be in the same directory asH DCL_CHECK.COM if you use the HELP function in DCL_CHECK. The files< may be in any directory to which you have read access.H If you use DCL_CHECK frequently, you may wish to assign a symbolH in your LOGIN.COM file to execute DCL_CHECK. For example, if theH DCL_CHECK.COM and .HLB files are in you LOGIN default directory,4 you might put the following in your LOGIN.COM:0 $ DCL_CHECK :== "@SYS$LOGIN:DCL_CHECK" H Alternatively, if you put DCL_CHECK.COM and DCL_CHECK.HLB inH SYS$SYSTEM, you might put the follow ing in your SYS$SYLOGIN (which+ is normally SYS$MANAGER:SYLOGIN.COM): 1 $ DCL_CHECK :== "@SYS$SYSTEM:DCL_CHECK" 2 ParametersH Parameters may be entered on the command line; if there are noH parameters on the command line, the procedure will display the prompt for parameters.H The first parameter is either the file-name of a command procedureB file to be checked, or one of the keywords "HELP" or "EXIT".H If a file name is ent ered, it will be checked. If a device andH directory are not supplied, the current default is used. If a file0 extension is not supplied, ".COM" is used.H If a file name is entered, the second parameter may provide theH name of a listing file to contain the list of errors detected. IfH a device and directory are not supplied, the current default isH used. If a file extension is not supplied, ".LIS" is used. IfH second parameter is not supplied, errors are listed on sys$output.H If the first parameter contains "HELP", the DCL Help utility isH used to provide information about the DCL_CHECK utility. Any; additional parameters are passed to the HELP utility.H If the first parameter contains "EXIT", any additional parameters* are ignored and the procedure exits.wwB+Ȝ1 OutputH If the second parameter (see HELP FORMAT PARAMETERS) is blank, allH output of DCL_CHECK is dis played on the terminal. If the secondH parameter is a listing file name, some output is displayed on theH terminal and diagnostic information is written to the listing file.2 Terminal_outputH Terminal output depends on whether or not there is a listing file.3 Listing_fileD If there is a listing file, output similar to the following is displayed:E -*- Charlie Hammond's unsupported DCL checker (Version 1.0) -*- Checking file ;' Starting Pass 1 -- ...& ...processing line number xxx... ...' Starting Pass 2 -- ...& ...processing line number xxx... ...' Starting Pass 3 -- ...0 Creating errors listing in ; H For Pass 1, the numbers in the "processing line number xxx"H displays will be in increments of 500. Occasionally they will not be exact multiples of 500.H  For Pass 2, the numbers in the "processing line number xxx"H displays will be in approximate increments of 1000. Because pass 2H is processing an abbreviated file (comment lines removed) the line5 numbers will seldom be exact multiples of 1000.D If no errors are found, the last two lines will be replaced to indicate this: No errors found0 ...listing file not created 3 No_listing_fileE If there is no listing file, output similar to the following is displayed:E -*- Charlie Hammond's unsupported DCL checker (Version 1.0) -*- Checking file ;' Starting Pass 1 -- ...& ...processing line number xxx... ...' Starting Pass 2 -- ...& ...processing line number xxx... ...' Starting Pass 3 -- ..., Procedure contains: nnnn total linesL nnnn code lines (including nn lines w/ comments)3 nnn continuation lines; nn lines w/i $DECK/$EOD pairs3 nnn comment only lines, nnn blank lines) LINE CODE --DIAGNOSTIC MESSAGE-- . . .6 -*- END OF LISTING -*- 13-OCT-1997 10:57:28.07H For Pass 1, the numbers in the "processing line number xxx"H displays will be in increments of 500. Occasion ally they will not be exact multiples of 500.H For Pass 2, the numbers in the "processing line number xxx"H displays will be in approximate increments of 1000. Because pass 2H is processing an abbreviated file (comment lines removed) the line5 numbers will seldom be exact multiples of 1000. 2 File_outputF If a listing file is being used, it contains information similar to the following.F -*- Charlie Hammond's unsupported DCL checker (Version R1.0 -*-)8 Checking file WORK8:[HAMMOND]DCL_CHECK.COM_SOURCE; , Procedure contains: nnnn total linesL nnnn code lines (including nn lines w/ comments)3 nnn continuation lines; nn lines w/i $DECK/$EOD pairs3 nnn comment only lines, nnn blank lines) LINE CODE --DIAGNOSTIC MESSAGE-- . . . -*- END OF LISTING -*-wwFqC+Ȝ 1 Line_countsH DCL_CHECK displays (or lists to a file) the following line counts., Procedure contains: nnnn total lines+ nnnn code linesC nn of the code lines include comments3 nnn continuation lines+ nn deck lines. nnn comment lines, nnn  blank lines0 There is an explanation for each of these. 2 total_linesE Total lines is a count of every physical line in the file beingD checked. It is the same as the number of records in the file. 2 code_linesH Code lines is a count of lines of code. It does not includeH continuation lines, lines within a $DECK/$EOD pair, comment lines or blank lines.H Immediately following the count of code lines is a count of theH number of code  lines that also include comments. Note that this is* included in the count of code lines.2 continuation_linesH Continuation lines is a count of the number of lines of code thatH are continued from a code line. A continued code line ends with aH hyphen (-) that is not a comment (i.e., not proceeded by an "!");H lines following continued line are continuation lines.H Continuation lines may be continued. i.e. a code line may be2 continued on two or more continuation lines. 2 deck_linesH Deck lines is a count of lines that are within a $DECK/$EOD pair.H These lines are input to programs or utilities. They may be6 commands or text used by the program or utility.2 comment_linesH Comment lines are lines that are not within $DECK/$EOD pairs whichH Contain only comments. i.e. the first non-blank following theH dollar sign ($) is an exclamation point (!). Comments may alsoH appear on code lines following DCL commands; these comments are not counted. 2 blank_linesH Blank lines are lines which are totally blank (which also generateH diagnostic messages) or which contain only a blank comment. (BlankH comments are often used to insert white space to improve readability.)ww/D+Ȝ 1 Problems; DCL_CHECK does not and cannot catch all DCL problems.- Not all syntax errors are detected.D Miss-s pelled commands and variable names are not detected.* Logic errors cannot be detected.D Errors that result from execution time symbol substitution! cannot be detected.< See help on diagnostics LND additional_information> for information on problems detecting lines that$ do not start with "$".H In addition, the detection of one problem may obscure one or moreH other problems -- or may cause problems to be e rroneouslyH detected. For this reason, you should always re-run DCL_CHECK after correcting errors.2 Single_quoteH DCL_CHECK is imperfect in its checking for use of single-qouteH characters. For this reason it list such errors as "probable" or "possible".H Uses of a single-quote (') as an apostrophe within a quotedH string, for possessives ("The car's exhaust.") will be detected as possible errors.H It is also possible that some syntactically invalid lines may beH missed. (Lines containing an even number of errors may "cancel out".3 ContractionsH DCL_CHECK removes the following contractions before checking forH single-quotes. Note that this is case sensitive -- only lower caseH versions of these contractions are removed. Upper case andH capitalized or other mixed case version of these contractions will not be removed.: (Exception: The personal pronoun I" is upper case.)3 aren't he'll she's we've5 can't he's shouldn't weren't4 couldn't I'd that's what's3 didn't I'll they'd who's3 doesn't I'm they'll won't6 don't I've they're wouldn't3 hadn't isn't wasn't you'd4 hasn't it's we'd you'll4 haven't she'd we'll  you're4 he'd she'll we're you've2 Angle_bracketsH DCL_CHECK will detect angle brackets ("<" and ">") used toH delineate directories as invalid comparison operators. You canH either ignore this error or change the angle brackets to square brackets ("[" and "]"). 2 LexicalsH DCL_CHECK assumes that every instance of "F$" that is notH immediately proceeded by a letter or a digit introduces a lexicalH  function. If "F$" is used as part of a symbol or logical name,H this may be reported as a possible truncated or possible misspelled lexical.wwI|D+Ȝ 1 ExamplesH EXAMPLE 1: This example checks the file MY_COMMAND.COM in the currentN default directory and displays any errors found on the terminal. $ @DCL_CHECK MY_COMMANDI EXAMPLE 2: This example checks the file MY_COMMAND.TEST in a directoryK "TEST" located und !er the users LOGIN directory, and creates aM file TEST.LIS in the current directory if any errors are found.7 $ @DCL_CHECK SYS$LOGIN:[TEST]MY_COMMAND.TEST TESTG EXAMPLE 3: This example check the file MY_COMMAND.COM in the currentL default directory and creates a file ERROR.REPORT in the usersJ LOGIN directory if any errors are found. Detection of lines2 not starting with "$" is suppressed., $ @DCL_CHECK MY_COMMAND ERRO"R.REPORT $/ EXAMPLE 4: This example request general help $ @DCL_CHECK HELP8 EXAMPLE 5: This example request help on know problems $ @DCL_CHECK HELP PROBLEMSG The following shows how the above examples could be entered by typingM only @DCL_CHECK at the DCL prompt and then answering the procedures prompt.8 Note that line-wrap will occur differently than shown. Example 1:J enter name of procedure file to be checked (or HELP or EXIT): MY_COMMAND Ex#ample 2:? enter name of procedure file to be checked (or HELP or EXIT):J SYS$LOGIN:[TEST]MY_COMMAND.TEST TEST Example 3:? enter name of procedure file to be checked (or HELP or EXIT):? MY_COMMAND ERROR.REPORT $ Example 4:D enter name of procedure file to be checked (or HELP or EXIT): HELP Example 5:M enter name of procedure file to be checked (or HELP or EXIT): HELP PROBLEMSwwD+Ȝ 1 $DiagnosticsH Diagnostic messages are identified by a three character code.G Descriptions and explanations are available for all errors. Enter2 one of the following codes for more details: CODE Message- Errors relate to iif-then-else-endif& INT IF statement not terminated( EFB "=" found between IF and THEN1 ICO invalid comparison or logical operator+ TML too many levels of IF statements' TRH THEN statement required h%ere* TNA THEN statement not allowed here* ENA ELSE statement not allowed here+ DNA ENDIF statement not allowed here- WCT wrong constant type for comparison, MEC missing expression for comparison& Errors related to subroutines. SNT SUBROUTINE statement not terminated: TMS too many levels of IF and SUBROUTINE statements3 RNA ENDSUBROUTINE statement not allowed here! Errors related to labels$ DL duplicate label ""J RLI referenced label "