% Librarian I01-42]VQfXXQf02115? @file-specANALYZE ATTACH CONVERTCREATEDELETEEXITnEXTRACTFIND$FGOTO*IMPORT, INSPECT9zLOAD<NEXT=rPREVIOUS^ Release_Notes?D REORGANIZE@0REPORTLSAVE^ SCA_TopicsOSETSSHOWZSPAWN[VERIFYnWQf 1 @file-specC Executes Source Code Analyzer for OpenVMS commands contained in  the specified file. Format @file-spec 2 Example $ SCA @TEST+ %SCA-S-VERSION, this is SCA version V4.75 %SCA-S-LIB, your SCA Library is SCA$ROOT:[EXAMPLE] $= This example executes the command file TEST.COM containing. the commands SHOW VERSION and SHOW LIBRARY.E wwnWQ f 1 ANALYZE? [SCA Command] Creates an analysis data file that describes a source file. Format! ANALYZE file-spec[, . . .] 2 Qualifiers/DESIGN /DESIGN[=design-option] /NODESIGN (D)B Indicates that the source file should be processed as a program6 design language. The design options are as follows:@ COMMENTS The ANALYZE command looks inside comments forA design information. Information about commentsD is included in the analysis data file. Any errors) detected are reported.8 NOCOMMENTS The ANALYZE command ignores comments.A PLACEHOLDERS The ANALYZE command treats LSE placeholders asA valid syntax. Placeholders are reported in the& analysis data file.C NOPLACEHOLDERS The ANALYZE command does not report placeholdersA in the .ANA file. It does not report errors if0  placeholders are encountered.@ If you specify the /DESIGN qualifier, the default is /DESIGN=E (COMMENTS,PLACEHOLDERS). If you do not specify this qualifier, the default is /NODESIGN. /LANGUAGE /LANGUAGE=language= Specifies the language of the source file. By default, theE language is that which is specified by the file type of the source file./LOG /LOG (D) /NOLOG4 Indicates whether each analyzed file is reported./OUTPUT /O UTPUT[=file-spec] /OUTPUT=file-name.ANA (D)A Specifies the analysis data file to be created. The default is /OUTPUT=@ filename.ANA, where file-name is the name of the first source3 file specified as the parameter to this command. 2 Parameterfile-spec[, . . . ]E Specifies the files to be analyzed. You can use wildcards with theE file-spec parameter. Within LSE, the current buffer is analyzed by default.wwWQf 1 ATTACHM [SCA Comm and] Passes control of your terminal from your current process to another process in your job. Format ATTACH [process-name] 2 Parameters process-nameH Specifies the name of a parent process or spawned subprocess to which control passes.wwWQf 1 CONVERT 2 LIBRARY@ [SCA Command] Converts the specified library from Version 2.00 or Version 3.1 format to Version 4.0 format. Format7 CONVERT LIBRARY directory-spec1 [directory-spec2] 3 Parametersdirectory-spec1B Specifies the directory specification of the Version 2.0 or 3.1 library to be converted.directory-spec2D Specifies the directory in which the Version 4.0 library is to beD created. If this parameter is omitted, the new library is createdE in the directory specified by directory-spec1, and the old libraryC is deleted. If this parameter is specified and is different from3 directory-spec1, the old library is not deleted.wwWQf 1 CREATE 2 LIBRARYE [SCA Command] Allocates and initializes OpenVMS library files in aB specified directory. The new library then becomes an active SCA library. Format. CREATE LIBRARY directory-spec[, . . . ] 3 Qualifiers/AFTER /AFTER=library-specE Instructs SCA to insert the new library or libraries into the listC of active SCA libraries following the library you specify as theB value of the qualifier. If you do not specify a value, SCA adds3 the library or libraries to the end of the list./BEFORE /BEFORE=library-specE Instructs SCA to insert the new library or libraries into the listE of active SCA libraries in front of the library you specify as theB value of the qualifier. If you do not specify a value, SCA adds9 the library or libraries to the beginning of the list./CREATE_DIRECTORY /CREATE_DIRECTORY /NOCREATE_DIRECTORY (D)H Instructs SCA to create the specified directory if it does not exist./LOG /LOG (D) /NOLOGE Indicates whether SCA reports the successful creation of a library. and the resulting list of active libraries./MODULES /MODULES=module-count /MODULES=25 (D); Specifies an estimated number of modules in the library./REPLACE /REPLACE /NOREPLACE (D)@ Indicates whether SCA replaces an existing library with a new (empty) library./SIZE /SIZE=block-count /SIZE=1000 (D)- Specifies an estimated size for a library. 3 Parameterdirectory-spec[, . . . ]E Specifies one or more directories in which library files are to be allocated and initialized.wwWQf 1 DELETE? Deletes the effect of the item specified by the option word. Format DELETE option 2 LIBRARYA [SCA Command] Deletes an SCA library from a OpenVMS directory. Format( DELETE LIBRARY  library-spec[,...] 3 Qualifiers/CONFIRM /CONFIRM /NOCONFIRM (D)D Indicates whether the delete function will request a confirmation# of the deletion of each library.A To delete an SCA library, you must respond to the confirmation; prompt by typing one or more characters of the word YES.) Otherwise, the library is not deleted./LOG /LOG /NOLOG (D)A Indicates whether successful deletion of SCA libraries will be reported. 3  Parameterlibrary-spec[,...]E Specifies one or more libraries to be deleted. The library must beB one of the current SCA libraries established by the SET LIBRARY> command. You can use a library number in place of a libraryA specification. For example, the primary library is library #1.3 You can also specify a wildcard name expression. 2 MODULEB [SCA Command] Deletes specified modules of source analysis data from SCA libraries. Format* DELETE MODULE module-name[, . . . ] 3 Qualifiers/CONFIRM /CONFIRM /NOCONFIRM (D)@ Tells SCA whether or not to prompt you to confirm each module deletion.E To delete a module, you must respond to the confirmation prompt byB typing Y, YE, or YES. If you specify N, NO, or press the Return? key, SCA does not delete the module. SCA considers any otherA response to be ambiguous and reissues the confirmation prompt./DECLARATION_CLASS* /DECLARATION_CLASS=declaration-classA Indicates the class of the module to be deleted. The following% declaration classes are supported:$ PRIMARY- Module implementation% ASSOCIATED-Module specification> If you do not specify a declaration class, SCA deletes both classes, if they exist./LIBRARY /LIBRARY[=library-spec]" /LIBRARY=primary-library (D)E Specifies an SCA library containing the module to be deleted. ThisE library must be one of the current libraries (established by a SET LIBRARY command).B If you do not specify a library, the primary SCA library is the@ default; that is, the module is deleted from the first of the current SCA libraries./LOG /LOG (D) /NOLOGA Indicates whether SCA reports successful deletion of a module. 3 Parametermodule-name[, . . . ]D Specifies the names of the modules to be deleted from the current7 library. You may specify a wildcard name expression.2 QUERY- [SCA Command] Deletes the indicated query. Format DELETE QUERY [query-name] 3 Parameter query-nameE Specifies the query to be deleted. If you omit the query name, the7 current query is deleted. You can specify wildcards.wwWQf1 EXITE [SCA Command] Ends an LSE editing session or SCA query session andA returns control to the calling process or the OpenVMS command  language interpreter. Format EXIT 2 Qualifier/LOG  /LOG /NOLOG (D)D [SCA] Indicates whether completion of an SCA session is reported.wwWQf 1 EXTRACT> Extracts the specified items for use in LSE commands or SCA libraries. Format! EXTRACT item-type item-name 2 MODULEC [SCA Command] Extracts specified modules of source analysis data from an SCA library. Format/ EXTRACT MODULE module-name-expr[, . . . ] 3 Qualifiers/DECLARATION_CLASS* /DECLARATION_CLASS=declaration-class@ Indicates the class of the module to be copied. The following% declaration classes are supported:# PRIMARY-Module implementation% ASSOCIATED-Module specification? If you do not specify a declaration class, SCA extracts both classes, if they exist./LIBRARY /LIBRARY=library-specE Specifies the SCA static library from which to extract the module.E This library must be one of the current SCA libraries (establishedC by a SET LIBRARY command). If you do not specify this qualifier,E then SCA tries to extract the module from the primary library (the' first of the current SCA libraries)./LOG /LOG /NOLOG (D)< Indicates whether SCA reports the extraction of a module./OUTPUT /OUTPUT=file-specD Specifies the file into which all modules of source analysis dataE will be written. The default is /OUTPUT=module-name.ANA, where the< module name is the name of the file the compiler created. 3 Parametermodule-name-expr[, . . . ]A Specifies the modules to extract. If you specify more than oneC library, SCA extracts the module from the first library in which it occurs.wwWQf1 FINDA [SCA Command] Locates occurrences described by the current SCA libraries.G For information on the SCA query language, see SCA_Topics in online  help. Format FIND query-expression 2 Qualifiers /DESCRIPTION /DESCRIPTION=stringC Specifies a single line of text that is displayed along with theC query name when the query is displayed by issuing the SHOW QUERY command./DISPLAY! /DISPLAY[=(option, . . . )] /DISPLAY=DEFAULT (D) /NODISPLAY? Indicates how much information SCA displays concerning query@ results. Use one or more of the following keywords to request specific information: NAME Symbol name CLASS Class of item* LINE_NUMBER Compilation line number= MODULE Module name containing a symbol occurrenceD FILE_SPEC File name and type containing a symbol occurrenceB FULL_FILE_SPEC Complete file specification containing a symbol occurrence5 RECORD_NUMBER Record number within a source file$ RELATIONSHIP Relationship type- NUMBER Number of the display lineB OCCURRENCE_ Type of symbol occurrence (such as declaration, TYPE read, call). ALL All of the previous options: DEFAULT Default settings of the display optionsC NONE Nothing (equivalent to the /NODISPLAY qualifier)E You can prefix any keyword (except ALL, DEFAULT, and NONE) with NO/ to request that the information be excluded.@ The initial default for each type of new query is as follows:; DISPLAY=(NAME,CLASS,MODULE,LINE,OCCURRENCE,RELATIONSHIP)/LOG /LOG (D)  /NOLOG< Indicates whether the count of symbol occurrences will be reported./MODIFY /MODIFY[=query-name] /NOMODIFY (D)B Indicates that an existing query is to be modified. By default,) each FIND command creates a new query.@ The /MODIFY=query-name qualifier indicates that the specifiedA query should be modified according to the specification of the8 FIND command. The specified query must already exist.A By default, the /MODIFY qualifier specifi!es the current query./NAME /NAME[=query-name]A Specifies the name of the query. If a query with the same nameE already exists, you must also specify the /REPLACE qualifier. If aE query-name is not specified, then SCA assigns a unique name to the0 query. The query name can be a quoted string./OUTPUT /OUTPUT[=file-spec]B Specifies that command output is to go to a file rather than beD displayed on your screen (or go to a batch log file). The default"( output file specification is SCA.LIS./REPLACE /REPLACE /NOREPLACE (D)? Indicates whether existing queries should be replaced by new@ queries. By default, a FIND command that creates a query with8 the same name as an already existing query will fail./RESULT /RESULT=option /RESULT=DEFAULT (D) /NORESULTB Indicates the type of query results displayed. You must specify! one of the following keywords:, SYMBOLS Only symbol #s are displayed.7 OCCURRENCES Symbols and occurrences are displayed.; DEFAULT Either symbols or occurrences, or both areD displayed. SCA chooses the result type that is most3 appropriate for the current query.> The /NORESULT qualifier specifies that no results should beE displayed. This means that no query evaluation is done. If a queryC result exists because you issued a FIND command, then specifying. /NORESULT causes that result $to be deleted. /SYNCHRONIZE /SYNCHRONIZE /NOSYNCHRONIZE (D)@ Indicates that the query result must be synchronized with theB current state of the virtual library being queried. By default,D /NOSYNCHRONIZE causes SCA to do as little processing as necessaryE to evaluate the query. This can lead to query results that reflectD the state of the virtual library at the time of a previous query.B The /SYNCHRONIZE qualifier specifies that the query result mustA be sy%nchronized with the current virtual library. SCA attempts@ to minimize the amount of processing, but the result is stillB synchronized with the virtual library that was in effect at the time the query was evaluated. 2 Parameterquery-expression0 Specifies the set of occurrences to be found.wwWQf1 GOTO= Moves the cursor to the item specified by the option word. Format GOTO option2 DECLARATIONC [SCA Required] Displays the declara&tion of the symbol indicated.D LSE displays the source code containing the symbol declaration inE another window and positions the cursor on the symbol declaration. Format% GOTO DECLARATION [symbol-name] 3 Qualifiers /ASSOCIATED@ Indicates that you want to see the associated declaration forA the symbol. An associated declaration is a related declaration@ that accompanies the primary declaration (such as an EXTERNAL declaration)./CONTEXT_DEPENDENT '@ If you specify both the /CONTEXT_DEPENDENT and the /INDICATEDB qualifiers, then SCA determines which declaration to display by using the following criteria:C o If the indicated occurrence of the symbol is a reference, LSED displays the declaration specified by the compiler as bound to$ that occurrence of the symbol.@ o If the indicated occurrence of the symbol is an associated8 declaration, LSE displays the primary declaration.< o If the indicated occur (rence of the symbol is a primary; declaration, LSE displays the associated declaration.> You cannot use the /CONTEXT_DEPENDENT qualifier without the /INDICATED qualifier. /INDICATED= Instructs LSE to use the symbol name at the current cursor= position, or the text within the currently active selected@ range, as the symbol name. To help SCA identify exactly whichA occurrence of the symbol name the cursor is positioned on, LSEE passes both the current cursor positi )on in the buffer and the file/ specification for the current buffer to SCA.? If SCA has no information for the symbol name at the currentE cursor position (for example, if the line containing the symbol isB a new line and the file has not been recompiled), then SCA usesB whatever general information it has about that symbol as if youD issued a GOTO DECLARATION command for the symbol name without the /INDICATED qualifier.D If you specify the /INDICATED qualifier, you mu*st not specify the symbol-name parameter.@ You cannot use the /INDICATED qualifier without the /CONTEXT_ DEPENDENT qualifier./PRIMARY /PRIMARY (D)= Indicates that you want to see the primary declaration for@ the symbol. A primary declaration is the declaration that SCAB interprets as most significant for a symbol (such as a FUNCTIONB declaration). For example, the primary declaration of a routine% describes the body of the routine. 3 Parameter symb+ol-nameE Specifies that the declaration associated with the named symbol isE to be displayed. You must not specify a symbol name if you specify the /INDICATED qualifier.2 QUERYE [SCA Command] Moves the cursor to the specified SCA query session. Format GOTO QUERY [query-name] 3 Parameter query-name+ Specifies the name of the query session.wwWQf 1 IMPORT? [SCA Command] Creates analysis data files that describe the < indicat,ed XREF data files generated by a HP C++ compiler. Format IMPORT file-spec[, . . .] 2 Qualifiers/LOG /LOG (D) /NOLOG4 Indicates whether each imported file is reported./OUTPUT /OUTPUT[=file-spec] /OUTPUT=file-name.ANA (D)H Specifies the analysis data file to be created. If you do not specifyA a file specification, the default is the file name of the file) being imported and the file type .ANA. 2 Parameterfile-spe-c[, . . . ]H Specifies one or more files of XREF data to be imported. You can use + wildcards with the file-spec parameter. E The default file type is .XREF, which is the default file type for+ XREF data files created by HP compilers.wwWQf 1 INSPECTA [SCA Command] Inspects the consistency between declarations or" references for the same symbol. Format INSPECT query-expression 2 Qualifiers/CHARACTERISTICS( /CHARACTERISTI.CS=(option[ . . . ]) /CHARACTERISTICS=ALL (D)? Indicates which characteristics of the occurrences should be? checked. You can use one or more of the following options to request specific information:= IMPLICIT_ Checks that all symbols are explicitly DECLARATIONS declared.B TYPE Checks that the types of all occurrences of) each symbol match.D UNIQUENESS Checks that multiple declarations of the same /1 symbol have the same name.8 UNUSED_SYMBOLS Checks that all symbols are used.@ USAGE Looks for symbols that are read but never: written, or written but never read.C ALL Checks all of the preceding characteristics.> Any of these options (except ALL) can have the prefix NO to: indicate that the characteristic should not be checked.A Each of the characteristic options takes a query-expression a 0sB an optional value. The characteristic-specific query expressionA specifies the set of occurrences for which that characteristic? will be checked. If the prefix NO is present, then the queryA expression indicates occurrences for which that characteristic= will not be checked. The default query expression for each5 characteristic option is to check all occurrences. /DESCRIPTION /DESCRIPTION=stringC Specifies a single line of text that is displayed along with 1theC query name when the query is displayed by issuing the SHOW QUERY command./DISPLAY! /DISPLAY[=(option, . . . )] /DISPLAY=DEFAULT (D) /NODISPLAY? Indicates how much information SCA displays concerning query@ results. Use one or more of the following keywords to request specific information: NAME Symbol name CLASS Class of item* LINE_NUMBER Compilation line numberD FILE_NAME File name and type cont2aining a symbol occurrenceB FULL_FILE_SPEC Complete file specification containing a symbol occurrence5 RECORD_NUMBER Record number within a source fileB OCCURRENCE_ Type of symbol occurrence (such as declaration, TYPE read, call). ALL All of the previous options: DEFAULT Default settings of the display optionsC NONE Nothing (equivalent to the /NODISPLAY qualifier)E You can prefix any keyword 3(except ALL, DEFAULT, and NONE) with NO+ to request that information be excluded.@ The initial default for each type of new query is as follows:. DISPLAY=(NAME,CLASS,MODULE,LINE,OCCURRENCE) /ERROR_LIMIT0 /ERROR_LIMIT=(global-limit[,symbol-limit]) /NOERROR_LIMIT (D)B Specifies the maximum number of errors that the INSPECT command@ should report. This causes the INSPECT command to stop if the( number of errors exceeds the maximum.D The global-limit parame4ter specifies the maximum number of errors= reported for all symbols before the INSPECT command stops.D The symbol-limit parameter specifies the maximum number of errorsD reported for a particular symbol before the INSPECT command stops$ reporting errors for that symbol./LOG /LOG (D) /NOLOG< Indicates whether the count of symbol occurrences will be reported./MODIFY /MODIFY[=query-name] /NOMODIFY (D)B Indicates that an existing quer5y is to be modified. By default,, each INSPECT command creates a new query.@ The /MODIFY=query-name qualifier indicates that the specifiedA query should be modified according to the specification of the; INSPECT command. The specified query must already exist.A By default, the /MODIFY qualifier specifies the current query./NAME /NAME[=query-name]A Specifies the name of the query. If a query with the same nameE already exists, you must also specify the /REPL6ACE qualifier. If aE query name is not specified, then SCA assigns a unique name to the query./OUTPUT /OUTPUT[=file-spec]B Specifies that command output is to go to a file rather than beD displayed on your screen (or go to a batch log file). The default( output file specification is SCA.LIS./REPLACE /REPLACE /NOREPLACE (D)? Indicates whether existing queries should be replaced by newD queries. By default, an INSPECT command that creates 7a query with8 the same name as an already existing query will fail./RESULT /RESULT=option /RESULT=DEFAULT (D) /NORESULTB Indicates the type of query results displayed. You must specify! one of the following keywords:, SYMBOLS Only symbols are displayed.7 OCCURRENCES Symbols and occurrences are displayed.; DEFAULT Either symbols or occurrences, or both areD displayed. SCA chooses the result type that is most3 8 appropriate for the current query.> The /NORESULT qualifier specifies that no results should be? displayed. This means that no query evaluation is done. If aB query result exists because you issued an INSPECT command, then9 specifying /NORESULT causes that result to be deleted./SEVERITY_LEVEL$ /SEVERITY_LEVEL=severity-level! /SEVERITY=INFORMATIONAL (D)< Indicates the lowest severity level for diagnostics to be reported, as follows: IN9FORMATIONAL WARNING ERROR FATAL_ERROR /SYNCHRONIZE /SYNCHRONIZE /NOSYNCHRONIZE (D)@ Indicates that the query result must be synchronized with theB current state of the virtual library being queried. By default,D /NOSYNCHRONIZE causes SCA to do as little processing as necessaryE to evaluate the query. This can lead to query results that reflectD the state of the virtual library at the time of a previous query.B The /SYNCHRONIZE qualifie:r specifies that the query result mustA be synchronized with the current virtual library. SCA attempts@ to minimize the amount of processing, but the result is stillB synchronized with the virtual library that was in effect at the time the query was evaluated. 2 Parameterquery-expression3 Specifies the set of occurences to be inspected.wwWQf1 LOADE [SCA Command] Loads one or more files of compiler-generated source% analysis data into an SCA lib;rary. Format LOAD file-spec[, . . . ] 2 Qualifiers/DELETE /DELETE /NODELETE (D)? Deletes an analysis data file after it has been successfully loaded into an SCA library./LIBRARY /LIBRARY=library-spec" /LIBRARY=primary-library (D)A Specifies an SCA physical library to update. This library mustD be one of the current SCA libraries, established by a SET LIBRARY command.B If you do not specify this qualifier, S<CA refers to the primaryA SCA library; that is, SCA updates the first of the current SCA physical libraries./LOG /LOG (D) /NOLOG; Indicates whether SCA reports successful updating of SCA libraries./REPLACE /REPLACE (D) /NOREPLACEE Indicates whether SCA replaces existing modules of source analysis data with new information. 2 Parameterfile-spec[, . . . ]C Specifies one or more files of source analysis data to be loadedB= into an SCA library. You may use a wildcard file specification.D The default file type is .ANA, which is the default file type for3 source analysis data files created by compilers.wwWQf1 NEXTB Moves the cursor to the next item specified by the option word. Format NEXT option!!2 OCCURRENCEE! [LSE Required] Moves the cursor forward to the next occurrence ofF! the current source symbol in the current query and highlights that! next> occurrence.! ! Format!! NEXT OCCURRENCE2 QUERY@ [SCA Command] Moves the cursor to the next SCA query session. Format NEXT QUERY! !2 SYMBOLE! [LSE Required] Moves the cursor forward to the next source symbol9! in the current query and highlights that next symbol.! ! Format!! NEXT SYMBOLww XQf 1 PREVIOUS@ Moves the cursor to the previous item specified by the option word. Format PREVIOUS ?option!!2 OCCURRENCEF! [LSE Required] Moves the cursor back to the previous occurrence ofF! the current source symbol in the current query and highlights that! occurrence.! ! Format!! PREVIOUS OCCURRENCE2 QUERY@ [SCA Command] Moves the cursor back to the previous SCA query session. Format PREVIOUS QUERY! !2 SYMBOLF! [LSE Required] Moves the cursor back to the previous source symbol;! in the current query and highlights that sourc@e symbol.! ! Format!! PREVIOUS SYMBOLww XQf 1 REORGANIZE@ [SCA Command] Optimizes the organization of the specified SCA libraries. Format* REORGANIZE [library-spec[, . . . ]] 2 Qualifier/LOG /LOG (D) /NOLOGE Indicates whether SCA reports a successful library reorganization. 2 Parameterlibrary-spec[, . . . ]? Specifies the SCA libraries to be reorganized. If you do not> specify a library, LSE reAorganizes the primary SCA library.ww XQf 1 REPORT/ [SCA Command] Produces the specified report. Format- REPORT report-name other-parms[ . . . ] 2 Qualifiers/DOMAIN /DOMAIN=query-name? Specifies the name of the query to use as the domain for theB report. The query should include occurrences of files that have? been compiled. This value is converted to a VAXTPU value andB assigned to the global VAXTPU variable SCA$REPORTB_DOMAIN_QUERY.B This procedure limits the report to objects that are contained,C directly or indirectly, within at least one of the files in this query.E The default value is the null string. By convention, VAXTPU report7 procedures interpret this as the entire SCA library./FILL /FILL (D) /NOFILLD Specifies that whenever a paragraph of commented text is inserted@ into a report, it is set up so that a text processor, such as? RUNOFF or DOCUMENT pe Crforms the usual fill and justification@ operations on the paragraph. If you specify /NOFILL, then the> report tool does not instruct the text processor to fill or justify the paragraph.E For any individual paragraph, you can override the setting of thisD qualifier by including appropriate text-processor comments within the body of the comment.E The value of this qualifier is used to set the value of the globalA VAXTPU variable SCA$REPORT_FILL as follows. If you specDify theC /FILL qualifier, or it is indicated by default, then SCA$REPORT_D FILL is 1; if you specify the /NOFILL qualifier, then SCA$REPORT_ FILL is 0.A The /FILL qualifier is ignored if it is not meaningful for theD target. In particular, it is ignored for LSE package definitions. /HELP_LIBRARY /HELP_LIBRARY=library_name> Specifies the help library to use for PACKAGE reports. This= qualifier is ignored for other reports. The PACKAGE reportB generates oneE or more DEFINE PACKAGE commands. The library_nameB specifies the value to use with the /HELP_LIBRARY qualifier for) the generated DEFINE PACKAGE commands.B If you omit this qualifier, the PACKAGE report omits the /HELP_C LIBRARY qualifier from the DEFINE PACKAGE commands it generates. /LANGUAGES% /LANGUAGES=(language,[ . . . ])D Specifies the language to use for PACKAGE reports. This qualifierA is ignored for other reports. The PACKAGE report generates oneA or Fmore DEFINE PACKAGES commands. This qualifier specifies theD languages to use as the values of the /LANGUAGE qualifier for the% generated DEFINE PACKAGE commands.A If you omit this qualifier, the PACKAGE report inserts the LSEC placeholder {language_name} . . . as the value for the /LANGUAGEE qualifier with the DEFINE PACKAGE commands. Before you can execute? the DEFINE PACKAGE command, you must replace the placeholder@ manually with the names of the languages that are appGropriate# for the languages being defined./OUTPUT /OUTPUT=file-nameA Specifies the output file to use for the report. This value is? converted to a VAXTPU string and passed as the value for theD global VAXTPU variable SCA$REPORT_OUTPUT. The default value takesA the file name from the report-name parameter and the file type? from the target-file-type parameter. The target-file-type is@ implied by the /TARGET qualifier. For example, if you specifyB DOCUMENT Hfor the /TARGET qualifier, this implies a file type of .SDML./TARGET /TARGET=target-file-type> Specifies the type of target file to produce. This value is@ converted to a VAXTPU string value and assigned to the global@ VAXTPU variable SCA$REPORT_TARGET. You can specify one of the following keywords:% Keyword Type of file" TEXT, TXT Text file8 RUNOFF, DSR, RNO A file for processing by RUNOFF> SDML, DOCUMENT A fIile for processing by VAX DOCUMENT5 LSEDIT, LSE A file for processing by LSE: HLP, HELP A help file for processing by the" Librarian+ OTHER=value Optional file type> Note that the OTHER keyword can take an optional value. The; default value is the null string, which by convention is> interpreted by the VAXTPU procedures as TEXT. User suppliedA report procedures can ignore this convention and provide their ownJ defaults.B The default target file types are SDML for INTERNALS and 2167A_E DESIGN reports, HLP for HELP reports, and LSE for PACKAGE reports. 2 Parameters report-name? Specifies the name of the report to produce. The report name> should be the name of one of the HP supplied reports or theD name of a user-written report. You can abbreviate the report name! if the abbreviation is unique.> The REPORT command uses the report-name parameter to find aD corresponding K VAXTPU procedure whose name starts with SCA_REPORT_? report-name. This VAXTPU procedure is invoked to produce theA report. Because there is a VAXTPU restriction on the length ofA procedure names, a report name must not exceed 121 characters., HP has implemented the following reports:A o HELP - A help file, suitable for processing by the OpenVMS $ Librarian into a help library.D o PACKAGE - An LSE package definition, which can be processed byC LSE and put into L an environment file, to create templates for* calling the procedures in your code.@ o INTERNALS - A comprehensive report on the software in your> system, all of the information in comment headers, and a+ structural presentation of your code.E o 2167A_DESIGN - The design section of the DOD-STD-2167A Software Design Document.other-parms[ . . . ]; Specifies other parameters that are passed to the VAXTPUB procedure. These parameters are collected into a Msingle string,D which is then assigned to the global VAXTPU variable SCA$_REPORT_C REST_OF_LINE. These SCA parameters are obtained from the commandE line from the $REST_OF_LINE type of the OpenVMS Command Definition Utility.ww XQf1 SAVEA Saves information about the item specified by the option word. Format SAVE option2 QUERY@ [SCA Command] Saves information about one or more current SCAB query sessions. The information saved for aN query session is a ' FIND command for the query session. = The saved commands can be executed by SCA by means of the  @file-spec command. Format" SAVE QUERY [query-name,...] 3 Qualifiers/OUTPUT /OUTPUT[=file-spec] /OUTPUT=QUERY.COM (D): Specifies the save data file to be created. The default file type is .COM. /PREFIX /PREFIX=prefix ? Specifies the prefix to be applied to all query names in the saved infOormation./QUALIFIERS="qualifiers"A Specifies the qualifiers to be applied to FIND commands in the? saved information. Should not include /NAME or /DESCRIPTION. 3 Parameters query-nameB Specifies the name of the query to be displayed. If you specifyC a null query name (""), SCA assumes you mean the current query.@ If you omit this parameter, SCA assumes you have specified an asterisk (*). 3 Example $ SCA SCA> FIND/DESC=XYZ X* SCA> FIND/NAME=ABC @1P OR Y*4 SCA> SAVE QUERY/PREFIX=X_/QUALIFIERS="/NODISPLAY"3 Following the above file QUERY.COM will contain:& find/name=X_1/desc=XYZ/NODISPLAY X*' find/name=X_ABC/NODISPLAY @X_1 OR Y*ww1XQf1 SET1 Enables the item specified by the option word. Format SET option 2 LIBRARYE [SCA Command] Identifies the SCA physical libraries to be used for subsequent SCA functions. Format+ SET LIBRARY directory-spec[, . . . ] 3 Q Qualifiers/AFTER /AFTER[=library-spec]@ Instructs SCA to insert the new library or libraries into the@ list of active SCA libraries after the library you specify asC the qualifier value. If you do not specify a value, SCA adds the/ library or libraries to the end of the list./BEFORE /BEFORE[=library-spec]@ Instructs SCA to insert the new library or libraries into theA list of active SCA libraries before the library you specify asC the qualifierR value. If you do not specify a value, SCA adds the5 library or libraries to the beginning of the list./LOG /LOG (D) /NOLOGA Indicates whether SCA reports the resulting list of active SCA libraries. 3 Parameterdirectory-spec[, . . . ]? Specifies one or more directories, each of which comprises aC separate SCA library. The list of libraries you specify replacesD the current list of active libraries unless you specify an /AFTER or /BEFORE qualifSier. 2 NOLIBRARYE [SCA Command] Removes the specified SCA libraries from the current list of active libraries. Format- SET NOLIBRARY [library-spec[, . . . ]] 3 Qualifier/LOG /LOG (D) /NOLOGB Indicates whether LSE reports removal of the libraries from the active list. 3 Parameterlibrary-spec[, . . . ]@ Specifies the libraries to be removed from the current activeB libraries list. If you omit this parameter, SCA removes all theT" active libraries from the list.2 COMMAND LANGUAGEC [SCA Command] Sets the command language to the specified syntax. Format* SET COMMAND LANGUAGE command_languageC The command language options are PORTABLE and VMS. The PORTABLEF option enables the portable comnmand-language parser. On OpenVMS, D the VMS option enables the VMS-only Command Language Interpreter < (CLI) parser. The VMS option is not available on ULTRIX.ww1XQf1 SHOWD U Displays information about the item specified by the option word. Format SHOW option 2 LIBRARYD [SCA Command] Displays the directory specification for all active SCA libraries. Format SHOW LIBRARY 3 Qualifiers/BRIEF /BRIEF (D); Displays only the directory specification for all active libraries./FULL; Displays all information about all active SCA libraries. 2 MODULE@ [SCA Command] Displays information about SCVA library modules. Format* SHOW MODULE [module-name[, . . . ]] 3 Qualifiers/ALL> Specifies that SCA display both hidden and visible modules./BRIEF@ Indicates how much information you want displayed. The /BRIEFB qualifier causes SCA to display selected information about each& indicated module in tabular format.D If you specify a wildcard expression for the parameter, or if SCA& assumes one, /BRIEF is the default./FULL? Indicates how much inWformation you want displayed. The /FULLD qualifier causes SCA to list all information available about each indicated module.B If you specify an explicit name for the parameter, /FULL is the default./HIDDEN2 Specifies that SCA display only hidden modules./LIBRARY /LIBRARY=library-spec /LIBRARY=* (D)B Specifies an SCA library containing the module to be displayed.C The library must be one of the current SCA libraries established by a SET LIBRXARY command.E If you do not specify the /LIBRARY qualifier, SCA assumes you have' specified all current SCA libraries./OUTPUT /OUTPUT[=file-spec]D Directs command output to a file rather than to the $SHOW buffer.4 The default output file specification is SCA.LIS./VISIBLE /VISIBLE (D)3 Specifies that SCA display only visible modules. 3 Parametermodule-name[, . . . ]E Specifies the modules to be displayed. If you omit this parameter,C SYCA displays all modules. You may specify wildcard module names.2 QUERYC [SCA Command] Displays information about one or more current SCA query sessions. Format" SHOW QUERY [query-name,...] 3 Qualifiers/BRIEF /BRIEF (D)? Indicates how much information you want to be displayed. TheA /BRIEF qualifier causes SCA to display (in tabular format) theB query name, query expression, and description for the indicated query./FULL? IndicatZes how much information you want to be displayed. TheB /FULL qualifier causes SCA to display all information about the indicated query. 3 Parameter query-nameB Specifies the name of the query to be displayed. If you specifyC a null query name (""), SCA assumes you mean the current query.@ If you omit this parameter, SCA assumes you have specified an asterisk (*). 2 VERSION= [SCA Command] Displays the current version of LSE and SCA. Format SHOW VERS[ION2 COMMAND LANGUAGEB [SCA Command] Displays the name of the current command language# setting; either PORTABLE or VMS. Format SHOW COMMAND LANGUAGEww1XQf1 SPAWN< [SCA Command] Spawns a subprocess running the DCL command0 interpreter and suspends the editing session.& NOTEB This function is not available in DECwindows; any attempt to invoke it incurs an error. Format SPAWN [co\mmand] 2 ParametercommandE Specifies a command line to be executed by the spawned subprocess.E If you specify this parameter, the subprocess ends and LSE regains* control upon completion of the command.ww1XQf 1 VERIFYE [SCA Command] Verifies that the specified SCA libraries are valid,' and repairs any corrupted libraries. Format& VERIFY [library-spec[, . . . ]] 2 Qualifiers/LOG /LOG (D) /NOLOGC Indicates w]hether SCA reports the library verification or repair operation./RECOVER /RECOVER /NORECOVER (D); Indicates whether SCA should repair a corrupted library.B If the interrupted command was a LOAD command, SCA deletes from= the library any module that had begun to load but that had? not completed loading. Also, SCA cannot recover modules thatA were waiting to be processed for loading when the interruption= occurred. To load interrupted and waiting modul^es, issue a5 subsequent LOAD command and include those modules.D If the interrupted library operation was a DELETE MODULE command,? the /RECOVER qualifier causes SCA to delete the incompletely@ deleted module. Any modules still waiting to be processed for@ deletion when the interruption occurred are excluded from theC recovery operation; to delete them, you must respecify them in a$ subsequent DELETE MODULE command. 2 Parameterlibrary-spec[, . . . ]D Specifies the_ SCA libraries to be verified. If you do not specifyA a library, SCA assumes you have specified the primary library.wwXXQf1 Release_Notes3 Release notes for SCA are contained in the file:$ SYS$HELP:SCAvvu.RELEASE_NOTESK The product name is followed by the version number (vvu). For example, B the following is the release notes file for Version 4.6 of SCA.$ SYS$HELP:SCA046.RELEASE_NOTESwwXXQf 1 SCA_Topics [SCA]2 Adv`anced_Query_ExamplesD The examples in this section use the SCA$EXAMPLE library. You are= encouraged to try these queries using the example library./ 1. FIND CALLED_BY( END=translit, DEPTH=ALL)4 This query gives the full call tree for TRANSLIT.G 2. FIND CALLED_BY( END=translit, BEGIN=signal_duplicate, DEPTH=ALL)E This query returns all the call paths emanating from translit that# end up calling SIGNAL_DUPLICATE.> 3. FIND CALLED_BY( translit, DEPTH=ALL, TRACE= a(NOT OPEN*))A This query gives the full call tree for TRANSLIT, but does notD show any calls from items named OPEN*. Calls to items named OPEN*D appear in the call tree; however, items which are called by OPEN*@ do not appear. Try the query without the trace expression and/ compare the results when the TRACE is given.$ 4. FIND CALLED_BY( END=translit,C BEGIN=(NOT DOMAIN=PREDEFINED and NOT lib$*)," DEPTH=ALL )? This example le baves predefined functions and functions namedA LIB$* out of the call graph. Functions such as CHR and WRITELN@ in Pascal, MAX in FORTRAN, a builtin like _ADAWI in C, and soE forth are predefined. These functions are defined by the language, not the programmer.4 5. FIND IN( build_table and occ=comp, max_code )? This example finds all occurrences of MAX_CODE in the module? BUILD_TABLE. In this case, module has the same meaning as itC does in SHOW MODULE. This is the cfastest way to limit a query toD occurrences in a particular module. The first parameter to the INC function tells SCA in what container to look. The "and occ=comp"A part of the query ensures that the BUILD_TABLE you are lookingA in is one of the modules displayed by SHOW MODULE, rather than something else.A The second parameter to the IN function tells SCA what to look5 for. This is faster than specifying the following:9 FIND IN( build_table and occ=comp ) andd max_code8 Both queries in this example produce the same result.3 Routines Used in a Module But Declared Elsewhere? In this example, you find functions that are used in a givenB module but have their primary declaration in some other module.A This example is a multistep process that makes use of previousB queries. Each query in this section is numbered so that you canA refer to a specific query. If you refer to a query, adjust theC query name (for example, where e@1 is used) to refer to the query name you have created.; 1. FIND IN( translit and occurrence=compilation_unit, -= symbol=function and domain=(global,inheritable) )E This query finds all occurrences of functions, either declarations) or references, in the module TRANSLIT.@ You use "domain=(global,inheritable)" to limit the query only= to occurrence in which you are interested. Only global and> inheritable symbols can be imported because module-specific@ f symbols are from the same module, and predefined symbols comeA from the language. Next, you have to remove any functions that0 have their primary declaration in the module.: 2. FIND @1 AND NOT EXPAND( @1 and occurrence=primary )C This query removes any functions that have a primary declaration; in the module TRANSLIT. What remains are those global orB inheritable functions that do not have a primary declaration in TRANSLIT.A The EXPAND function in this query can g be evaluated efficientlyB by SCA. The parameter to EXPAND, @1 and occurrence=primary, canD be evaluated by looking at the result of query 1, so SCA does notE have to use the SCA library. Because the overall query does @1 ANDE ..., everything in the result is present in the result of query 1.B All we are doing is removing occurrences. In this case, SCA canB evaluate the whole query expression by looking at the result of4 query 1 and does not have to use the SCA library.A h Items Declared In a Module But Not Used Anywhere In the ModuleB In this example, you find occurrences of functions or variablesE that are declared in a module but are not used in the module. ThisE example is a multistep process that makes use of previous queries.B The numbers by each query are used to refer to it later. If youD refer to a query, adjust the query name (for example, where @1 is6 used) to refer to the query names you have created.; 1. FIND IN( translit andi occurrence=compilation_unit, -- symbol=(function, variable) )E This query finds all occurrences of functions or variables, either6 declarations or references, in the module TRANSLIT.< 2. FIND @1 AND NOT EXPAND( @1 and occurrence=reference )E This query removes from our first query any functions or variablesA that have a reference in the module TRANSLIT. What remains areA those functions or variables that are not used anywhere in the module.A Tjhe EXPAND function in this query can be evaluated efficiently@ by SCA. The parameter to EXPAND, @1 and occ=reference, can beB evaluated just by looking at the result of query 1, so SCA doesB not have to use the SCA library. Because the overall query doesC @1 AND ..., everything in the result is present in the result ofE query 1. All we are doing is removing items. In this case, SCA canB evaluate the whole query expression by looking at the result of5 query 1, and does not have kto use the SCA library. Finding Unused FunctionsC This example finds functions or subroutines that are never used.E It provides several ways of solving the problem. Some of these areD easy to understand, but can be very slow on larger SCA libraries.? The more complex ones are intended to improve performance onA larger SCA libraries. They do not have a significant impact on smaller libraries.C The first example finds unused functions only. Note that insteadE l of saying "occurrence=call" to find functions that are called, youD specify "occurrence=reference" to find functions that are used at all. The query is as follows:2 FIND symbol=function AND occurrence=primary -C AND NOT EXPAND( symbol=function and occurrence=reference )B On the SCA$EXAMPLE library, this query works well because it is? a small library. On a larger library, it may be too slow. To@ evaluate this query, SCA must first evaluate "symbol=functionB a mnd occurrence=primary." It must then evaluate "symbol=functionD and occurrence=reference" before doing any additional processing.A In this case, SCA has to do twice what is essentially the sameD work. Also, SCA does not discard information about functions that< are referenced until the end, so it uses a lot of memory.? Using Previous Query Results to Find Unused Functions FasterA The next example also finds unused functions. However, it usesB previous query results, so th ne work is done only once. For this? reason, it is faster than the previous example. It also usesE somewhat less memory, but still not enough to make a difference on a large library.< FIND symbol=function and occurrence=(primary,reference)E In the previous query, we find all the occurrences that we want toC use. We ignore the associated declarations at this point because' they are not essential to the query.C Next, we must select those functions that are not used oas in the following query:% FIND @1 AND occurrence=primary -7 AND NOT EXPAND( @1 AND occurrence=reference )B This query removes from the list of functions in our system anyD that are referenced, leaving only unreferenced functions. BecauseA you are using a previous query with all the information in it,B SCA does not have to access the SCA library, and performance is generally faster.B However, on a large library, this may still be slow. The reasonB fpor this is that it ends up keeping a list of all the functions& and all their references in memory.2 Using Iteration to Find Unused Functions Faster@ This is the most complex example. It includes some repetitive? parts that the query language does not provide directly. YouB can do these using the callable interface, or by writing a .COMB procedure, or you can do the repetitive parts manually. This is= also the fastest form of the example and uses less memory.D Basic qally, you are going to split up the work into smaller piecesD to avoid having to keep everything in memory at the same time. InE this example, you process one module at a time, so you need to getE a list of modules first. You can do this by entering the following query:& 1. FIND occurrence=compilation_unit< In the next step, you have to loop through each of theD occurrences found in step 1. This part cannot be done directly@ using the query language. You can do r this using one of the following methods:B o Do this manually, stepping through the occurrences in theA query one by one, and using INDICATED() in the following0 queries where module_name is specified.B o Use the /DISPLAY options to specify only the name of eachB occurrence found, capture the result in a file, and writeB a command procedure to loop over the names. In this case,E you use "module_name and occurrence=compilation_unit" s in the: following queries where module_name is specified.? o Use the callable interface. By writing a small programE using the callable interface, you can do the loop relativelyD easily, using SCA$GET_OCCURRENCE and SCA$SELECT_OCCURRENCE.A In any case, you repeat the following steps for each of the modules found in step 1.D 2. FIND IN( module_name, symbol=function and occurrence=primary )> This step finds primary declarations of functtions in the@ current module. You want only primary declarations at thisD stage because there may be some calls in other modules. In the< next step, you find any references to those functions: 3. FIND EXPAND( @2 )C This finds everything you need. At this point, what you do isC very similar to what you did for the examples in the previous section.& 4. FIND @3 and occurrence=primary -8 AND NOT EXPAND( @3 and occurrence=reference )D uThis finds those functions in a particular module that are notA referenced anywhere. Steps 2 through 4 must be repeated for each module.2 Basic_Query_Concepts@ This section covers some of the basic concepts underlying SCA queries.B You may want to have a hardcopy of this section. The directions+ for producing a hardcopy are as follows:D 1. Place the contents of Basic_Query_Concepts in a printable file> by typing the following command at the DCL command lvine:0 $ HELP/OUTPUT=BASIC_QUERY_CONCEPTS.TXT -. _$ SCA SCA_Topics Basic_Query_ConceptsA 2. Print BASIC_QUERY_CONCEPTS.TXT from the DCL command line as follows:( $ PRINT BASIC_QUERY_CONCEPTS.TXT What Queries AreB An SCA library is a collection of information about your sourceC code. This includes information, such as the names and locations? of all variables in your code, all the places where routines@ are called and what their argumenwts are, and many other kinds of information.; Issuing a query is the process of selecting some of thisB information from the library. By giving a query expression withE the FIND command, you specify exactly what information you want to retrieve from the library. OccurrencesA An occurrence is any instance of an entity in your program. An> entity can be any language construct, such as a variable, a@ routine, or a constant. To further clarify this, consider thexB following code fragment (not written in a particular language): 1 MODULE myprog; 2 3 VAR i,j; 4 5 ROUTINE foo() 6 BEGIN 7 i = 5; 8 j = i; 9 END; 10 END;D The code contains four entities (myprog, foo, i, j). There is oneA occurrence each of the module myprog, and the routine foo. TheE variable i, however, has three occurrences, and the variable j has two. Attribute Selection@ y Attribute selection is a query that selects occurrences basedB on certain attributes. For example, you can have SCA return all@ occurrences in which the name attribute is XYZ. The following3 sections list the attributes used for selection. NAME Attribute< Generally, you think of entities in you program as havingA only a name. In fact, the name of an entity is only one of itsD attributes. What you are doing when you give the basic query FINDE X, is asking for all oc zcurrences in the library that have the nameA attribute X. (The query FIND X is equivalent to the query FINDA NAME=X. NAME= is the default attribute, so it may be omitted.) SYMBOL_CLASS Attribute> The symbol class attribute describes an occurrence in terms? of language constructs. In the previous example, myprog is aA MODULE, foo is a ROUTINE, and i and j are variables. Thus, youC could ask SCA to find things based on the symbol class only. ForB example, you can {find all the routines in the library by giving1 the following query: FIND SYMBOL_CLASS=ROUTINE? Note that MODULE, ROUTINE, and VARIABLE are SCA keywords for< symbol classes. Because different languages use differentC terminology, there is a need to understand how the SCA language-C independent terms relate to the language-specific terms. We haveB provided tables to help you match the SCA terms to the specificB language constructs for all the languages that support SCA. See= | the Getting_Started help subtopics for specific languages. OCCURRENCE AttributeB The occurrence class attribute allows you to select occurrencesB based on attributes specific to the occurrence. In the previous= example, on line 3 the occurrence of the variable i has an= occurrence class of PRIMARY. On line 7, the occurrence has? an occurrence class of WRITE, and on the following line, itsC occurrence class is READ. To find all entities that are declared/ in yo}ur system, specify the following query: FIND OCCURRENCE=PRIMARYB Note that as with symbol classes, there is a need to understandA the relationship between the SCA occurrence class keywords andD the equivalent language terminology. See the Getting_Started help$ subtopics for specific languages. FILE_SPEC AttributeB Another attribute of all occurrences is the name of the file inB which they occur. If the previous example program was in a fileC called MYPROG.BAR~, then the following query would return all theB occurrences found in the file; in this case, all occurrences of myprog, foo, i, and j: FIND FILE_SPEC="MYPROG.BAR" SYMBOL DOMAIN AttributeC The domain of an entity defines the scope within the source overA which the entity is known. Variables or routines, for example,E may be local to a particular module, or they might be known to allD modules in a system. To find all occurrences of entities that are; known throught your system, specify the following query: FIND DOMAIN=GLOBALA See the Getting_Started help subtopics for specific languages. Basic QueriesB You have already seen examples of the most basic type of query,@ that is a query based on the selection of just one attribute. These examples are: FIND X FIND SYMBOL=ROUTINE FIND OCCURRENCE=PRIMARY FIND DOMAIN=GLOBAL FIND FILE_SPEC="MYPROG.BAR"@ Each of these queries results in a set of occur rences. Often,@ the result of such a query contains more information than youB really want. You can explicitly indicate the result you want byA specifying multiple attributes and combining them by using set? operations. For example, if you only want the ROUTINES namedA X (rather than all items named X or all routines), specify the following query expression: FIND X AND SYMBOL=ROUTINEE In the previous example, the set operator AND was used to take theB intersection of the two sets. The other set operators availableB are OR, XOR, and NOT. In this manner, you can combine attributeC selection expressions using multiple set operators. For example:8 FIND (X OR Y ) AND SYMBOL=ROUTINE AND OCCURRENCE=CALLA This query finds all call references to routines named X or Y. Relationship Queries> You have already learned how to select occurrences based onB their attributes. The following section describes how to selectB occurrences based on their relationship with other occurrences. Calls RelationshipD The most common of these relationships is the calls relationship.@ SCA provides two functions: CALLING and CALLED_BY. With these= functions, you can display the call tree structure of your? program. The most basic format of the query expression is as follows: FIND CALLED_BY FOOD In this example, the result shows a structured display of all theB routines that FOO directly calls. You can als o display routines that call FOO as follows: FIND CALLING FOOC The previous two queries answer the questions, "Who is called by1 FOO?" and, "Who is calling FOO?" respectively.@ The full syntax of the relationship functions is complex, andD each relationship function is described in more detail under SCA_@ Topics. Without explaining why the parentheses are necessary,A and emphasizing that the order of parameters is important, theC following examples shows one more useful feature of relationshipE functions. It is possible to get a call tree of arbitrary depth by giving the following query:# FIND CALLED_BY (FOO, DEPTH=ALL )> This returns a display showing not only the routines calledA directly by FOO, but also the routines that they in turn call,D for all levels. You can replace the keyword ALL with any positive/ integer to limit the depth of the call tree. Contains Relationship= Another relationship available through SCA is the contains= relationship, which is obtained through the CONTAINING andB CONTAINED_BY functions. These functions have the same syntax as the calls functions.E The CONTAINED_BY function returns all entities logically containedD within the given parameter. For example, the query FIND CONTAINEDC FOO returns two occurrences of i and one occurrence of j, in the code fragment that follows: 1 MODULE myprog; 2 3 VAR i,j; 4 5 ROUTINE foo() 6 BEGIN 7 i = 5; 8 j = i; 9 END; 10 END;? Similarly, the following query returns the occurrence of the module MYPROG: FIND CONTAINING FOO Types Relationship> The types relationship consists of the two functions TYPINGA and TYPED_BY. These functions also have the same syntax as theE previous functions. The TYPED_BY function returns type trees. ThisA is useful if there are many user-defined types in your system,A particularly if they are complex record structures. The TYPING- function returns the type of its argument.E For more information about all the relationship functions, see the$ help topic for each relationship.2 Building_An_SCA_LibraryB To create your own SCA library, you must first create a library< directory for it. Using your personal directory, type the= following command to create a subdirectory for a local SCA library: $ CREATE/DIRECTORY [.LIB1]D Once you have a directory in which to create a library, enter the0 following command to SCA to create a library:! $ SCA CREATE LIBRARY [.LIB1]@ You now have an empty SCA library. To add a module to the SCA4 library, you must first compile your source code.< Add the /ANALYSIS_DATA qualifier when you use a supported compiler. For example:! $ CC/ANALYSIS_DATA myfile.cD This produces the file MYFILE.ANA that you can load into your SCAC library either from LSE or standalone SCA. To load the .ANA file8 and show the new module, type the following commands: SCA> LOAD myfile.ANA SCA> SHOW MODULEE You will see that the new module has been loaded into the library,2 and you will now be able to query that library.> For more information, see the help topics for Libraries and Reducing_LOAD_Time.2 Callable_Routines3 SCA$ASYNCH_TERMINATE8 Sets a flag indicating that a CTRL-C has been issued. Format* SCA$ASYNCH_TERMINATE command_context 4 Argumentcommand_context# type: $SCA_COMMAND_CONTEXT access: read/write mechanism: by reference SCA command context value.4 Condition_Value_Returned6 SCA$_NORMAL Normal successful completion.4 DescriptionA The SCA$ASYNCH_TERMINATE routine sets a flag indicating that a CTRL-C has been issued.3 SCA$CLEANUPE Shuts down the SCA callable command interface, freeing all dynamicE memory associated with the interface routines and data structures. Format! SCA$CLEANUP command_context 4 Argumentcommand_context# type: $SCA_COMMAND_CONTEXT access: read/write mechanism: by reference An SCA command context value.4 Condition_Value_ReturnedD SCA$_NORMAL The SCA callable command interface has been0 successfully shut down.4 Description> The SCA$CLEANUP routine shuts down the SCA callable command< interface, freeing all dynamic memory associated with the* interface routines and data structures.3 SCA$DO_COMMANDD Parses an SCA subsystem command and invokes command processing if( the command is syntactically correct. Format% SCA$DO_COMMAND command_context,# command_string) [,parameter_routine], [,continuation_routine]+ [,continuation_prompt]% [,user_argument]' [,confirm_routine]% [,topic_routine]' [,display_routine] 4 Argumentscommand_context# type: $SCA_COMMAND_CONTEXT access: read/write mechanism: by reference SCA command context value.command_string type: character string access: read only mechanism: by descriptor An SCA subsystem command.parameter_routine type: procedure access: read only mechanism: by reference@ Routine that prompts for required parameters. You can specifyA LIB$GET_INPUT or a compatible routine. If a routine address ofC zero (0) is specified, commands with missing parameters fail and display a CLI error message.continuation_routine type: procedure access: read only mechanism: by reference@ Routine that prompts for the remainder of a continued command= (i.e., a command that ends with a hyphen). You can specify) LIB$GET_INPUT or a compatible routine.continuation_prompt type: character string access: read only mechanism: by descriptor4 Command continuation prompt string (e.g., SCA> ). user_argument type: longword access: read only mechanism: by referenceA User-specified value to be passed to any action routine (other4 than CLI prompt routines) called by this routine.confirm_routine  type: procedure access: read only mechanism: by valueB Command confirmation prompt routine to be used by commands thatA support a /CONFIRM qualifier. You can specify SCA$GET_INPUT orB a compatible routine. If this argument is omitted, the /CONFIRM qualifier is not supported. topic_routine type: procedure access: read only mechanism: by value@ Help topic prompt routine. You can specify LIB$GET_INPUT or a@ compatible routine. If this routine returns an error, commandA processing is terminated. If this argument is omitted, no help prompting is performed.display_routine type: procedure access: read only mechanism: by valueB Routine to be called to display one line of command output. You> can specify SCA$PUT_OUTPUT or a compatible routine. If thisA routine returns an error, command processing is terminated. If: this argument is omitted, no display routine is called.4 Condition_Values_Returned All SCA condition values and many system values.4 Description= The SCA$DO_COMMAND routine parses an SCA subsystem commandA and invokes command processing if the command is syntactically correct.3 SCA$GET_ATTRIBUTE. Gets a handle to an attribute of an entity. Format SCA$GET_ATTRIBUTE entity,' attribute_kind,) attribute_handle,, [,iteration_context] 4 Argumentsentity type: $SCA_HANDLE access: read only mechanism: by referenceC An SCA entity handle describing the entity or relationship whose! attributes are being obtained.attribute_kind" type: $SCA_ATTRIBUTE_KIND access: read only mechanism: by reference( The kind of attribute to be obtained.7 Any attribute-kind can be specified on this routine.attribute_handle type: $SCA_HANDLE access: write only mechanism: by reference; An SCA attribute handle that is to describe the obtained attribute.iteration_context% type: $SCA_ITERATION_CONTEXT access: read/write mechanism: by referenceC Optional. The iteration-context. This longword must contain zeroE on the first call to this routine for a particular iteration. ThisC routine uses the longword to maintain the iteration context. The7 caller must not change the contents of the longword.4 Condition_Values_ReturnedE SCA$_NORMAL An attribute has been successfully returned.E SCA$_NONE Warning. An attribute has not been returned.? Either there are no such attributes at? all in the entity or there are no more$ attributes.4 DescriptionD The SCA$GET_ATTRIBUTE routine gets a handle to an attribute of an entity.< If the iteration_context parameter is not specified, then? this routine finds the first attribute of the specified kindA (attribute_kind) and updates attribute_handle to describe that attribute.E In general, several attributes can be associated with a particularD entity. With this routine you can find all of those attributes by) using the iteration_context parameter.3 SCA$GET_ATTRI_KIND_T Gets an attribute kind. Format, SCA$GET_ATTRI_KIND_T attribute_handle,) attribute_kind 4 Argumentsattribute_handle type: $SCA_HANDLE access: read only mechanism: by referenceC An SCA handle describing an attribute whose attribute-kind is to be obtained.attribute_kind type: character string access: write only mechanism: by descriptor The kind of the attribute.4 Condition_Value_Returned@ SCA$_NORMAL An attribute kind has been successfully" returned.4 DescriptionE The SCA$GET_ATTRI_KIND_T routine returns the kind of any attribute as a character string.3 SCA$GET_ATTRI_VALUE_T Gets an attribute value. Format3 SCA$GET_ATTRI_VALUE_T handle, attribute_value- [,attribute_kind] 4 Argumentshandle type: $SCA_HANDLE access: read/write mechanism: by reference? An SCA attribute handle describing either an attribute or an( entity whose value is to be obtained.attribute_value type: character string access: read/write mechanism: by descriptor6 The (string) value of the attribute being selected.attribute_kind" type: $SCA_ATTRIBUTE_KIND access: read/write mechanism: by reference2 Optional. The kind of attribute to be obtained.4 Condition_Values_ReturnedA SCA$_NORMAL An attribute value has been successfully" returned.@ SCA$_NONE Warni ng. An attibute-value has not beenB returned. There are no such attributes inC the entity. This condition can be returned> only if this routine is processing an entity.4 Description= The SCA$GET_ATTRI_VALUE_T routine returns the value of any# attribute as a character string.B If the handle describes an attribute, then this routine returns@ the value of that attribute. In this case , the attribute_kind# parameter must not be specified.C If the handle describes an entity, then this routine returns theB value of the first attribute of that entity that is of the kind@ specified by the attribute_kind parameter. In this case, the. attribute_kind parameter must be specified.C If you want to get more than one attribute value of a particularB kind for an entity, you must use the routine SCA$GET_ATTRIBUTE.@ This applies only to the attribute kinds SCA$K_ATTRI_NAME and SCA$K_ATTRI_ALL.= The value of any kind of attribute can be returned by thisD routine, except for SCA$K_ATTRI_ALL. This routine will convert toE character string those attributes whose data type is not character string.E This routine does not accept the attribute-kind SCA$K_ATTRI_ALL asE the value of the attribute_kind parameter. It is not meaningful toA get just the first attribute without regard to attribute-kind.3 SCA$GET_CURRENT_QUERYC Gets the name of the current query in the given command context. Format, SCA$GET_CURRENT_QUERY command_context,& query_name 4 Argumentscommand_context# type: $SCA_COMMAND_CONTEXT access: read/write mechanism: by reference An SCA command context. query_name type: character string access: write only mechanism: by descriptorD The name of the current query in the context of the given command  context.4 Condition_Values_Returned? SCA$_NORMAL The name of the current query has been0 successfully retrieved.4 DescriptionA The SCA$GET_CURRENT_QUERY routine gets the name of the current& query in the given command context.3 SCA$GET_INPUTC Gets one record of ASCII text from the current controlling input! device specified by SYS$INPUT. Format SCA$GET_INPUT get_string,$ [,prompt_string]$ [,output_length]$ [,user_argument] 4 Arguments get_string type: character string access: write only mechanism: by descriptor@ Buffer to receive the line read from SYS$INPUT. The string is% returned by a call to STR$COPY_DX. prompt_string type: character string access: read only mechanism: by descriptorB Prompt message that is displayed on the controlling terminal. AB valid prompt co nsists of text followed by a colon (:), a space,A and no carriage-return/line-feed combination. The maximum sizeD of the prompt message is 255 characters. If the controlling input6 device is not a terminal, this argument is ignored. output_length type: word access: write only mechanism: by reference@ Word to receive the actual length of the GET-STRING line, notC counting any padding in the case of a fixed string. If the inputA line was truncated, this length reflects the truncated string. user_argument type: _UNSPECIFIED access: read only mechanism: by referenceB User-specified value that was passed to the routine that called this action routine.4 Condition_Values_Returned4 SCA$_NORMAL An input line was returned. Failure completion code from LIB$GET_ INPUT.4 DescriptionC The SCA$GET_INPUT routine gets one record of ASCII text from the; current controlling input device specified by SYS$INPUT.3 SCA$GET_OCCURRENCEC Returns an occurrence from the query specified by the query_name argument. Format) SCA$GET_OCCURRENCE command_context,$ query_name,# occurrence 4 Argumentscommand_context# type: $SCA_COMMAND_CONTEXT access: read/write mechanism: by reference An SCA command context. query_name type: character string access: read only mechanism: by descriptor? The name of the query in the context of the command context. occurrence type: $SCA_HANDLE access: read/write mechanism: by reference9 An SCA occurrence handle that describes an occurrence.4 Condition_Values_Returned< SCA$_NORMAL An occurrence has been successfully" returned.< SCA$_NEWNAME An occurrence has been successfullyB returned. This occurrence has a differentC name from the occurrence that was returnedB by the previous call to this routine withC this query context. This condition implies> that this new occurrence is also of a* different symbol.< SCA$_NEWITEM An occurrence has been successfully> returned. This new occurrence is of aB dif ferent symbol from the occurrence thatB was returned by the previous call to this9 routine with this query context.< SCA$_NOMORE Warning. An occurrence has not beenD returned. The traversal of the query result, has been exhausted.4 Description@ The SCA$GET_OCCURRENCE routine returns an occurrence from the. query specified by the query_name argument.A If the occurrence han dle supplied is zero, the routine returnsC a handle to the first occurrence in the query represented by theB argument query_name. If the occurrence handle supplied on inputA represents a valid occurrence, the routine returns a handle toE the next occurrence in the query result. In order to be valid, theE occurrence handle supplied on input must refer to an occurrence in4 the query represented by the argument query_name.? The query name supplied is interpreted in the context of the> command context identified by the argument command_context.D Note that the order of retrieval of the occurrences is undefined.3 SCA$INITIALIZE2 Initializes the SCA callable command interface. Format$ SCA$INITIALIZE command_context 4 Argumentcommand_context# type: $SCA_COMMAND_CONTEXT access: write only mechanism: by referenceD SCA command context value to be initialized. This value is passed, as an argument to other SCA$xxx routines.4 Condition_Value_ReturnedD SCA$_NORMAL The SCA callable command interface has been2 successfully initialized.4 DescriptionB The SCA$INITIALIZE routine initializes the SCA callable command interface.3 SCA$LOCK_LIBRARYB Locks all the physical libraries in the current virtual library( list so that they cannot be modified. Format& SCA$LOCK_LIBRARY command_context 4 Argumentcommand_context# type: $SCA_COMMAND_CONTEXT access: read/write mechanism: by reference An SCA command context.4 Condition_Value_ReturnedE SCA$_NORMAL The libraries have been successfully locked.4 DescriptionC The SCA$LOCK_LIBRARY routine locks all the physical libraries inD the current virtual library list so that they cannot be modified.3 SCA$PUT_OUTPUTE Writes a record to the current controlling output device specified by SYS$OUTPUT. Format SCA$PUT_OUTPUT string," user_argument 4 Argumentsstring type: character string access: read only mechanism: by descriptorA String to be written to SYS$OUTPUT. You can concatenate one orD more additional character strings with the primary string to formC a single output record. You can specify a maximum of 20 strings.9 The maximum resulting record length is 255 characters. user_argument type: _UNSPECIFIED access: read only mechanism: by referenceB User-specified value that was passed to the routine that called this action routine.4 Condition_Values_Returned? SCA$_NORMAL The string was successfully written to$ SYS$OUTPUT. Failure completion from the RMS $PUT service.4 Description< The SCA$PUT_OUTPUT routine writes a record to the current5 controlling output device specified by SYS$OUTPUT.3 SCA$QUERY_CLEANUP= Cleans up an SCA query context, freeing all dynamic memory associated with the query. Format% SCA$QUERY_CLEANUP query_context 4 Argument query_context! type: $SCA_QUERY_CONTEXT access: read/write mechanism: by reference) An SCA query context to be cleaned up.4 Condition_Value_Returned@ SCA$_NORMAL The query context has been successfully$ cleaned up.4 Description@ The SCA$QUERY_CLEANUP routine cleans up an SCA query context,8 freeing all dynamic memory associated with the query.@ This routine will become obsolete in a future version of SCA.3 SCA$QUERY_COPY> Copies a query from SRC_QUERY_CONTEXT to DST_QUERY_CONTEXT. Format' SCA$QUERY_COPY src_query_context,& dst_query_context 4 Argumentssrc_query_context! type: $SCA_QUERY_CONTEXT access: read/write mechanism: by reference> An SCA query context that describes the query to be copied.dst_query_context! type: $SCA_QUERY_CONTEXT access: read/write mechanism: by reference= An SCA query context into which the query is to be copied.4 Condition_Value_ReturnedC SCA$_NORMAL The query expression has been successfully copied.4 DescriptionC The SCA$QUERY_COPY routine copies a query from SRC_QUERY_CONTEXTA to DST_QUERY_CONTEXT. This will copy whatever is in SRC_QUERY_C CONTEXT, whether that is a question, or a question and a result.@ This routine will become obsolete in a future version of SCA.3 SCA$QUERY_FINDE Finds the occurrences that match the query expression specified by QUERY_CONTEXT. Format" SCA$QUERY_FIND query_context 4 Argument query_context! type: $SCA_QUERY_CONTEXT access: read/write mechanism: by reference? An SCA query context that describes a query expression to be evaluated.4 Condition_Values_ReturnedC SCA$_NORMAL The query expression has been successfully# evaluated.C SCA$_NOOCCUR No occurrences match the query expression.E SCA$_RESULTEXISTS The query already has a result prior to this call.4 DescriptionB The SCA$QUERY_FIND routine finds the occurrences that match the/ query expression specified by QUERY_CONTEXT.@ This routine will become obsolete in a future version of SCA.3 SCA$QUERY_GET_ATTRIBUTE. Gets a handle to an attribute of an entity. Format% SCA$QUERY_GET_ATTRIBUTE entity,- attribute_kind,/ attribute_handle,2 [,iteration_context] 4 Argumentsentity type: $SCA_HANDLE access: read only mechanism: by referenceC An SCA entity handle describing the entity or relationship whose! attributes are being obtained.attribute_kind" type: $SCA_ATTRIBUTE_KIND access: read only mechanism: by reference( The kind of attribute to be obtained.7 Any attribute-kind can be specified on this routine.attribute_handle type: $SCA_HANDLE access: write only mechanism: by reference; An SCA attribute handle that is to describe the obtained attribute.iteration_context% type: $SCA_ITERATION_CONTEXT access: read/write mechanism: by referenceC Optional. The iteration-context. This longword must contain zeroE on the first call to this routine for a particular iteration. ThisC routine uses the longword to maintain the iteration context. The7 caller must not change the contents of the longword.4 Condition_Values_ReturnedE SCA$_NORMAL An attribute has been successfully returned.E SCA$_NONE Warning. An attribute has not been returned.? Either there are no such attributes at? all in the entity or there are no more$ attributes.4 DescriptionD The SCA$QUERY_GET_ATTRIBUTE routine gets a handle to an attribute of an entity.< If the iteration_context parameter is not specified, then? this routine finds the first attribute of the specified kindA (attribute_kind) and updates attribute_handle to describe that attribute.E In general, several attributes can be associated with a particularD entity. With this routine you can find all of those attributes by) using the iteration_context parameter.D This routine will become obsolete in a future version of SCA. The5 SCA$GET_ATTRIBUTE routine supersedes this routine.3 SCA$QUERY_GET_ATTRI_KIND_T Gets an attribute kind. Format2 SCA$QUERY_GET_ATTRI_KIND_T attribute_handle,/ attribute_kind 4 Argumentsattribute_handle type: $SCA_HANDLE access: read only mechanism: by referenceC An SCA handle describing an attribute whose attribute-kind is to be obtained.attribute_kind type: character string access: write only mechanism: by descriptor The kind of the attribute.4 Condition_Value_Returned@ SCA$_NORMAL An attribute kind has been successfully" returned.4 DescriptionA The SCA$QUERY_GET_ATTRI_KIND_T routine returns the kind of any# attribute as a character string.D This routine will become obsolete in a future version of SCA. The8 SCA$GET_ATTRI_KIND_T routine supersedes this routine.3 SCA$QUERY_GET_ATTRI_VALUE_T Gets an attribute value. Format9 SCA$QUERY_GET_ATTRI_VALUE_T handle, attribute_value3 [,attribute_kind] 4 Argumentshandle type: $SCA_HANDLE access: read/write mechanism: by reference? An SCA attribute handle describing either an attribute or an( entity whose value is to be obtained.attribute_value type: character string access: read/write mechanism: by descriptor6 The (string) value of the attribute being selected.attribute_kind" type: $SCA_ATTRIBUTE_KIND access: read/write mechanism: by reference2 Optional. The kind of attribute to be obtained.4 Condition_Values_ReturnedA SCA$_NORMAL An attribute value has been successfully" returned.@ SCA$_NONE Warning. An attibute-value has not beenB returned. There are no such attributes inC the entity. This condition can be returned> only if this routine is processing an entity.4 DescriptionC The SCA$QUERY_GET_ATTRI_VALUE_T routine returns the value of any# attribute as a character string.B If the handle describes an attribute, then this routine returns@ the value of that attribute. In this case, the attribute_kind# parameter must not be specified.C If the handle describes an entity, then this routine returns theB value of the first attribute of that entity that is of the kind@ specified by the attribute_kind parameter. In this case, the. attribute_kind parameter must be specified.C If you want to get more than one attr ibute value of a particular> kind for an entity, you must use the routine SCA$QUERY_GET_C ATTRIBUTE. This applies only to the attribute kinds SCA$K_ATTRI_ NAME and SCA$K_ATTRI_ALL.= The value of any kind of attribute can be returned by thisD routine, except for SCA$K_ATTRI_ALL. This routine will convert toE character string those attributes whose data type is not character string.E This routine does not accept the attribute-kind SCA$K_ATTRI_ALL asE the value of the attribute_kind parameter. It is not meaningful toA get just the first attribute without regard to attribute-kind.D This routine will become obsolete in a future version of SCA. The9 SCA$GET_ATTRI_VALUE_T routine supersedes this routine.3 SCA$QUERY_GET_NAME Returns the name of a query. Format' SCA$QUERY_GET_NAME query_context,# query_name 4 Arguments query_context! type: $SCA_QUERY_CONTEXT access: read/write mechanism: by reference5 An SCA query context whose name is to be obtained. query_name type: character string access: write only mechanism: by descriptor The name of the query.4 Condition_Value_Returned= SCA$_NORMAL The query name has been successfully" returned.4 Description> The SCA$QUERY_GET_NAME routine returns the name of a query.@ This routine will become obsolete in a future version of SCA.3 SCA$QUERY_GET_OCCURRENCED Gets the next occurrence in the query result that is specified as a query_context argument. Format- SCA$QUERY_GET_OCCURRENCE query_context,, entity_handle 4 Arguments query_context! type: $SCA_QUERY_CONTEXT access: read/write mechanism: by reference= An SCA query context whose occurrences are to be obtained. entity_handle type: $SCA_HANDLE access: read/write mechanism: by reference1 An SCA entity handle that describes an entity.4 Condition_Values_Returned< SCA$_NORMAL An occurrence has been successfully" returned.< SCA$_NEWSYMBOL An occurrence has been successfully> returned. This new occurrence is of aB different symbol than the occurrence thatB was returned by the previous call to this! routine.< SCA$_NOMORE Warning. An occurrence has not beenD returned. The traversal of the query result, has been exhausted.4 DescriptionB The SCA$QUERY_GET_OCCURRENCE routine successively returns everyD occurrence in a query result. It provides one pass through all of the occurrences.D This routine will become obsolete in a future version of SCA. The6 SCA$GET_OCCURRENCE routine supersedes this routine.3 SCA$QUERY_INITIALIZE$ Initializes an SCA query context. Format+ SCA$QUERY_INITIALIZE command_context,( query_context 4 Argumentscommand_context# type: $SCA_COMMAND_CONTEXT access: read/write mechanism: by reference An SCA command context. query_context! type: $SCA_QUERY_CONTEXT access: write only mechanism: by referenceE An SCA query context to be initialized. This value is passed as an8 argument to other SCA query routines (SCA$QUERY_xxx).4 Condition_Value_Returned@ SCA$_NORMAL The query context has been successfully% initialized.4 DescriptionE The SCA$QUERY_INITIALIZE routine initializes an SCA query context.D This routine must be called before any other SCA$QUERY_ routines.@ This routine will become obsolete in a future version of SCA.3 SCA$QUERY_PARSE? Parses a query expression command string and sets up a query3 context if the command is syntactically correct. Format< SCA$QUERY_PARSE query_context, query_expression_string0 [,query_expression_length] 4 Arguments query_context! type: $SCA_QUERY_CONTEXT access: read/write mechanism: by reference? An SCA query context that is to describe the indicated query expression.query_expression_string type: character string access: read only mechanism: by descriptor A query expression string.query_expression_length type: longword access: write only mechanism: by reference> Optional. Length of the query expression, returned from the parser.4 Condition_Values_Returned= SCA$_NORMAL The query expression string has been- successfully parsed.A SCA$_MORETEXT Warning. The query expression string has? been successfully parsed, but the text@ following the query expression is not aA legal part of the query expression. ThisA condition is returned only if the query_E expression_length parameter is specified. IfD the query_expression_length parmeter is notB specified, then this routine insists thatC the whole query_expression_string argumentB be a legal query expression; in this case1 all errors are signaled.4 DescriptionC The SCA$QUERY_PARSE routine parses a query expression string andC sets up a query context if the command is syntactically correct.@ This routine will become obsolete in a future version of SCA.3 SCA$QUERY_SELECT_OCCURRENCE= Creates a query expression that matches a specific entity. Format0 SCA$QUERY_SELECT_OCCURRENCE query_context,/ entity_handle 4 Arguments query_context! type: $SCA_QUERY_CONTEXT access: read/write mechanism: by reference> An SCA query context that is to describe a specific entity. entity_handle type: $SCA_HANDLE access: read/write mechanism: by reference@ An SCA entity handle that describes the entity that the newly% defined query context is to match.4 Condition_Value_ReturnedA SCA$_NORMAL A query expression has been successfully! defined.4 DescriptionE The SCA$QUERY_SELECT_OCCURRENCE routine creates a query expression" that matches a specific entity.? You use this routine to specify queries based on the resultsB of previous queries. The entity_handle parameter is obtained by9 traversing the results of a previous query evaluation.A Typically, the query context of the entity_handle parameter isD not the same as the query_context parameter. However, they can beC the same. If they are the same query context, then that previousE query is replaced with the query defined by this routine and, as a) result, entity_handle becomes invalid.D This routine will become obsolete in a future version of SCA. The9 SCA$SELECT_OCCURRENCE routine supersedes this routine.3 SCA$SELECT_OCCURRENCE6 Creates a query that matches a specific occurrence. Format' SCA$SELECT_OCCURRENCE occurrence,& query_name 4 Arguments occurrence type: $SCA_HANDLE access: read only mechanism: by referenceC An SCA occurrence handle which describes the occurrence that the# newly created query is to match. query_name type: character string access: write only mechanism: by descriptorD The name of the newly created query. This query is created in theA context of the same command context as that in which the input occurrence handle is defined.4 Condition_Values_ReturnedA SCA$_NORMAL A query expression has been successfully! defined.4 DescriptionE You use this routine to create new queries based on the results ofC previous queries. The occurrence handle parameter is obtained by9 traversing the results of a previous query evaluation.3 SCA$UNLOCK_LIBRARYD Unlocks all the physical libraries in the current virtual library% list so that they can be modified. Format( SCA$UNLOCK_LIBRARY command_context 4 Argumentcommand_context# type: $SCA_COMMAND_CONTEXT access: read/write mechanism: by reference An SCA command context.4 Condition_Value_Returned= SCA$_NORMAL The libraries have been successfully" unlocked.4 DescriptionD The SCA$UNLOCK_LIBRARY routine unlocks all the physical librariesD in the current virtua l library list so that they can be modified.2 Callable_SCA: The SCA Callable Interface allows you to use SCA withinE independent application programs. This allows you to integrate SCAE into alternative user-interfaces and lets you generate specialized$ reports based on SCA information.E The SCA Callable Interface contains two components. The first is aC set of routines termed Callable Command Routines, which compriseB a high-level interface which must always be used, regardless of@ the type of application. This provides a very simple callableD interface to SCA, which will be sufficient for most applications.& Callable Command Interface Routines o SCA$ASYNCH_TERMINATE o SCA$CLEANUP o SCA$DO_COMMAND o SCA$GET_INPUT o SCA$INITIALIZE o SCA$LOCK_LIBRARY o SCA$PUT_OUTPUT o SCA$UNLOCK_LIBRARY< The second component is a set of routines termed Callable@ Query Routines. The Callable Query Routines comprise a lower-@ level interface to the FIND command. Using this interface, anD application has control over the specification of queries and the! manipulation of query results.1 Callable Query Initialization/Cleanup Routines o SCA$QUERY_CLEANUP o SCA$QUERY_INITIALIZE, Callable Query Question Building Routines o SCA$QUERY_PARSE! o SCA$QUERY_SELECT_OCCURRENCE o SCA$SELECT_OCCURRENCE. Callable Query Result Manipulation Routines o SCA$GET_ATTRIBUTE o SCA$GET_ATTRI_KIND_T o SCA$GET_ATTRI_VALUE_T o SCA$GET_OCCURRENCE o SCA$QUERY_GET_ATTRIBUTE o SCA$QUERY_GET_ATTRI_KIND_T! o SCA$QUERY_GET_ATTRI_VALUE_T o SCA$QUERY_GET_OCCURRENCE( Callable Query Miscellaneous Routines o SCA$GET_CURRENT_QUERY o SCA$QUERY_COPY o SCA$QUERY_FIND o SCA$QUERY_GET_NAME Message Handling@ The SCA callable interface handles all messages the same way:@ it signal s them. If you want control over the display of suchC messages, you must establish a condition handler. Establishing a! condition handler is optional.! Rules for Calling SCA RoutinesD o Most SCA routines are not AST-reentrant; therefore, you shouldC not call an SCA routine (except SCA$ASYNCH_TERMINATE) from anD AST routine that may currently be interrupting an SCA routine.) o Your program must not disable ASTs.D o If your program uses event flags, you must use the OpenVMS RTLE routines (LIB$RESERVE_EF, LIB$GET_EF, and LIB$FREE_EF) in orderC to coordinate the use of event flags between your program and SCA.E o Except for SCA$ASYNCH_TERMINATE, do not call SCA from within anD SCA callback routine or from within a routine that is handling" a condition signaled by SCA.E o Your program must not unwind when handling a condition signaled by SCA.2 Command_Categories< This section lists the commands implemented by SCA. TheseB commands can be issued from within LSE, at DCL level, or at the@ SCA subsystem level. See individual commands for definitions,2 descriptions, and examples of all SCA commands. Query Commands o DELETE QUERY o FIND o INSPECT o SHOW QUERY Navigation Commands' o GOTO (DECLARATION, QUERY, SOURCE), o NEXT (OCCURRENCE, QUERY, STEP, SYMBOL)0 o PREVIOUS (OCCURRENCE, QUERY, STEP, SYMBOL) General Commands % o EXIT o HELP o SHOW VERSION Library Commands o ANALYZE o CREATE LIBRARY o DELETE LIBRARY o DELETE MODULE o EXTRACT MODULE o LOAD o REORGANIZE o SET LIBRARY o SET NOLIBRARY o SHOW LIBRARY o SHOW MODULE o VERIFY o VERIFY/RECOVER2 Getting_StartedC SCA works with many languages. See the subtopics in this sectionB for information about getting started with a specific language. 3 Using_AdaC This section contains some basic examples that show what SCA canC do to help you with your programs. The examples have very littleA explanation. For a more detailed explanation of the underlyingC concepts, see the Basic_Query_Concepts help topic. The remainder? of this section is written in terms that are specific to Ada programs.E If you want to follow along and try the examples, you will need toB have an SCA library available. If you do not know how to createC an SCA library, read the Building_An_SCA_Library help topic. TheC examples use generic variable names (such as 'i'). You will haveC to substitute variable names that exist in your code when trying the examples.C The first example is the easiest query: It lets you find all theD items in your SCA library named 'i', and shows you all the places/ where they appear (all occurrences of 'i'). FIND i> You can search for any name in this manner, including u sing. wildcard characters (for example, FIND i*).? Suppose you are looking for an occurrence, and you know that@ it occurs in a particular file. The following query finds allC occurrences of items that are named 'i' but will then limit them= to those which happen to occur in the file named PROG.ADA." FIND i AND FILE_SPEC="PROG.ADA"B Another typical question one might ask is, "Find all the placesB where this item is assigned to (or read from, called, declared,B and s o forth)." The next example finds all occurrences of itemsE that are named 'i', but then limits them to only those occurrences! where 'i' is assigned a value: FIND i AND OCCURRENCE=WRITEE (SCA understands many occurrence classes other then WRITE. See theE help subtopics under Getting_Started for tables containing all the; SCA attributes and their corresponding meanings in Ada.)A Often, you only want to know where (in what file or package) a@ particular function is, so that you can go to it and edit it.A You can use the first query (where 'i' will be the name of the> function) and then look through the output. The output willA include all occurrences of the function, one of which would beE its declaration, which you can then select. Or, you can ask SCA to: limit the search for you by typing the following query: FIND i AND OCCURRENCE=PRIMARY> In SCA terms, a primary declaration is the most significantC declaration of an item. For a n Ada function, this means the bodyD of the function, or package, or generic, and so forth. This is inC contrast to the specification, which is considered an associated declaration.B Another problem you might have is that there are many differentC items in your system having a given name. Some may be variables;C others may be functions, constants, tasks, and so forth. Suppose@ you want to find only the functions named i. Again, the queryE FIND i will give you what you w ant, but it will also give you much7 more. It is preferable to issue the following query:# FIND i AND SYMBOL_CLASS=FUNCTIOND The previous four examples have selected information based on twoD attributes. The last example selected information based on a nameD attribute (in this case, i) and a symbol class attribute (in thisB case, FUNCTION). Note how the attributes are combined using theE boolean operator AND. In general, you can select items out of yourD library based o n any combination of attributes, using AND as well3 as the other logical operators OR, XOR, and NOT.> The next example shows another primary feature of SCA - theE ability to display relationships between items. This example showsB the most common use of this feature. It finds the complete callB tree (that is, all functions called directly and indirectly) of the function named i. FIND CALLED_BY (i, DEPTH=ALL)? If you want to limit the depth of the call tree, replace the' keyword ALL by any positive integer.E The final part of this section describes how to go directly to theD source code once you have issued a query. After issuing the queryC FIND i, for example, you can have an LSE query buffer containing+ something that looks like the following: I variable- ADA_MODULE\60 object declaration* ADA_MODULE\75 write reference) ADA_MODULE\79 read reference) ADA_MODULE\122 read reference* ADA_MODULE\144 write reference0 ADA_MODULE\146 read, write reference* ADA_MODULE\149 write reference) ADA_MODULE\149 read reference$ ADA_MODULE\150 reference) ADA_MODULE\166 read referenceE The first two lines of this display will be highlighted. The firstC line represents the item you looked for (i), and the rest of theC lines represent the different places in the code where this itemE occurred (that is, the oc currences of i). By using the up and downE arrows on your keyboard, or by clicking on an occurrence with yourB mouse, you can choose the occurrence you want to see. Then, allE you have to do is type CTRL/G (the keyboard equivalent of the GOTOC SOURCE command) and LSE will bring the source file into a buffer0 and position you at the occurrence you chose.E To obtain help on the following topics, request help as indicated.C o For help on query language, see the Basic_Query_Concepts help topic.A o For help on libraries, see the Building_An_SCA_Library help topic.3 Ada_Attributes_Table= The following table lists the SCA symbol classes and their! corresponding meanings in Ada.= SCA Symbol Classes and Equivalent Ada Language Terminology, SCA Term Ada Term Explanation> Argument Formal A subprogram formal parameter parameterD Component, Component Record components and discriminants Field Constant, Constant Literal Exception Exception? File File A file used during compilation Function, All Procedure, subprograms, Program, entries, Routine, and ACCEPT Subroutine statements? Generic Generic Generic subprograms or generic) packages0 Keyword Keyword PDF keyword tag Label Labels and loop identifiers Macro N/A Module, Packages Package0 Placeholder Placeholder LSE placeholder Psect N/A( Tag Tag PDF tag- Task Task Task objects Type Type7 Unbound Unbound Pragmas and attributes Variable ObjectA The following table lists the SCA occurrence classes and their! corresponding meanings in Ada.A SCA Occurrence Classes and Equivalent Ada Language Terminology, SCA Term Ada Term Explanation: Primary Body For example, package bodyC Associated Specification For example, package specificationC Declaration Declaration Any declaration, either primary or+ associated3 Reference Reference Any nondeclaration Read, Fetch Read Write, Store Write  Address, N/A Pointer Call CallB Command_line Command line A file referred to on the command? line; for example, ADA foo.ada Include N/A Precompiled N/AD Separate Separate Any Ada package or sub-program unit4 defined as SEPARATEJ With With Any WITH of an Ada package or sub-program% unit= Explicit Explicit An entity that is explicitly7 declared. For example,D declarations resulting from generic0 instantiations.E Implicit Implicit Any symbol declared by the compiler,8 for example a loop nameB Visible Visible A symbol whose name is visible in+ the sourceC Hidden Hidden A symbol whose name is not visible< in the source; for example,0 anonymous types@ Compilation_ Compilation Subprogram declaration or body,D unit unit package declaration or body, and so& forth= Limited Limited Any Ada limited private type5 Private Private Any Ada private type= The following table lists the SCA domain classes and their! corresponding meanings in ADA.= SCA Domain Classes and Equivalent Ada Language Terminology, SCA Term Ada Term Explanation> Inheritable Objects declared in a package. specification Global N/A Predefined N/AC Multi_module Inheritable, Global and PredefinedA Module_ Module Objects known to only one module specific specific 3 Using_BASICC This section contains some typical examples that illustrate whatD SCA can do to help you with your programs. The examples have veryE little explanation. If you want a more detailed explanation of theD underlying concepts, see the Basic_Query_Concepts help topic. TheE remainder of this section is written in terms that are specific to BASIC programs.E If you want to follow along and try the examples, you will need toB have an SCA library available. If you d o not know how to createC an SCA library, read the Building_An_SCA_Library help topic. TheD examples use generic variable names (such as i). You will have toB substitute variable names that actually exist in your code when trying the examples.B The first example is the easiest query of all: It lets you findC all the items in your SCA library named i, and shows you all the3 places where they appear (all occurrences of i). FIND i> You can search for any name in th is manner, including using. wildcard characters (for example, FIND i*).@ Now let's say you are looking for an occurrence, and you knowE that it occurs in a particular file. The following query finds allD occurrences of items that are named i but will then limit them to< those which happen to occur in the file named 'PROG.BAS'." FIND i AND FILE_SPEC="PROG.BAS"A Another typical question one might ask is "Find all the placesB where this item is assigned to (or read from, c alled, declared,B and so forth)." The next example finds all occurrences of itemsC that are named i, but then limits them to only those occurrences where i is assigned a value. FIND i AND OCCURRENCE=WRITEE (SCA understands many occurrence classes other then WRITE. See theE help subtopics under Getting_Started for tables containing all the= SCA attributes and their corresponding meanings in BASIC.)@ Often, you only want to know where (in what file or module) a@ p articular function is, so that you can go to it and edit it.B You could use the first query (where i would be the name of the? function) and then look through the output. The output wouldA include all occurrences of the function, one of which would beE its definition, which you could then select. Or, you could ask SCA= to limit the search for you by typing the following query: FIND i AND OCCURRENCE=PRIMARY> In SCA terms, a primary declaration is the most significant? d eclaration of an item. For a BASIC function, this means the> actual location of the function body. This is as opposed to< an associated declaration, examples of which are EXTERNAL3 declarations, and DECLARE FUNCTION declarations.B Another problem you might have is that there are many differentC items in your system having a given name. Some may be variables;D others may be functions, constants, labels, and so forth. Suppose@ you want to find only the functions named i. Again, the queryD FIND i would give you what you wanted, but it would also give you< much more. It is preferable to issue the following query:# FIND i AND SYMBOL_CLASS=FUNCTIOND The last four examples have all selected information based on twoD attributes. The last example selected information based on a nameD attribute (in this case, i) and a symbol class attribute (in thisB case, FUNCTION). Note how the attributes are combined using theE boolean operator AND. In general, you c an select items out of yourD library based on any combination of attributes, using AND as well2 as the other logical operators OR, XOR and NOT.> The next example shows another primary feature of SCA - the> ability to display relationships between items. The exampleA given here shows the most common use of this feature. It findsE the complete call tree (that is, all functions called directly and( indirectly), of the function named i. FIND CALLED_BY (I, DEPTH=ALL)C I f you want to limit the depth of the call tree, you can replace+ the keyword ALL by any positive integer.E The final part of this section describes how to go directly to theD source code once you have issued a query. After issuing the queryE FIND i, for example, you could have an LSE query buffer containing+ something that looks like the following: I variable1 BASIC_MODULE\60 variable declaration, BASIC_MODULE\75 write reference+ BASIC _MODULE\79 read reference. BASIC_MODULE\95 address reference+ BASIC_MODULE\122 read reference, BASIC_MODULE\144 write reference+ BASIC_MODULE\146 read reference, BASIC_MODULE\149 write reference+ BASIC_MODULE\149 read reference. BASIC_MODULE\150 address reference+ BASIC_MODULE\166 read referenceE The first two lines of this display will be highlighted. The firstC line represents the item you looked for (I), and the rest of theC lines represent the different places in the code where this itemE occurred (that is, the occurrences of I). By using the up and downE arrows on your keyboard, or by clicking on an occurrence with yourB mouse, you can choose the occurrence you want to see. Then typeC CTRL/G (the keyboard equivalent of the GOTO SOURCE command), andC LSE will bring the source file into a buffer and position you at the occurrence you chose.E To obtain help on the following topics, request help as indicated.C o For help on query language, see the Basic_Query_Concepts help topic.A o For help on libraries, see the Building_An_SCA_Library help topic.3 BASIC_Attributes_Table= The following table lists the SCA symbol classes and their# corresponding meanings in BASIC.? SCA Symbol Classes and Equivalent BASIC Language Terminology, SCA Term BASIC Term Explanation< Argument Parameter Subprogram formal parameter Component, Record Field component Constant, Constant Literal Exception N/AA File File A file used during a compilationE Function, Program or For example, PROGRAM, SUB, FUNCTION,- Procedure, subprogram DEF, PICTURE Program, Routine, Subroutine Generic N/A. Keyword Keyword A PDF keywordA Label Label  A line number or statement label Macro N/A Module, N/A Package0 Placeholder Placeholder LSE placeholder4 Psect Psect MAP or COMMON block( Tag Tag PDF tag Task N/AD Type Type For example, word, double, decimal,- and so forth Unbound N/A Variable VariableA The following table lists the SCA occurrence classes and their# corresponding meanings in BASIC.C SCA Occurrence Classes and Equivalent BASIC Language Terminology, SCA Term BASIC Term Explanation> Primary Declaration For variables, where they areD declared with, for example, DECLARED or MAP statements. For subprograms,A where they are defined, that is,E where the body of the subprogram is.A Associated Declaration EXTERNAL declarations or DECLARE4 FUNCTION statements? Declaration Declaration Either a PRIMARY or ASSOCIATED, declaration Read, Fetch Read Write, Store WriteA Address, Address Actual parameter to LOC function Pointer reference Call Call@ Command_line Command line A file specified on the commandA line; For example, BASIC foo.bas? Include Include A file specified in a %INCLUDE* directive Precompiled N/A3 Reference Reference Any nondeclaration@ Explicit Explicit Any symbol declared by the userD Implicit Implicit Any symbol declared by the compilerA when it sees the first referenceB Visible Visible A symbol whose name is visible in+ the sourceD Hidden Hidden A symbol not visible in the source;E for example, function return values,6 implicit declarations@ Compilation_ For example, a PROGRAM, SUB, or) unit FUNCTION= The following table lists the SCA domain classes and their# corresponding meanings in BASIC.? SCA Domain Classes and Equivalent BASIC Language Terminology, SCA Term BASIC Term Explanation Inheritable N/A> Global Available across modules; for: example, through EXTERNAL- declarations= Predefined Predefined Defined by the language; for@ example, DECIMAL, PI, CHR$, and) so forthD Multi_module Predefined, global, and inheritableD Module_ Visible only within one module; for3 specific example, variables3 Using_BLISSC This section contains some basic examples that show what SCA canC do to help you with your programs. The examples have very littleA explanation. For a more detailed explanation of the underlyingC concepts, see the Basic_Query_Concepts help topic. The remainderA of this sec tion is written in terms that are specific to BLISS programs.E If you want to follow along and try the examples, you will need toB have an SCA library available. If you do not know how to createC an SCA library, read the Building_An_SCA_Library help topic. TheD examples use generic variable names (such as i). You will have toB substitute variable names that actually exist in your code when trying the examples.C The first example is the easiest query. It lets you find all theB items in your SCA library named i, and shows you all the places, where they appear (all occurrences of i): FIND i> You can search for any name in this manner, including using. wildcard characters (for example, FIND i*).C Now suppose you are looking for an occurrence, and you know that@ it occurs in a particular file. The following query finds allE occurrences of items that are named i, but will then limit them to9 those that happen to occur in the file named PROG.B32." FIND i AND FILE_SPEC="PROG.B32"B Another typical question you might ask is, "Find all the placesE where this item is assigned to (or read from, called, declared andC so forth)." The next example finds all occurrences of items thatD are named i, but then limits them to only those occurrences where i is assigned a value: FIND i AND OCCURRENCE=WRITEE (SCA understands many occurrence classes other then WRITE. See theE help subtopics under Getting_St arted for tables containing all the= SCA attributes and their corresponding meanings in BLISS.)@ Often, you only want to know where (in what file or module) aC particular routine is, so that you can go to it and edit it. YouD can use the first query (where i will be the name of the routine)@ and then look through the output. The output will include allD occurrences of the routine, one of which will be its declaration,E which you can then select. Or, you can ask SCA to limit t he search) for you by typing the following query: FIND i AND OCCURRENCE=PRIMARY> In SCA terms, a primary declaration is the most significant> declaration of an item. For a BLISS routine, this means the> place where the routine is actually implemented. This is inE contrast to FORWARD or EXTERNAL declarations, which are associated declarations.B Another problem you might have is that there are many differentC items in your system having a given name. Some may be var iables;B others may be routines, literals, macros, and so forth. Suppose? you want to find only the routines named i. Again, the queryB FIND i will give you what you wanted, but it will also give you< much more. It is preferable to issue the following query:" FIND i AND SYMBOL_CLASS=ROUTINED The last four examples have all selected information based on twoD attributes. The last example selected information based on a nameD attribute (in this case, i) and a symbol_class at tribute (in thisA case, ROUTINE). Note how the attributes are combined using theE boolean operator AND. In general, you can select items out of yourD library based on any combination of attributes, using AND as well3 as the other logical operators OR, XOR, and NOT.> The next example shows another primary feature of SCA - theE ability to display relationships between items. This example showsB the most common use of this feature. It finds the complete callE tree (that is, all routines called directly and indirectly) of the routine named i. FIND CALLED_BY (i, DEPTH=ALL)? If you want to limit the depth of the call tree, replace the' keyword ALL by any positive integer.E The final part of this section describes how to go directly to theD source code once you have issued a query. After issuing the queryC FIND i, for example, you can have an LSE query buffer containing+ something that looks like the following: I variable.  BLISS_MODULE\60 LOCAL declaration, BLISS_MODULE\75 write reference+ BLISS_MODULE\79 read reference+ BLISS_MODULE\122 read reference, BLISS_MODULE\144 write reference+ BLISS_MODULE\146 read reference, BLISS_MODULE\149 write reference+ BLISS_MODULE\149 read reference+ BLISS_MODULE\150 read reference+ BLISS_MODULE\166 read referenceE The first two lines of this display will be highlighted. The firstC line represents the item you looked for (i), and the rest of theC lines represent the different places in the code where this itemE occurred (that is, the occurrences of i). By using the up and downE arrows on your keyboard, or by clicking on an occurrence with yourC mouse, you can choose the occurrence you want to see. Then, typeB CTRL/G (the keyboard equivalent of the GOTO SOURCE command) andC LSE will bring the source file into a buffer and position you at the occurrence you chose.E To obtain help on the following topics, request help as indicated.C o For help on query language, see the Basic_Query_Concepts help topic.A o For help on libraries, see the Building_An_SCA_Library help topic.3 BLISS_Attributes_Table= The following table lists the SCA symbol classes and their# corresponding meanings in BLISS.? SCA Symbol Classes and Equivalent BLISS Language Terminology, SCA Term BLISS Term Explanation9 Argument Parameter Routine formal parameterB Component, Field Subpart of a BLOCK or BLOCKVECTOR* Field structure* Constant, Literal A literal Literal Exception N/A? File file A file used during compilation* Function, routine A routine Procedure, Program, Routine, Subroutine Generic N/A0 Keyword  Keyword PDF keyword tag3 Label Label A label identifier( Macro Macro A macro3 Module, Module A compilation unit Package3 Placeholder Placeholder An LSE placeholder( Psect Psect A psect* Tag Tag A PDF tag Task N/A6 Type Type For example, fieldsetB Unbound Unbound A name the compiler does not knowD  the purpose of. This is common when1 macros are used.3 Variable Variable A program variableA The following table lists the SCA occurrence classes and their# corresponding meanings in BLISS.C SCA Occurrence Classes and Equivalent BLISS Language Terminology, SCA Term BLISS Term Explanation? Primary Declaration The declaration containing the6   actual implementationB Associated Declaration A FORWARD or EXTERNAL declaration? Declaration Declaration Either a PRIMARY or ASSOCIATED, declaration Read, Fetch Fetch Write, Store Store Address, Address Pointer Call call@ Command_line Input file A file specified on the commandA specification line; for example, BLISS foo.b32A Include Require   A file specified in a REQUIRE or3 %REQUIRE statement> Precompiled Library A file specified in a LIBRARY* statement3 Reference Reference Any nondeclaration@ Explicit Explicit Any symbol declared by the userE Implicit Implicit Any symbol declared by the compiler;= for example, a loop variableB Visible Visible A s ymbol whose name is visible in+ the sourceC Hidden Hidden A symbol whose name is not visible< in the source; for example,9 contained inside a macro) Compilation_ Module A module unit declaration= The following table lists the SCA domain classes and their# corresponding meanings in BLISS.? SCA Domain Classes and Equivalent BLISS L anguage Terminology, SCA Term BLISS Term ExplanationE Inheritable Inheritable A symbol declared in a library file,3 and used elsewhere Global GLOBALC Predefined Defined by For example, CH$FILL, BLOCKVECTOR,- the language and so forthC Multi_module GLOBAL, Predefined, or Inheritable Module_ LOCAL or OWN specific 3 Using_CA This section contai ns some basic examples that illustrate whatD SCA can do to help you with your programs. The examples have veryE little explanation. If you want a more detailed explanation of theD underlying concepts, see the Basic_Query_Concepts help topic. TheE remainder of this section is written in terms that are specific to C programs.E If you want to follow along and try the examples, you will need toB have an SCA library available. If you do not know how to createC an SCA library,  read the Building_An_SCA_Library help topic. TheD examples use generic variable names (such as i). You will have toB substitute variable names that actually exist in your code when trying the examples.C The first example is the easiest query: It lets you find all theB items in your SCA library named i, and shows you all the places, where they appear (all occurrences of i). FIND i> You can search for any name in this manner, including using. wildcard characters ( for example, FIND i*).@ Now let's say you are looking for an occurrence, and you knowE that it occurs in a particular file. The following query finds allD occurrences of items that are named i but will then limit them to: those which happen to occur in the file named 'PROG.C'. FIND i AND FILE_SPEC="PROG.C"A Another typical question one might ask is "Find all the placesE where this item is assigned to (or read from, called, declared,andC so forth)." The next example fi nds all occurrences of items thatD are named i, but then limits them to only those occurrences where i is assigned a value. FIND i AND OCCURRENCE=WRITEE (SCA understands many occurrence classes other then WRITE. See theE help subtopics under Getting_Started for tables containing all the9 SCA attributes and their corresponding meanings in C.)@ Often, you only want to know where (in what file or module) a@ particular function is, so that you can go to it and edit it. B You could use the first query (where i would be the name of the? function) and then look through the output. The output wouldA include all occurrences of the function, one of which would beE its definition, which you could then select. Or, you could ask SCA= to limit the search for you by typing the following query: FIND i AND OCCURRENCE=PRIMARY> In SCA terms, a primary declaration is the most significantD declaration of an item. For a C function, this means the func tion> definition. This is in contrast to a C function declarationA (for example, extern i()), which in SCA terms is an associated declaration.B Another problem you might have is that there are many differentC items in your system having a given name. Some may be variables;E others may be functions, #define constants, macros, and so forth.B Suppose you want to find only the functions named i. Again, theA query FIND i would give you what you wanted, but it would alsoE  give you much more. It is preferable to issue the following query:# FIND i AND SYMBOL_CLASS=FUNCTIOND The last four examples have all selected information based on twoD attributes. The last example selected information based on a nameD attribute (in this case, i) and a symbol class attribute (in thisB case, FUNCTION). Note how the attributes are combined using theE boolean operator AND. In general, you can select items out of yourD library based on any combination of attri butes, using AND as well2 as the other logical operators OR, XOR and NOT.> The next example shows another primary feature of SCA - the> ability to display relationships between items. The exampleA given here shows the most common use of this feature. It findsE the complete call tree (that is, all functions called directly and( indirectly), of the function named i. FIND CALLED_BY (i, DEPTH=ALL)C If you want to limit the depth of the call tree, you can replace+ the k eyword ALL by any positive integer.E The final part of this section describes how to go directly to theD source code once you have issued a query. After issuing the queryC FIND i, for example, you can have an LSE query buffer containing+ something that looks like the following: i variable8 C_MODULE\60 variable definition declaration( C_MODULE\75 write reference' C_MODULE\79 read reference. C_MODULE\95 read, write reference ' C_MODULE\122 read reference( C_MODULE\144 write reference' C_MODULE\146 read reference( C_MODULE\149 write reference' C_MODULE\149 read reference' C_MODULE\150 read reference' C_MODULE\166 read referenceE The first two lines of this display will be highlighted. The firstC line represents the item you looked for (i), and the rest of theC lines represent the different places in the code where this ite mE occurred (that is, the occurrences of i). By using the up and downE arrows on your keyboard, or by clicking on an occurrence with yourA mouse, you can choose the occurrence you want to see. Then allE you have to do is type CTRL/G (the keyboard equivalent of the GOTOD SOURCE command), and LSE will bring the source file into a buffer0 and position you at the occurrence you chose.E To obtain help on the following topics, request help as indicated.C o For help on query language, see the Basic_Query_Concepts help topic.A o For help on libraries, see the Building_An_SCA_Library help topic.3 C_Attributes_Table= The following table lists the SCA symbol classes and their corresponding meanings in C.; SCA Symbol Classes and Equivalent C Language Terminology, SCA Term C Term ExplanationA Argument Formal The variable named in a function+ Parameter definitionA  Component, Member A member of a structure or union FieldE Constant, Constant A defined value that does not change Literal Exception N/A? File File A file used during compilation@ Function, Function Any function ( such as 'main' ) Procedure, Program, Routine, Subroutine Generic N/A0 Keyword Keyword PDF keyword tag3 Label Label A label identifier; Macro Macro A Macro created by #defineA Module, Module Each .c source file represents a' Package module3 Placeholder Placeholder An LSE placeholder Psect N/A* Tag Tag A PDF tag Task N/AC Type Type int, float, struct {...}, typedef,- and so forth Unbound N/A1 Variable  Variable Program variableA The following table lists the SCA occurrence classes and their corresponding meanings in C.? SCA Occurrence Classes and Equivalent C Language Terminology, SCA Term C Term ExplanationB Primary Declaration Most significant declaration; forD or definition example, a variable declaration, or6 a function definitionA Associated Declaration Other declarations; for example,@ function declarations or EXTERN- declarationsC Declaration Definition or Any declaration, either primary or+ Declaration associated@ Read, Fetch Read The act of retrieving an RvalueC Write, Store Write Changing the contents of an Lvalue: Address, Address The use of the & operator Pointer0 Call Call  A function call@ Command_line Command_line A file specified on the command< line, for example, CC foo.c? Include Include A file specified in a #include7 preprocessor directive Precompiled N/A3 Reference Reference Any nondeclaration= Explicit Explicit An entity that is explicitly) declared= Implicit Implicit An en tity that is implicitly> declared by the compiler; forA example, a function with no type> is implicitly declared as INT= Visible Visible Occurrence appears in source> Hidden Hidden Occurrence does not appear in@ source; for example, it appearsA only in the expansion of a macro) Compilation_   Module A module unit= The following table lists the SCA domain classes and their corresponding meanings in C.; SCA Domain Classes and Equivalent C Language Terminology, SCA Term C Term Explanation Inheritable N/A@ Global Globally For example, extern, globaldef,7 visible globalref, globalvalue> Predefined Defined by For example, int, float, char the langua !ge6 Multi_module Predefined and globalD Module_ Local to one For example, static, auto, register specific module 3 Using_C++A This section contains some basic examples that illustrate whatD SCA can do to help you with your programs. The examples have veryE little explanation. If you want a more detailed explanation of theD underlying concepts, see the Basic_Query_Concepts help topic. TheE remainder of this section is written in terms t "hat are specific to C++ programs.E If you want to follow along and try the examples, you will need toC have an SCA library available. The examples use generic variableG names (such as 'i'). You will have to substitute variable names that/ exist in your code when trying the examples.C The first example is the easiest query: It lets you find all theB items in your SCA library named i, and shows you all the places, where they appear (all occurrences of i). FIND i #> You can search for any name in this manner, including using. wildcard characters (for example, FIND i*).@ Now let's say you are looking for an occurrence, and you knowE that it occurs in a particular file. The following query finds allD occurrences of items that are named i but will then limit them to< those which happen to occur in the file named 'PROG.CXX'." FIND i AND FILE_SPEC="PROG.CXX"A Another typical question one might ask is "Find all the placesE where t $his item is assigned to (or read from, called, declared,andC so forth)." The next example finds all occurrences of items thatD are named i, but then limits them to only those occurrences where i is assigned a value. FIND i AND OCCURRENCE=WRITEE (SCA understands many occurrence classes other then WRITE. See theE help subtopics under Getting_Started for tables containing all the; SCA attributes and their corresponding meanings in C++.)@ Often, you only want to know %where (in what file or module) a@ particular function is, so that you can go to it and edit it.B You could use the first query (where i would be the name of the? function) and then look through the output. The output wouldA include all occurrences of the function, one of which would beE its definition, which you could then select. Or, you could ask SCA= to limit the search for you by typing the following query: FIND i AND OCCURRENCE=PRIMARY> In SCA terms, a primary dec &laration is the most significantF declaration of an item. For a C++ function, this means the functionE definition. This is in contrast to a C++ function declaration (forI example, extern i()), which in SCA terms is an associated declaration.B Another problem you might have is that there are many differentC items in your system having a given name. Some may be variables;E others may be functions, #define constants, macros, and so forth.B Suppose you want to find only the fun 'ctions named i. Again, theA query FIND i would give you what you wanted, but it would alsoE give you much more. It is preferable to issue the following query:# FIND i AND SYMBOL_CLASS=FUNCTIOND The last four examples have all selected information based on twoD attributes. The last example selected information based on a nameD attribute (in this case, i) and a symbol class attribute (in thisB case, FUNCTION). Note how the attributes are combined using theE boolean operato (r AND. In general, you can select items out of yourD library based on any combination of attributes, using AND as well2 as the other logical operators OR, XOR and NOT.> The next example shows another primary feature of SCA - the> ability to display relationships between items. The exampleA given here shows the most common use of this feature. It findsE the complete call tree (that is, all functions called directly and( indirectly), of the function named i. FIND CALLED_B)Y (i, DEPTH=ALL)C If you want to limit the depth of the call tree, you can replace+ the keyword ALL by any positive integer.E To obtain help on the following topics, request help as indicated.C o For help on query language, see the Basic_Query_Concepts help topic.A o For help on libraries, see the Building_An_SCA_Library help topic.3 C++_Attributes_Table= The following table lists the SCA symbol classes and their! corresponding meanings in C++.*= SCA Symbol Classes and Equivalent C++ Language Terminology. SCA Term C++ Term ExplanationE Argument Formal Formal arguement such as a routine4 Parameter or macro argumentI Class Class Any C++ class object defined by class,5 structure or unionD Component, Class, structure A component of a class, structure+ Field or union member or union +? Constant, Constant Named compile-time constants LiteralC Exception Exception A program exception specified byF the catch, throw and try statementsA File File A file used during compilationH Function, Function Callable routines defined by function- Procedure, statements Program, Routine, SubroutineE Generic Template Gener,ic object defined by template* objects2 Keyword Keyword PDF keyword tag7 Label Function Label User-specified label= Macro Macro A Macro created by #defineE Module, Module Any logical program unit typicallyE Package each .cxx source file represents a) module5 Placeholder Placeholder An LSE placeholder- Psect N/A, Tag Tag A PDF tag Task N/AE Type Type int, float, struct {...}, typedef,/ and so forth Unbound N/A3 Variable Variable Program variableA The following table lists the SCA occurrence classes and their! corresponding meanings in C++.A SCA Occurrence Classes and Equivalent C++ Language Terminology. SCA Term .C++ Term ExplanationB Primary Declaration Most significant declaration; forD or definition example, a variable declaration, or6 a function definitionA Associated Declaration Other declarations; for example,@ function declarations or EXTERN- declarationsC Declaration Definition or Any declaration, either primary or+ De/claration associated@ Read, Fetch Read The act of retrieving an RvalueC Write, Store Write Changing the contents of an Lvalue: Address, Address The use of the & operator Pointer0 Call Call A function call@ Command_line Command_line A file specified on the command= line, for example, Cxx foo.c? Include Include A file specified in a #include7 0 preprocessor directive Precompiled N/A: Base Base Any base class of a class6 Friend Friend Any friend of a class6 Member Member Any member of a class3 Reference Reference Any nondeclaration= Explicit Explicit An entity that is explicitly) declared= Implicit Implicit An entity that is implicitly> 1 declared by the compiler; forA example, a function with no type> is implicitly declared as INT= Visible Visible Occurrence appears in source> Hidden Hidden Occurrence does not appear in@ source; for example, it appearsA only in the expansion of a macro) Compilation_ Module A module unit3 Private 2 Private Any private object5 Protected Protected Any protected object2 Public Public Any public object3 Virtual Virtual Any virtual object= The following table lists the SCA domain classes and their! corresponding meanings in C++.= SCA Domain Classes and Equivalent C++ Language Terminology. SCA Term C++ Term Explanation Inheritable N/A@ Global Globally For examp3le, extern, globaldef,7 visible globalref, globalvalue> Predefined Defined by For example, int, float, char the language6 Multi_module Predefined and globalD Module_ Local to one For example, static, auto, register specific module3 Using_COBOLA This section contains some basic examples that illustrate whatD SCA can do to help you with your programs. The examples have veryE little ex 4planation. If you want a more detailed explanation of theD underlying concepts, see the Basic_Query_Concepts help topic. TheE remainder of this section is written in terms that are specific to Cobol programs.E If you want to follow along and try the examples, you will need toB have an SCA library available. If you do not know how to createC an SCA library, read the Building_An_SCA_Library help topic. TheD examples use generic variable names (such as i). You will have toB 5 substitute variable names that actually exist in your code when trying the examples.C The first example is the easiest query: It lets you find all theB items in your SCA library named i, and shows you all the places, where they appear (all occurrences of i). FIND i> You can search for any name in this manner, including using. wildcard characters (for example, FIND i*).@ Now let's say you are looking for an occurrence, and you knowE that it occurs in a particula 6r file. The following query finds allD occurrences of items that are named i but will then limit them to< those which happen to occur in the file named 'PROG.COB'." FIND i AND FILE_SPEC="PROG.COB"A Another typical question one might ask is "Find all the placesB where this item is assigned to (or read from, called, declared,B and so forth)." The next example finds all occurrences of itemsC that are named i, but then limits them to only those occurrences where i is assign 7ed a value. FIND i AND OCCURRENCE=WRITEE (SCA understands many occurrence classes other then WRITE. See theE help subtopics under Getting_Started for tables containing all the= SCA attributes and their corresponding meanings in COBOL.)B Often, you only want to know where (in what file ) a particularD procedure is, so that you can go to it and edit it. You could useB the first query (where i would be the program-id) and then lookB through the output. The output would 8include all occurrences ofE the program, one of which would be its definition, which you couldD then select. Or, you could ask SCA to limit the search for you by typing the following query: FIND i AND OCCURRENCE=PRIMARY> In SCA terms, a primary declaration is the most significantD declaration of an item. For a Cobol program, this is the program-B id. This is in contrast to an associated declaration. Actually,B in Cobol, associated declarations do not have much meaning. T 9heB compiler creates implicit associated declarations for a program the first time it is called.B Another problem you might have is that there are many differentC items in your system having a given name. Some may be variables;@ others may be programs, paragraph names, files, and so forth.A Suppose you want to find only the programs named i. Again, theA query FIND i would give you what you wanted, but it would alsoE give you much more. It is preferable to issue the follo :wing query:" FIND i AND SYMBOL_CLASS=PROGRAMD The last four examples have all selected information based on twoD attributes. The last example selected information based on a nameD attribute (in this case, i) and a symbol class attribute (in thisA case, PROGRAM). Note how the attributes are combined using theE boolean operator AND. In general, you can select items out of yourD library based on any combination of attributes, using AND as well2 as the other logical operator;s OR, XOR and NOT.> The next example shows another primary feature of SCA - the> ability to display relationships between items. The exampleA given here shows the most common use of this feature. It findsD the complete call tree (that is, all programs called directly and' indirectly), of the program named i. FIND CALLED_BY (I, DEPTH=ALL)C If you want to limit the depth of the call tree, you can replace+ the keyword ALL by any positive integer.E The final part of < this section describes how to go directly to theD source code once you have issued a query. After issuing the queryC FIND i, for example, you can have an LSE query buffer containing+ something that looks like the following: I variable- COBOL_MODULE\60 data declaration, COBOL_MODULE\75 write reference+ COBOL_MODULE\79 read reference+ COBOL_MODULE\122 read reference, COBOL_MODULE\144 write reference+ COBOL_M =ODULE\146 read reference+ COBOL_MODULE\149 read reference+ COBOL_MODULE\166 read referenceE The first two lines of this display will be highlighted. The firstC line represents the item you looked for (I), and the rest of theC lines represent the different places in the code where this itemE occurred (that is, the occurrences of I). By using the up and downE arrows on your keyboard, or by clicking on an occurrence with yourA mouse, you can choose t>he occurrence you want to see. Then allE you have to do is type CTRL/G (the keyboard equivalent of the GOTOD SOURCE command), and LSE will bring the source file into a buffer0 and position you at the occurrence you chose.E To obtain help on the following topics, request help as indicated.C o For help on query language, see the Basic_Query_Concepts help topic.A o For help on libraries, see the Building_An_SCA_Library help topic.3 COBOL_Attributes_Table?= The following table lists the SCA symbol classes and their# corresponding meanings in COBOL.? SCA Symbol Classes and Equivalent COBOL Language Terminology, SCA Term COBOL Term Explanation Argument Program argument Component, Group item FieldB Constant, A character string whose value is@ Literal specified by the ordered set ofE characters it con@tains, or a reserveD word that is a figurative constant;= for example, "1.234E7", ZERO Exception N/AC File File A file used during the compilation* Function, Program A program Procedure, Program, Routine, Subroutine Generic N/A. Keyword Keyword A PDF keyword Label Paragraph- name or A section-name Macro N/A Module, N/A Package3 Placeholder Placeholder An LSE placeholder Psect PSECT* Tag Tag A PDF tag Task N/A Type DatatypeC Unbound Symbols in conditional compilation& lines Variable Data itemA The following table lists the SCA occurrence classes and their# correspondingB meanings in COBOL.C SCA Occurrence Classes and Equivalent COBOL Language Terminology, SCA Term COBOL Term Explanation? Primary Declaration Data declarations, program ids@ Associated Implicit declarations of calledA programs the first time they are% seen< Declaration Declaration Both primary and associated- declarations RCead, Fetch FETCH Write, Store STORE Address, N/A Pointer Call CALL@ Command_line A file specified on the commandA line, for example, COBOL foo.cob Include COPY Precompiled N/A3 Reference Reference Any nondeclaration@ Explicit A variable declared by the userD Implicit A variable automatically defined by- D the compiler+ Visible Not hiddenA Hidden Hidden occurrences may be due toA default conditions (for example,D PIC 9(4) is given the DISPLAY TYPE)A or within complex statement (forB example, COMPUTE and hidden write- references). Compilation_ SCPE unit separately compiled unit= The following table lists the SCA domain classes and their# corresponding meanings in COBOL.? SCA Domain Classes and Equivalent COBOL Language Terminology, SCA Term COBOL Term Explanation Inheritable N/A Global EXTERNAL? Predefined PREDEFINED For example, special registers6 Multi_module Global and predefined1 Module_ N Fot multi-module specific3 Using_FORTRANA This section contains some basic examples that illustrate whatD SCA can do to help you with your programs. The examples have veryE little explanation. If you want a more detailed explanation of theD underlying concepts, see the Basic_Query_Concepts help topic. TheE remainder of this section is written in terms that are specific to FORTRAN programs.E If you want to follow along and try the examples, you will need toB hav Ge an SCA library available. If you do not know how to createC an SCA library, read the Building_An_SCA_Library help topic. TheD examples use generic variable names (such as i). You will have toB substitute variable names that actually exist in your code when trying the examples.C The first example is the easiest query: It lets you find all theB items in your SCA library named i, and shows you all the places, where they appear (all occurrences of i). FIND i% chara Hcters (for example, FIND i*).@ Now let's say you are looking for an occurrence, and you knowE that it occurs in a particular file. The following query finds allD occurrences of items that are named i but will then limit them to< those which happen to occur in the file named 'PROG.FOR'." FIND i AND FILE_SPEC="PROG.FOR"A Another typical question one might ask is "Find all the placesB where this item is assigned to (or read from, called, declared,B and so forth)." The nex It example finds all occurrences of itemsC that are named i, but then limits them to only those occurrences where i is assigned a value. FIND i AND OCCURRENCE=WRITEE (SCA understands many occurrence classes other then WRITE. See theE help subtopics under Getting_Started for tables containing all the? SCA attributes and their corresponding meanings in FORTRAN.)@ Often, you only want to know where (in what file or module) aB particular subroutine is, so that you can g Jo to it and edit it.B You could use the first query (where i would be the name of theA subroutine) and then look through the output. The output wouldC include all occurrences of the subroutine, one of which would beE its definition, which you could then select. Or, you could ask SCA= to limit the search for you by typing the following query: FIND i AND OCCURRENCE=PRIMARY> In SCA terms, a primary declaration is the most significantB declaration of an item. For a FORTRAN K subroutine, this is where? the actual SUBROUTINE statement is. This is in contrast to aD FORTRAN EXTERNAL declaration, which in SCA terms is an associatedE declaration. The FORTRAN compiler also creates implicit associated- declarations for any undeclared functions.B Another problem you might have is that there are many differentC items in your system having a given name. Some may be variables;@ others may be subroutines, PARAMETER constants, and so forth.D Suppose you w Lant to find only the subroutines named i. Again, theA query FIND i would give you what you wanted, but it would alsoE give you much more. It is preferable to issue the following query:% FIND i AND SYMBOL_CLASS=SUBROUTINED The last four examples have all selected information based on twoD attributes. The last example selected information based on a nameD attribute (in this case, i) and a symbol class attribute (in thisD case, SUBROUTINE). Note how the attributes are combined M using theE boolean operator AND. In general, you can select items out of yourD library based on any combination of attributes, using AND as well2 as the other logical operators OR, XOR and NOT.> The next example shows another primary feature of SCA - the> ability to display relationships between items. The exampleA given here shows the most common use of this feature. It findsC the complete call tree (that is, all subroutines called directly. and indirectly), of the subroNutine named i. FIND CALLED_BY (I, DEPTH=ALL)C If you want to limit the depth of the call tree, you can replace+ the keyword ALL by any positive integer.E The final part of this section describes how to go directly to theD source code once you have issued a query. After issuing the queryC FIND i, for example, you can have an LSE query buffer containing+ something that looks like the following: I variable3 FORTRAN_MODULE\60 variable declaration. O FORTRAN_MODULE\75 write reference- FORTRAN_MODULE\79 read reference0 FORTRAN_MODULE\95 address reference- FORTRAN_MODULE\122 read reference. FORTRAN_MODULE\144 write reference- FORTRAN_MODULE\146 read reference. FORTRAN_MODULE\149 write reference- FORTRAN_MODULE\149 read reference0 FORTRAN_MODULE\150 address reference- FORTRAN_MODULE\166 read referenceE The first two linesP of this display will be highlighted. The firstC line represents the item you looked for (I), and the rest of theC lines represent the different places in the code where this itemE occurred (that is, the occurrences of I). By using the up and downE arrows on your keyboard, or by clicking on an occurrence with yourA mouse, you can choose the occurrence you want to see. Then allE you have to do is type CTRL/G (the keyboard equivalent of the GOTOD SOURCE command), and LSE willQ bring the source file into a buffer0 and position you at the occurrence you chose.E To obtain help on the following topics, request help as indicated.C o For help on query language, see the Basic_Query_Concepts help topic.A o For help on libraries, see the Building_An_SCA_Library help topic.3 FORTRAN_Attributes_Table= The following table lists the SCA symbol classes and their% corresponding meanings in FORTRAN.A SCA Symbol Classes and EquivalentR FORTRAN Language Terminology, SCA Term FORTRAN Term ExplanationA Argument Dummy The variable named in a function, argument declaration Component, record Field component Constant, PARAMETER Literal Exception N/A? File File A file used during compilation@ Function, SUBROUTINE or A SUBROUTINE, FUNCTION, or main( Procedure, FUNCTION program S Program, Routine, Subroutine Generic N/A. Keyword Keyword A PDF keyword2 Label Label A statement label Macro N/A Module, BLOCK DATA, Package SUBROUTINE3 Placeholder Placeholder An LSE placeholder Psect COMMON block* Tag tag A PDF tag Task N/AD Type Type For example, INTEGER, REAL, COMPLEX- T and so forth Unbound N/A Variable VariableA The following table lists the SCA occurrence classes and their% corresponding meanings in FORTRAN.E SCA Occurrence Classes and Equivalent FORTRAN Language Terminology, SCA Term FORTRAN Term Explanation? Primary Declaration The declaration containing the6 actual implementation8 Associated Declaration An EXTERNUAL declarationC Declaration Declaration Any declaration, either primary or+ associated Read, Fetch Read Write, Store Write7 Address, Address %LOC, actual arguments Pointer> Call Call For example, a CALL statement@ Command_line Command line A file specified on the commandC line; for example, FORTRAN foo.for? Include INCLUDE A file Vspecified in an INCLUDE* statement Precompiled N/A3 Reference Reference Any nondeclaration@ Explicit Explicit Any symbol declared by the userD Implicit Implicit Any symbol declared by the compilerA when it sees the first referenceB Visible Visible A symbol whose name is visible in+ the sourceC Hidden Hidden W A symbol whose name is not visible. in the sourceA Compilation_ Program unit A SUBROUTINE, FUNCTION, PROGRAM,9 unit BLOCK DATE, and so forth= The following table lists the SCA domain classes and their% corresponding meanings in FORTRAN.A SCA Domain Classes and Equivalent FORTRAN Language Terminology, SCA Term FORTRAN Term Explanation Inheritable N/AB Global X A SUBROUTINE, FUNCTION, or COMMON& blockE Predefined Defined by For example, INTEGER, REAL*4, and so& the language forth Multi_module GLOBAL, predefined, and inheritable@ Module_ Only known within a SUBROUTINE,7 specific FUNCTION, and so forth3 Using_PascalA This section contains some basic examples Y that illustrate whatD SCA can do to help you with your programs. The examples have veryE little explanation. If you want a more detailed explanation of theD underlying concepts, see the Basic_Query_Concepts help topic. TheE remainder of this section is written in terms that are specific to Pascal programs.E If you want to follow along and try the examples, you will need toB have an SCA library available. The SCA$EXAMPLE library provided@ with SCA is based on Pascal, so Z you could use it. If you want@ to use your own library, but do not know how to create an SCAE library, read the Building_An_SCA_Library help topic. The examplesE in this section use variables from the SCA$EXAMPLE library. If youC use your own library, you will have to substitute variable names= that actually exist in your code when trying the examples.C The first example is the easiest query: It lets you find all theB items in your SCA library named i, and shows you all th[e places, where they appear (all occurrences of i). FIND i> You can search for any name in this manner, including using. wildcard characters (for example, FIND i*).@ Now let's say you are looking for an occurrence, and you knowE that it occurs in a particular file. The following query finds allD occurrences of items that are named i but will then limit them toB those which happen to occur in the file named 'BUILDTABLE.PAS'.( FIND i AND FILE_SPEC="BUILDTABLE.PAS" \A Another typical question one might ask is "Find all the placesB where this item is assigned to (or read from, called, declared,B and so forth)." The next example finds all occurrences of itemsC that are named c, but then limits them to only those occurrences where c is assigned a value. FIND c AND OCCURRENCE=WRITEE (SCA understands many occurrence classes other then WRITE. See theE help subtopics under Getting_Started for tables containing all the> SCA attribute ]s and their corresponding meanings in Pascal.)@ Often, you only want to know where (in what file or module) aE particular procedure is, so that you can go to it and edit it. YouD could use a query similar to the first (where i would be replacedB by the name of the procedure) and then look through the output.A The output would include all occurrences of the procedure, oneB of which would be its declaration, which you could then select.B Or, you could ask SCA to limit the search ^ for you by typing the following query:* FIND build_table AND OCCURRENCE=PRIMARY> In SCA terms, a primary declaration is the most significantA declaration of an item. For a Pascal procedure, this means the@ place where the procedure is actually implemented. This is inE contrast to FORWARD or EXTERNAL declarations, which are associated declarations.B Another problem you might have is that there are many differentC items in your system having a given name. Some may _be variables;D others may be functions, constants, labels, and so forth. SupposeC you want to find only the procedures named 'build_table'. Again,A the query FIND build_table would give you what you wanted, butB it would also give you much more. It is preferable to issue the following query:. FIND build_table AND SYMBOL_CLASS=PROCEDURE@ The last four examples have all selected information based onC two attributes. The last example selected information based on aB n `ame attribute (in this case, 'build_table') and a symbol class? attribute (in this case, PROCEDURE). Note how the attributes? are combined using the boolean operator AND. In general, you@ can select items out of your library based on any combinationB of attributes, using AND as well as the other logical operators OR, XOR and NOT.> The next example shows another primary feature of SCA - the> ability to display relationships between items. The exampleA given here shows the amost common use of this feature. It findsB the complete call tree (that is, all procedures called directly9 and indirectly), of the procedure named 'build_table'.* FIND CALLED_BY (build_table, DEPTH=ALL)C If you want to limit the depth of the call tree, you can replace+ the keyword ALL by any positive integer.E The final part of this section describes how to go directly to theD source code once you have issued a query. After issuing the queryC FIND c, for example, yo bu can have an LSE query buffer containing+ something that looks like the following: C variable8 EXPAND_STRING\60 VAR (variable) declaration- EXPAND_STRING\75 write reference, EXPAND_STRING\79 read reference, EXPAND_STRING\95 read reference, EXPAND_STRING\122 read reference- EXPAND_STRING\144 write reference, EXPAND_STRING\146 read reference- EXPAND_STRING\149 write reference, E cXPAND_STRING\149 read reference, EXPAND_STRING\150 read reference, EXPAND_STRING\166 read referenceE The first two lines of this display will be highlighted. The firstC line represents the item you looked for (c), and the rest of theC lines represent the different places in the code where this itemE occurred (that is, the occurrences of c). By using the up and downE arrows on your keyboard, or by clicking on an occurrence with yourA mouse, you can chdoose the occurrence you want to see. Then allE you have to do is type CTRL/G (the keyboard equivalent of the GOTOD SOURCE command), and LSE will bring the source file into a buffer0 and position you at the occurrence you chose.E To obtain help on the following topics, request help as indicated.C o For help on query language, see the Basic_Query_Concepts help topic.A o For help on libraries, see the Building_An_SCA_Library help topic.3 Pascal_Attributese_Table= The following table lists the SCA symbol classes and their$ corresponding meanings in Pascal.@ SCA Symbol Classes and Equivalent Pascal Language Terminology, SCA Term Pascal Term Explanation Argument Formal parameterD Component, Component, Components of array types, VARYING,: Field String STRING; fields of recordsA Constant, Constant CONSTants, predefined constants,: Literal f enumerated type constants Exception N/A? File File A file used during compilation Function, Function, Procedure, procedure Program, Routine, Subroutine Generic N/A. Keyword Keyword A PDF keyword< Label Label Label declarations and uses Macro N/A Module, Program, Package module3 Placeholder Placeholder An LSE plgaceholder< Psect Psect PSECT and COMMON attributes* Tag Tag A PDF tag Task N/A= Type Type For example, pointer, array,; enumerated, subrange types Unbound N/A Variable VariableA The following table lists the SCA occurrence classes and their$ corresponding meanings in Pascal.D SCA Occurrence Classes and Equivalent Pascal Language Therminology, SCA Term Pascal Term Explanation< Primary Declaration For example, PROCEDURE XYZ;- Associated FORWARD and For example,9 EXTERNAL PROCEDURE XYZ; EXTERNAL; declarations< Declaration Declaration Both primary and associated- declarations Read, Fetch Read Write, Store Write Address, Address Pointer Call Call@ C iommand_line Command line A file specified on the commandB line, for example, PASCAL foo.pas? Include Include A file specified in an INCLUDE* statement? Precompiled Environment A file specified in an INHERIT' clause3 Reference Reference Any nondeclarationD Explicit Pascal has no implicit occurrences.8 j Everything is explicit. Implicit N/A6 Visible Appears in the sourceC Hidden Does not appear in the source, for) example,? VAR I : INTEGER VALUE 10 has a8 hidden write reference. Compilation_ Module, unit Program= The following table lists the SCA domain classes and their$ corresponding meanikngs in Pascal.@ SCA Domain Classes and Equivalent Pascal Language Terminology, SCA Term Pascal Term ExplanationA Inheritable Inherited or Items in an environment file andD inheritable items inherited from an environment% file? Global GLOBAL Items declared with the GLOBAL* attributeD Predefined Predeclared For example, INTEGER, TRUE, WRITELN@ Multil_module Inheritable, Global, PredefinedC Module_ Items local to a compilation unit,? specific and not in an environment file3 EPascal_Attributes_Table= The following table lists the SCA symbol classes and their% corresponding meanings in EPascal.A SCA Symbol Classes and Equivalent EPascal Language Terminology, SCA Term EPascal Term Explanation Argument Formal parameterD Componemnt, Component, Components of array types, VARYING,: Field String STRING; fields of recordsA Constant, Constant CONSTants, predefined constants,: Literal enumerated type constants> Exception INTERRUPT_SERVICE Interrupt Service routine? File File A file used during compilation Function, Function, Procedure, procedure Routine, Subroutine Generic N/An Keyword N/A< Label Label Label declarations and uses Macro N/A Module, Program, Package module Placeholder N/A Program PROGRAM< Psect Psect PSECT and COMMON attributes Tag N/A Task PROCESS_BLOCK= Type Type For example, pointer, array, enumerated, subrange types Unbound Flexible type Variable o VariableA The following table lists the SCA occurrence classes and their% corresponding meanings in EPascal.E SCA Occurrence Classes and Equivalent EPascal Language Terminology, SCA Term EPascal Term Explanation< Primary Declaration For example, PROCEDURE XYZ;- Associated FORWARD and For example,+ EXTERNAL PROCEDURE XYZ; EXTERNAL; declarations< Declaration Declaration Both primary and associated declarationps Read, Fetch Read Write, Store Write Address, Address Pointer Call Call@ Command_line Command line A file specified on the command' line, for example, EPASCAL foo.pas? Include %Include A file specified in a %INCLUDE statement? Precompiled Include A file specified in an INCLUDE statement3 Reference Reference Any nondeclarationE Explicit EPascal hasq no implicit occurrences. Everything is explicit. Implicit N/A6 Visible Appears in the sourceC Hidden Does not appear in the source, for example,# VAR I : INTEGER VALUE 10 has a hidden write reference. Compilation_ Module, unit Program= The following table lists the SCA domain classes and their% corresponding meanings in EPascal.A SCA Domain Classes and Equivalentr EPascal Language Terminology, SCA Term EPascal Term Explanation= Inheritable INCLUDEd Items in a precompiled file.? Global GLOBAL Items declared with the GLOBAL attributeD Predefined Predeclared For example, INTEGER, TRUE, WRITELN@ Multi_module Inheritable, Global, PredefinedC Module_ Items local to a compilation unit,? specific and not in a precompiled file. s 3 Using_SCANA This section contains some basic examples that illustrate whatD SCA can do to help you with your programs. The examples have veryE little explanation. If you want a more detailed explanation of theD underlying concepts, see the Basic_Query_Concepts help topic. TheE remainder of this section is written in terms that are specific to SCAN programs.E If you want to follow along and try the examples, you will need toB have an SCA t library available. If you do not know how to createC an SCA library, read the Building_An_SCA_Library help topic. TheD examples use generic variable names (such as i). You will have toB substitute variable names that actually exist in your code when trying the examples.C The first example is the easiest query: It lets you find all theB items in your SCA library named i, and shows you all the places, where they appear (all occurrences of i). FIND i> You can searc uh for any name in this manner, including using. wildcard characters (for example, FIND i*).@ Now let's say you are looking for an occurrence, and you knowE that it occurs in a particular file. The following query finds allD occurrences of items that are named i but will then limit them to< those which happen to occur in the file named 'PROG.SCN'." FIND i AND FILE_SPEC="PROG.SCN"A Another typical question one might ask is "Find all the placesB where this item is assigned v to (or read from, called, declared,B and so forth)." The next example finds all occurrences of itemsC that are named i, but then limits them to only those occurrences where i is assigned a value. FIND i AND OCCURRENCE=WRITEE (SCA understands many occurrence classes other then WRITE. See theE help subtopics under Getting_Started for tables containing all the< SCA attributes and their corresponding meanings in SCAN.)@ Often, you only want to know where (in what file wor module) aA particular procedure is, so that you can go to it and edit it.B You could use the first query (where i would be the name of the@ procedure) and then look through the output. The output wouldB include all occurrences of the procedure, one of which would beB its declaration, which you could then select. Or, you could askA SCA to limit the search for you by typing the following query: FIND i AND OCCURRENCE=PRIMARY> In SCA terms, a primary declaration is the mo xst significant? declaration of an item. For a SCAN procedure, this means theB place where the procedure is actually implemented, that is, theD PROCEDURE declaration. This is in contrast to FORWARD or EXTERNAL2 declarations, which are associated declarationsB Another problem you might have is that there are many differentC items in your system having a given name. Some may be variables;E others may be procedures, constants, labels, and so forth. SupposeA you want to find on yly the procedures named i. Again, the queryD FIND i would give you what you wanted, but it would also give you< much more. It is preferable to issue the following query:$ FIND i AND SYMBOL_CLASS=PROCEDURED The last four examples have all selected information based on twoD attributes. The last example selected information based on a nameD attribute (in this case, i) and a symbol class attribute (in thisC case, PROCEDURE). Note how the attributes are combined using theE boo zlean operator AND. In general, you can select items out of yourD library based on any combination of attributes, using AND as well2 as the other logical operators OR, XOR and NOT.> The next example shows another primary feature of SCA - the> ability to display relationships between items. The exampleA given here shows the most common use of this feature. It findsB the complete call tree (that is, all procedures called directly- and indirectly), of the procedure named i. { FIND CALLED_BY (i, DEPTH=ALL)C If you want to limit the depth of the call tree, you can replace+ the keyword ALL by any positive integer.E The final part of this section describes how to go directly to theD source code once you have issued a query. After issuing the queryC FIND i, for example, you can have an LSE query buffer containing+ something that looks like the following: I variable0 SCAN_MODULE\60 variable declaration+ SCAN_MODULE\75 | write reference* SCAN_MODULE\79 read reference* SCAN_MODULE\122 read reference+ SCAN_MODULE\144 write reference* SCAN_MODULE\146 read reference+ SCAN_MODULE\149 write reference* SCAN_MODULE\149 read reference* SCAN_MODULE\150 read reference* SCAN_MODULE\166 read referenceE The first two lines of this display will be highlighted. The firstC line represents the item you looked for (i), and the }rest of theC lines represent the different places in the code where this itemE occurred (that is, the occurrences of i). By using the up and downE arrows on your keyboard, or by clicking on an occurrence with yourA mouse, you can choose the occurrence you want to see. Then allE you have to do is type CTRL/G (the keyboard equivalent of the GOTOD SOURCE command), and LSE will bring the source file into a buffer0 and position you at the occurrence you chose.E To obtain hel~p on the following topics, request help as indicated.C o For help on query language, see the Basic_Query_Concepts help topic.A o For help on libraries, see the Building_An_SCA_Library help topic.3 SCAN_Attributes_Table= The following table lists the SCA symbol classes and their" corresponding meanings in SCAN.> SCA Symbol Classes and Equivalent SCAN Language Terminology, SCA Term SCAN Term Explanation= Argument Formal A routine or function formal* parameter parameter? Component, Leaf node A leaf node of a TREE variable Field6 Constant, Constant A CONSTANT definition Literal Exception N/A? File File A file used during compilation, Function, Procedure A Procedure Procedure, Program, Routine, Subroutine Generic N/A Keyword N/A2 Label Label  A statement label Macro N/A) Module, Module A module Package Placeholder N/A- Psect Psect A psect name Tag N/A Task N/A Type Type Unbound N/A Variable VariableA The following table lists the SCA occurrence classes and their" corresponding meanings in SCAN.B SCA Occurrence Classes and Equivalent SCAN Language Terminology, SCA Term SCAN Term Explanation> Primary Declaration Either a DECLARE or PROCEDURE, declaration= Associated Declaration Either a FORWARD or EXTERNAL, declaration= Declaration Declaration Either primary or associated; Read, Fetch Reference The value of a variable is+ retrieved.@ Write, Store Assignment A variable is assigned a value. Address, Indirect Pointer reference Call Call@ Command_line Command line A file specified on the commandA line; for example, SCAN foo.scn.A Include Include A file included with the INCLUDE* statement Precompiled N/A3 Reference Reference Any nondeclarationC Explicit Explicit A variable or procedure explicitlyC  declared with DECLARE or PROCEDURE* statementD Implicit Implicit A variable declared by the compilerC on first reference, for example, a1 picture variable Visible N/A Hidden N/A Compilation_ Module unit= The following table lists the SCA domain classes and their" corresponding meanings in SCAN.> SCA Domain Classes and Equivalent SCAN Language Terminology, SCA Term SCAN Term Explanation Inheritable N/AA Global Global Declaration has GLOBAL attribute Predefined Predefined Multi_module Global or predefined4 Module_ Local to one module specific 2 Glossary3 analysis_data_file@ A file produced by a compiler which contains information that? describes the source code to SCA. It may contain one or more analysis data modules.3 analysis_data_module> A module containing all the information used by SCA for one compilation unit. 3 appearanceC One of the attributes of an occurrence. It tells you whether theD name of the occurrence is visible or hidden. You can instruct SCAE to show only occurrences with a particular appearance by using theB "occurrence=" attribute selection. For example, you can ask for8 hidden occurrences by specifying "occ urrence=hidden."3 associated_declarationA Any declaration which is not a primary declaration. Typically,E associated declarations provide information needed by the compiler to refer to an object.3 attribute_selectionC A way of limiting a result of a query to those occurrences which> match certain characteristics. You can select the followingC attributes: NAME, SYMBOL_CLASS, OCCURRENCE, DOMAIN, or FILE_SPECD attributes. In the query language, you use phrases like n ame=foo,C symbol=argument, occurrence=declaration, domain=module_specific,E and file="foo.c" to specify which attributes you want. You combine0 these phrases with AND, OR and NOT operators.!3 attribute_selection_expressionC A query question which combines one or more attribute selectionsB (such as name=foo, symbol=routine) using AND, OR, NOT, and XOR. Some examples are:7 name=foo and symbol=routine and occurrence=primary4 name=foo_module and occurrence=compilation_unit 3 call_graphD Shows what procedures and functions are called from a subroutine,. and all subsequent calls in the call graph. 3 CALLED_BY+ See the SCA_Topics CALLED_BY help topic. 3 CALLING) See the SCA_Topics CALLING help topic.3 compilation_line_number@ A line number generated by the compiler which starts at 1 for@ the first file used during the compile and goes up by one forD each line read. If there is an include file, the compilation lineC numbe r is increased by one for each line in the include file. ByA default, the line numbers in the query display produced by the9 FIND or INSPECT commands are compilation line numbers.3 compilation_unit? A compilation unit is the smallest piece of source code that? can be separately compiled. For example, in FORTRAN, this is> a subroutine or function; in C, this is a single file. Some@ languages allow you to compile more than one compilation unitA at once. Even if you compil e more than one unit at a time, SCA& considers the units to be separate.3 consistency_checksB A check that INSPECT makes in which all occurrences of a symbol@ are checked for consistency. For example, you can ensure that= all calls to a routine have the correct number and type of@ arguments. In this type of check, each occurrence is comparedB with a single occurrence selected by INSPECT to be the standardD against which all occurrences are checked. In this type of check,= each particular occurrence is either correct or incorrect.3 CONTAINED_BY. See the SCA_Topics CONTAINED_BY help topic. 3 CONTAINING, See the SCA_Topics CONTAINING help topic.3 declarationB Tells the compiler about an object before the compiler uses it.C This can make the compiler create the object, or it can tell theE compiler about an object that was created elsewhere. A declarationB has a position in the source code with both a start and an end,B and can con tain other declarations or references. A declarationD can be either a primary declaration or an associated declaration.3 declaration_class< Tells you what symbol class a declaration is (subroutine,B function, variable). For example, both procedures and functionsB (in Pascal terms) belong to the routine symbol class, but theirA declaration classes are different. The declaration class tells= the user whether a declaration is a primary declaration or? an associated declaration . SCA uses the declaration class toD decide what to display as the occurrence class in the result of aB FIND command. The user can find the declaration class using the callable interface.3 diagnostic_error_messagesB The error messages that INSPECT produces. The query result fromD an INSPECT command is like that of a FIND command, but with error( messages attached to each occurrence.3 display_lineB A line in the display resulting from a FIND or INSPECT command.C SCA  numbers these lines if you use /DISPLAY=NUMBER. This feature; is most useful when you are saving the output in a file. 3 explicit See expression. 3 expressionC One of the attributes of an occurrence. The expression attributeC tells you whether the occurrence is one that you the user placed? in the source code, or is one which the compiler created for> the user. An occurrence can be either explicit or implicit.B Explicit occurrences are those placed by the user in the sourceB code; implicit occurrences are those created by the compiler onE behalf of the user. For example, in the following FORTRAN program,C there are three references to i which are explicit. There is oneE implicit declaration of i which is created by the FORTRAN compiler) when it sees the first reference to i. program test i = 0 i = i + 1 end 3 handleC A data type used by the SCA callable interface. If you are using7 the callable interface, see the on-line SCA guide to6 platform specific information for more information. 3 hidden* See both appearance and hidden modules.3 hidden_modulesE A module in one of the libraries in the current library list whichE is also present in a library which is earlier in the library list.C The module in the earlier library is visible. The same module inD any later library is a hidden module, hidden by the first module. 3 implicit See expression. 3 indicatedA  Uses the current cursor position for the query, when used withC a FIND or GOTO DECLARATION. If the cursor is in a query display,A SCA uses whatever occurrence on which it is positioned. If theB cursor is in a buffer, SCA uses the name on which the cursor isC positioned and the file the cursor is in to guide the query. SCAD relaxes the search criteria, if necessary, (for example, allowing? different versions of the source file) to find the indicated occurrence.3 intersection? The operation performed by the AND operator, which indicates@ that SCA will accept any occurrence that matches both X and Y as follows: FIND X AND Y 3 library8 Generic term usually referring to a physical library.3 library_listE A list of one or more physical libraries which compose the virtual? library. The order of the physical libraries is important. AA module found in one physical library in the library list hidesE the same module in other physical libraries that come later in the library list.D For example, suppose you have three libraries. Library 1 contains> module A. Library 2 contains modules A, B, and C. Library 3> contains modules C and D. SCA uses module A from Library 1,? modules B and C from library 2, and module D from library 3.3 library_numberC Refers to the position of a single physical library in a libraryC list. This can be used with any command that refers to a library< already in th e library list. For example, the command SETC NOLIBRARY 1 removes the first library from the library list, andE the command LOAD/LIBRARY=2 FOO.ANA loads the file FOO.ANA into the& second library on the library list. 3 moduleA Represents a single compilation unit. You can list the modules? with the SHOW MODULE command. Each module shown represents aB single compilation unit - the smallest piece of source that canC be separately compiled. Even if several of these are compil ed atA once (which is common in languages such as FORTRAN and BASIC),, each compilation unit appears separately.@ In the query language, SYMBOL=MODULE specifies a certain typeA of symbol. This is not the same as a compilation unit. You can@ have modules which are not compilation units, and compilationC units which are not modules. How a module is defined varies from language to language.3 nameA A string of characters used to identify symbols in your sourceE cod e. Legal characters for a name are defined by whatever language@ you use. Each name has zero or more characters. Any characterA may appear in a name. Special characters that appear in a nameC must be quoted using double quotes. You do not need to quote the8 following: $, _, *, %, &, -, alphanumeric characters.3 name_selection_expressionC Selects occurrences with a particular name. For example, you can specify the following: FIND name=xyz= You can use wildcards  in the name expression. Unlike otherA atttributes, you can omit "name=" from the expression and only specify the following: FIND xyz(3 nonstructured_relationship_expressionB A relationship query (such as CONTAINED_BY, CALLED_BY, CALLING)A which requests that structure information be excluded. You canA specify RESULT=NOSTRUCTURE, RESULT=BEGIN, or RESULT=END as oneA of the parameters to the relationship function. If you specify? RESULT=BEGIN or RESULT=END, this is displayed like any query> which does not have a relationship function. If you specifyB RESULT=NOSTRUCTURE, this is displayed like any query which doesE not have a relationship function, but has all the occurrences that2 would be present if the structure were present.3 nonstructured_setE A query result that contains occurrences, but does not contain anyC relationships between occurrences. These are produced by queriesA that do not involve relationship functions, or queries that doA involve relationship functions but specify RESULT=NOSTRUCTURE, RESULT=BEGIN, or RESULT=END. 3 occurrenceA An occurrence is any instance of an entity in your program. An> entity can be any language construct, such as a variable, a@ routine, or a constant. To further clarify this, consider theB following code fragment (not written in a particular language): 1 MODULE myprog; 2 3 VAR i,j; 4 5 ROUTINE foo() 6 BEGIN  7 i = 5; 8 j = i; 9 END; 10 END;C The code contains four entities: myprog, foo, i, j. There is oneA occurrence each of the module myprog, and the routine foo. TheE variable i, however, has three occurrences, and the variable j has two.3 occurrence_checksE A check that INSPECT performs on a single occurrence. For example,E INSPECT can check whether an occurrence is an implicit declarationA of a variable without having to look at  any other occurrences.3 occurrence_classE One of the attributes of an occurrence that tells you what kind ofD occurrence it is. The occurrence class indicates if an occurrenceE is a declaration, a reference, or another class. It also indicatesD what kind of declaration or reference it is. You can instruct SCAB to show you only occurrences with a particular occurrence classB using the OCCURRENCE= attribute selection. For example, you can3 ask for write references using OC CURRENCE=WRITE."3 occurrence_selection_expressionE The expression containing the occurrence class for each occurrence you want to find.3 physical_library? A single directory containing an SCA database. The directory? should not contain anything else. SCA always locks an entire? physical library when it accesses it. When you are reading aC physical library (for example, with a FIND command), other usersD are not allowed to write to the physical library, but other u sersA are allowed to read the physical library. When you are writingD to a physical library (for example, using LOAD), no other user is4 allowed to read or write to the physical library.3 primary_declarationC Any declaration which affects how a particular object, such as a) routine or a variable, is implemented.3 primary_libraryC The first library in the library list. Commands which change the? SCA library, such as LOAD and REORGANIZE, apply to the firstA library , unless you use the /LIBRARY qualifier to instruct SCA to use another library.3 queryE The question you ask SCA together with the information you receiveC from SCA. The question uses the SCA query language with the FINDD or INSPECT commands. The answer is called a query result. You useD the FIND or INSPECT commands to display the query result. You canE also use the query result as part of the question for a subsequent query.3 query_result@ A query result is t he information you get when you evaluate aE query, using the FIND or INSPECT commands. It consists of a set of6 occurrences, and relationships between occurrences. 3 referenceD The use of some object in the source code. For example: X = X + 1C In this example, there are two references to the variable X. OneC (to the left of the =) is a write reference; the other is a readC reference. A reference has a position in the source code, but it1 is a single point and cannot contai n anything.3 relationshipE An association between two different occurrences. For example, theD CALLED_BY relationship in SCA associates a primary declaration ofE a procedure with call references to other procedures and functionsD in that procedure. A relationship has both a source and a target.C A relationship also has a relationship type. Relationships go inB both directions. For example, the CALLED_BY relationship is the' inverse of the CALLING relationship.3 rel ationship_typeC The kind of relationship between two occurrences. For example, aD CALLED_BY relationship between a declaration of a routine FOO andD a reference to a routine BAR shows that routine FOO calls routineE BAR. The relationship types that are valid for SCA are: CALLED_BY,; CALLING, CONTAINED_BY, CONTAINING, TYPED_BY, and TYPING.3 set/ The occurrences that result from each query.3 static_analysis@ The analysis of a software system performed by looking at the A source code. This is in contrast to dynamic analysis, which is0 analysis of the software while it is running.E SCA has some commands which do static analysis. These commands areC the INSPECT command, which does consistency checking, the REPORTB command, that can generate reports about modules, imported and F exported objects, and so forth, and some uses of the FIND command, + to generate call graphs and type graphs.%3 structured_relationship_expression@ A query tha t uses a relationship function (such as CONTAINED_A BY, CALLED_BY, or TYPED) which asks for structure information.D Structure information shows the relationships between occurrencesC found as well as the occurrences found. Structure information is provided by default.3 structured_set> A query result which has both occurrences and relationshipsC between occurrences. These are produced by queries which involve relationship functions. 3 symbolB Any object in a pro gram. For example, a FUNCTION, a VARIABLE, aE CONSTANT, or any of the entities with which a programmer typically deals.< A symbol has occurrences. For example, the declaration of< a variable is an occurrence, and uses of the variable are@ occurrences. SCA determines which occurrences belong to which= symbols using the rules of the language you are using. For? example, you may have two different variables named INDEX inA separate subroutines. According to the rules of you r language,? these are usually different variables, so they are different symbols for SCA.@ It does not matter whether all occurrences of a symbol are in@ a single compilation unit, or spread over several compilationB units. All the occurrences still belong to the same symbol. ForC example, you may have a subroutine SUB1 in one module, and callsC to that subroutine in several other modules. These all appear as. occurrences of the same symbol, named SUB1.A The progr ammer and SCA should have the same definition of whatE constitutes a unique item. SCA's term for a unique item is symbol.3 symbol_checks@ A check that INSPECT performs on all occurrences of a symbol.? For example, INSPECT can ensure that there are both read andC write references to a variable. In this type of check, no singleD occurrence is either correct or incorrect. If there are problems,/ the problems are with the symbol as a whole.3 SYMBOL_CLASSC An attribute selection that identifies the type of symbol. Tells@ you whether the symbol is a variable, constant, or some other@ class. You can use the FIND command to find only symbols with@ a particular symbol class. For example, you can specify "FINDE symbol=argument." You can abbreviate both "symbol" and "argument".$3 symbol_class_selection_expressionA The expression containing the symbol class for each symbol you want to find. 3 type_graphB A set of occurrences and relationsh ips that describes a complexB data type. For example, a declaration of a record consists of aA record and some record components. Each record component has aC type, which may be another record, a pointer to the same record,D a basic data type such as integer, and so forth. In SCA, the typeC graph connects all these together, with relationships connectingB the record to its components and the components to their types. 3 TYPED_BY* See the SCA_Topics TYPED_BY help topic. 3 TYPING( See the SCA_Topics TYPING help topic.3 unionC The operation performed by the OR operator, which indicates that? SCA will accept any occurrence that matches either X or Y as follows: FIND X OR Y3 virtual_libraryC A library that allows you to split your SCA library into pieces.B Each piece is called a physical library. SCA works the same way@ whether your virtual library has only one physical library or several physical libraries.C Some of  the reasons for using more than one physical library are as follows:@ o Physical libraries can be placed on more than one disk, if0 there is not enough room on a single disk.C o Analysis date files can be loaded into more than one physical8 library at the same time, to make LOAD run faster.D o A small personal physical library can be used to keep track of: your personal changes without affecting other users.< o A separate physical library can be used for each major component in your system.= A single virtual library is a list of one or more physical> libraries. The order is important. A module in one physicalB library hides the same module in physical libraries later on in@ the list. This list of physical libraries is called a library list. 3 visible+ See both appearance and visible modules.3 visible_modulesA Modules that SCA can examine when performing a FIND or INSPECT? command. The current library li st tells you what modules are@ visible. All modules in the first library in the library listB are visible. Modules in the second library which are not in theD first library are visible. Modules in the third library which areE not in the first or second libraries are visible. Any module which is not visible is hidden. 3 wildcards@ Wildcards are used to match more than one name at once. ThereB are two wildcards in SCA: the asterisk (*) and percent (%). ForD example, in the  name expression A*, the wildcard * will match anyB number of characters, so this would match A, AB, ABC, AXYZ, andC so forth. The * wildcard matches any number of characters, and %E wildcard matches just one character. If you do not want SCA to useB * or % as a wildcard, you use an ampersand (&) to quote it. For8 example, to find the single name *, you would use &*.2 Language_Specific_Tables> For information about SCA terms and corresponding language-A specific terminolog y, see the tables under the Getting_Started help topic. 2 Libraries3 Project_LibrariesB There are many ways you can organize the SCA libraries for your? project. Usually, there is one library (or set of libraries)? for the whole project. Each developer has a personal libraryB containing modules that they have changed but have not yet madeA available to the entire project. However, if there is only oneA developer working on the project, it makes more sense to use a  single SCA library.C There are many ways you can organize your project libraries. YouC can have one project SCA library if it is a reasonable size. YouE can use several libraries, one for each subsystem. You may want toC organize your SCA libraries the way your development environment? is organized. For example, have one SCA library for each CMSA library. If your project is divided into different subsystems,3 you may want one SCA library for each subsystem.A For information on creating your own SCA library, see the help! topic Building_An_SCA_Library. Examples of Typical LibrariesD Consider a project with three developers: Paul, Mark, and Joanna.D The project consists of five different subsystems. Each subsystem8 has its own SCA library in the following directories:$ DISK1:[PROJECT.SUBSYSTEM1.SCA]$ DISK1:[PROJECT.SUBSYSTEM2.SCA]$ DISK1:[PROJECT.SUBSYSTEM3.SCA]$ DISK2:[PROJECT.SUBSYSTEM4.SCA]$ DISK2:[PROJECT.SUBSYSTEM5.SCA]E Each of the developers also has a personal SCA library as follows: DISK1:[PAUL.SCA] DISK2:[MARK.SCA] DISK1:[JOANNA.SCA]? Paul uses the following command to set up his SCA libraries:1 LSE Command> SET LIBRARY disk1:[paul.sca], -4 _LSE Command> disk1:[project.subsystem1.sca], -4 _LSE Command> disk1:[project.subsystem2.sca], -4 _LSE Command> disk1:[project.subsystem3.sca], -4 _LSE Command> disk2:[project.subsystem4.sca], - 1 _LSE Command> disk2:[project.subsystem5.sca]E Mark and Joanna use the same command, but the first library in the! list is their own SCA library.< When Paul changes a module in Subsystem 1, he compiles it> and loads it into his personal library in DISK1:[PAUL.SCA].8 For Paul, this hides the old version of the module inC DISK1:[PROJECT.SUBSYSTEM1.SCA], so his SCA library is up to date# and consistent with his changes.C Mark and Joanna do not see Paul's changes i n their SCA libraries@ because they are not using the SCA library (DISK1:[PAUL.SCA])E that Paul updated. They still see the old version of the module in" DISK1:[PROJECT.SUBSYSTEM1.SCA].8 Once Paul has completed his change, the nightly build> updates everything for Subsystem 1, replacing the module inC DISK1:[PROJECT.SUBSYSTEM1.SCA]. Now Mark and Joanna can both see the change.3 Virtual_LibrariesD SCA can use more than one SCA library at the same time when doing? q ueries using the FIND and INSPECT commands. The list of SCAA libraries used for this is called a virtual library. The orderA of SCA libraries in the library list is important. A module inB the first library in the library list will hide the same moduleC in other libraries, further on in the library list. For example,@ suppose PROJECT_LIB has modules A, B, C and library MYLIB has8 modules A, and D. You can set the library as follows:/ LSE Command> SET LIBRARY mylib,project_lib> The modules visible in the virtual library would be A (from? MYLIB), B, and C (both from PROJECT_LIB) and D (from MYLIB).E There are many reasons for using more than one physical library as your virtual library:C o Using more than one library, you can improve LOAD performance@ by loading multiple libraries simultaneously. See the help topic Reducing_LOAD_Time.B o You can use virtual libraries to allow several developers to? maintain a consisten t view of their changes to a project,@ without affecting the other developers, and without having8 to copy the entire SCA library for each developer.= o You can put your SCA libraries on different disks or on; different nodes (using the SCA server). This improvesA performance or takes advantage of the available disk space.D o You use the SET LIBRARY and SET NOLIBRARY commands to maintainC your virtual library list. You can use the /BEFORE and /AFTERA  qualifiers to insert and remove libraries without having to? reenter a library list. You can specify libraries in yourB library list using library numbers. For example, the commandE SET NOLIBRARY 2 removes the second SCA library from the library list. 2 New_UsersF The Source Code Analyzer for OpenVMS (SCA) is an interactive cross-E reference and static analysis tool that works with many languages.B It can help you understand the complexities of a large soft wareE project. Because it allows you to analyze and understand an entire@ system, SCA is extremely useful during the implementation and# maintenance phases of a project.D SCA is included in the DECset Software Engineering Tools Package.D SCA is tightly integrated with the Language-Sensitive Editor for C OpenVMS (LSE). When SCA is used with LSE, you can interactively D edit, compile, debug, navigate, and analyze source code during a  single development session.2 For more information, see the following topics:A o Basic_Query_Concepts - Describes some of the basic concepts underlying SCA queries.A o Getting_Started - Provides subtopics with information about. getting started with specific languages.E o SCA_Tutorial - Provides a sample session that allows you to get+ started after completing the session.B o Building_An_SCA_Library - Describes how to quickly create an SCA library.D o Advanced_Query_Examples - Provides advanced examples using the SCA$EXAMPLE library.3 o Glossary - Provides definitions of SCA terms.E o Command_Categories - Lists the different types of SCA commands.E o Callable_Routines - Provides a complete description of each SCA callable routine.C o Callable_SCA - Provides guidelines for using the SCA callable interface.C o Libraries - Provides subtopics with information about project& libraries and virtual libraries.E o  Reducing_LOAD_Time - Provides guidelines for reducing your LOAD time.> o Quick_Reference_Card - Provides a pointer to the releaseC notes, which contain a quick reference card for the SCA query language.E Under SCA_Topics, there is help information for specific keywords.C These keywords include attributes, relationships, and functions.B For example, you can request help on SCA_Topics SYMBOL_CLASS to4 get information about the SYMBOL_CLASS attribute.2  Reducing_LOAD_TimeA Loading an SCA library is a time-consuming operation. Here are& suggestions for reducing LOAD time: o Virtual I/O Cache facilityC SCA uses a large number of I/Os during LOAD. Disk caching canA greatly reduce the number of I/Os, and improve performance.@ Your system manager can enable disk caching by setting theA VBN_CACHE_S SYSGEN parameter. Use SHOW MEMORY/CACHE to see& whether disk caching is enabled. o Batch loadsC  Loading more than one module at a time is more efficient than> loading modules separately. For example, use LOAD *.ANA. o Multiple libraries@ With large software systems, it is a good idea to use moreA than one SCA library and load them all simultaneously. ThisA can decrease the elapsed LOAD time considerably, especiallyB if the libraries are on separate disks. Using more than oneB CPU also helps, but not as dramatically, because SCA loadingD is mainly I/O intensive. For more information about how to useA multiple libraries, see the help subtopics under Libraries. o Choice of DiskA SCA uses a large number of I/Os during LOAD. Loading an SCA? library on a slow, heavily used, or badly fragmented disk+ causes the load to be less efficient./ o File Fragmentation and File Preallocation? If your SCA library is larger than 20K blocks, you should< consider preallocating the library when yo u create it.C SCA extends the library file by 1000 blocks at a time, so forA large libraries it extends the library many times, and this8 may cause your SCA library to be badly fragmented.D Preallocate an SCA library with CREATE LIBRARY/SIZE=xxx, whereD xxx is the size of the library in disk blocks. Use the size ofE the SCA$EVENT.DAT file in your current SCA library directory as' the value to the /SIZE qualifier.A You can tell how badly your SCA libraries are fragmented by" using the following command:% $ DUMP/HEADER/BLOCK=COUNT=0 -4 _$ DISK:[sca_library_directory]SCA$EVENT.DATA The interesting portion of the output is the Map area. EachD retrieval pointer represents a contiguous section on the disk.E Because SCA extends SCA libraries 1000 blocks at a time, having? a lot of retrieval pointers smaller than this is a strong5 indication that some defragmentation is needed. o Using less disk spaceF Use LOAD/DELETE to delete .ANA files after they are successfullyF loaded. This doesn't reduce LOAD time, but uses less disk space.2 Quick_Reference_CardH The following page contains a reference of the SCA query language.F It is intended to be printed and used as a Quick Reference Card.E ATTRIBUTE SELECTIONS: |RELATIONSHIP FUNCTIONS:2 | 9 Name Class:  |Short form:9 ---------- |-----------R |CALLED_BY(,,)P NAME= |CALLING(,,)2 NAME=(,...) | S |CONTAINED_BY(,,C Symbol Class: | )Q ------------- | CONTAINING(,,A SYMBOL= | )2 SYMBOL=(,...) | N |TYPED_BY(,,)L Symbol Class keywords: |TYPING(,,)2 | 8 Argument, Component, Constant, |Long form:8 Exception, File, Field, Function, |----------P Generic, Keyword, Label, Literal, |(END=,R Macro, Module, Package, Placeholder, | BEGIN=,Q Procedure, Program, Psect, Routine, | DEPTH={ | ALL },Q Subroutine, Tag ,Task, Type, Unbound, | RESULT=,R Variable, Other, All, None | TRACE=)4 | > Occurrence Class: |Result key words:3 ----------------- | Q OCCURRENCE= |Begin, End, [No]Structure, Any_path2 OCCURRENCE=(,...) | > |OTHER FUNCTIONS:8 Occurrence Class keywords: |----------2 | I Declaration, Primary, Associated, |IN (END=,K Reference, Address, Call, | BEGIN=)1 Command_line, Fetch, Include, | I Pointer, Precompiled, Read, Store, |EXPAND ()1 Write, Other, All, None | = |@()1 Domain Class: | Q ------------- |INDICATED() (NOTE: LSE required)1 DOMAIN= | E DOMAIN=(,...) |NOT(). |. Domain Class keywords: |. |. Global, Inheritable, Module_specific, |. Multi_module, Predefined, All, None |. |. File Class: |. ---------- |. FILE= |. FILE=(,...) |.  |. OPERATORS: |. ---------- |. AND, OR, XOR, Pathname (\ or \\) |. |. ATTRIBUTE SELECTION EXPRESSIONS: |. [ ]...|2 SCA_Tutorial5 This tutorial is for character cell LSE and SCA on/ the OpenVMS platform. For a tutorial on the7 DECwindows interface, please see the DECset Guide to Source Code Analyzer.A If you do not have DECwindows, you may want to have a hardcopyE of this tutorial to follow it along interactively. The directions+ for producing a hardcopy are as follows: < 1. Place the contents of SCA_Tutorial in a printable file> by typing the following command on the DCL command line:B $ HELP/OUTPUT=SCA_TUTORIAL.TXT SCA SCA_Topics SCA_TutorialB 2. Print SCA_TUTORIAL.TXT from the DCL command line as follows: $ PR INT SCA_TUTORIAL.TXTC SCA allows you to browse through a complex software system. In aB large multimodule software system, you may not be familiar with@ all of the source code. It may have been written by differentB authors in a number of different programming languages. SCA canA help you browse through the source code and give you importantD information about the program structure. If you are familiar withE the source code, SCA will help you navigate directly to the sourceD  code you want, and give you valuable cross-reference information.D This tutorial guides you through a sample SCA session to show howE SCA can improve your software development productivity as you work$ on an unfamiliar software system.A If you encounter terms that are unfamiliar, see the SCA onlineE glossary for definitions. SCA's terminology for program structuresC is language independent. If you want to see how this terminologyC maps onto the programming language that you use most frequently,@ see the language tables under the Getting_Started help topic.? This tutorial assumes that you use SCA while in LSE. You canB still follow the tutorial if you are using SCA from the commandC line, but you will not be able to use the GOTO DECLARATION, GOTOB SOURCE, EXPAND, or NEXT STEP commands. The way in which resultsD are displayed also differ slightly between standalone SCA and SCA used from within LSE. Invoking SCAE To invoke SCA through LSE, type the following from the DCL command line: $ LSEDIT Typing Commands' Your cursor is now in an LSE buffer.D Press the DO key or COMMAND key (PF1-KP7). This places you in LSE command mode.C You will see the "LSE command>" prompt at the bottom of your LSEC window. This means that you can now enter an SCA command. DuringE this tutorial, when you see SCA commands following an LSE command>? prompt, press the DO key before you try to type the command.  Selecting a Library> SCA gets its information from an SCA library, a database ofC information about your source code. You will be using the sample) SCA library provided in this tutorial.C To use the sample SCA library, type the following in LSE command mode:* LSE command> SET LIBRARY SCA$EXAMPLE:D Later in this tutorial, you will learn how to create your own SCA& library using your own source code.  Looking at ModulesB Because  the components of the system are unfamiliar to you, theE first thing you may want to do is determine which modules compriseB the system loaded into the SCA library. The SHOW MODULE command7 gives you a synopsis of the contents of the library.D To get information about the contents of an SCA library, type the0 following command at the LSE Command> prompt: LSE command> SHOW MODULEA For each module, you will see the module name, the language inB which the source code  is written, and some other information. AA module is a logical unit of source code, as determined by yourD compiler. In FORTRAN, a module may be a PROGRAM or SUBROUTINE. InC C, it may consist of the source code within one file. If you areE interested in how "module" and other SCA concepts map to differentB language specific constructs, see the language tables under the Getting_Started help topic.D Press the Return key when you are finished looking at the list of modules. Creating a QueryB Suppose you are assigned the task of changing the output format@ for this software system. Because you are unfamiliar with theA source code, you do not know where the system produces output.> Using SCA, you can find out by looking for places where the< program uses WRITELN. WRITELN is a built-in Pascal output8 function, similar to PUT_LINE in Ada, or PRINTF in C.E To ask SCA to find all the occurrences of the symbol in the system5 with the name WRITELN, type the following command: LSE command> FIND WRITELN8 LSE/SCA creates the following display in your buffer: WRITELN procedure, COPY_FILE\75 call reference, COPY_FILE\84 call referenceA The first line tells you about the existence of a symbol whoseD name is WRITELN and whose symbol class is procedure. (A procedureE in Pascal is like a subroutine in FORTRAN, or a function in C. See< the language tables under the Getting _Started help topic.A The subsequent indented lines give you information about whereA occurrences of the WRITELN symbol were found. For example, theA first occurrence or use of the WRITELN symbol is in the moduleE COPY_FILE on line 75, and the occurrence class (the way the symbol! was used) is a call reference.  Navigating the Query DisplayC Once you have a list of occurrences of the symbol, you will wantA to look at the source code corresponding to those occur rences.; You will see that the first two lines of the display are< highlighted. This highlighting tells you which symbol andC occurrence are selected. When an occurrence is selected, you canD use the GOTO SOURCE command to see the corresponding source code.C Press CTRL/G or type the GOTO SOURCE command at the LSE command>B prompt. The file COPYFILE.PAS is read into a buffer by LSE, andE your cursor will be positioned on the first occurrence of WRITELN.B You may now be interested in looking at the source code for the next occurrence.A Press CTRL/F or type the NEXT STEP command at the LSE command>A prompt. (Note that there is a corresponding CTRL/B command for PREVIOUS STEP.)E You will see that the second occurrence of WRITELN, on line 84, is highlighted.8 Press CTRL/G again to invoke the GOTO SOURCE command.  Going to a Declaration? Your cursor is again positioned on an occurrence of WRITELN.: Looking at the source code, you see the following line:9 WRITELN (out_file, SUBSTR (out_line, 1, out_index));C You might be interested in finding out where the first argument,& the variable OUT_FILE, is declared.D Press the arrow keys to position your cursor on the word OUT_FILED in the source code. If you are using LSE with DECwindows, you canD also point to the word OUT_FILE by pointing and clicking with the mouse.> Press CTRL/D or type the GOTO DECLARATION/PRIMARY/INDICATED& command at the LSE Command> prompt.A Your cursor will now be placed on the declaration of OUT_FILE.A Using SCA, you can navigate directly to the declaration of any? symbol declared in your system by placing your cursor on the> symbol, and pressing CTRL/D. If you are not positioned on aC symbol, you can also go to the declaration of a symbol by typing the following command:. LSE COMMAND> GOTO DECLARATION symbol-name& Using Wildcards to Find Occurrences D B ecause SCA allows wildcard expressions, it can help you navigateA through the source code, even if you are not quite sure of the# name of the symbols of interest.C Suppose you know of a procedure in the system that you might useB in some new code that you are writing. In order to see how thisD procedure has been used elsewhere, you want to look at the sourceE code for calls to the procedure, but you do not remember its name.D You may only remember that it begins with the letters BUILD. Type the following command: LSE command> FIND build** You will now see the following display: BUILDTABLE.PAS file6 BUILD_TABLE\1 PASCAL command reference BUILD_TABLE procedure BUILD_TABLE moduleA SCA also gives you a message in the message buffer as follows:+ 5 occurrences found (3 symbols, 2 names)C You can see that two names were found: BUILDTABLE.PAS and BUILD_@ TABLE. The BUILDTABLE.PAS symbol has the symbol c lass "file."B Two different BUILD_TABLE symbols were found. One of these is a$ procedure; the other is a module.D You may notice that there are no occurrences displayed for eitherB the BUILD_TABLE procedure or the BUILD_TABLE module. To preventB the display from being too cluttered, SCA/LSE displays only the# occurrences of the first symbol.E Because you are interested in seeing the occurrences of the BUILD_; TABLE procedure, you must expand the display as follows;E  1. Press CTRL/F, or type the NEXT STEP command at the LSE Command>9 prompt, to select the BUILD_TABLE procedure symbol.B 2. Press CTRL/E, or type the EXPAND command at the LSE command>$ prompt, to expand the display.C In the following display, you will see that three occurrences of- the BUILD_TABLE procedure are now visible: BUILDTABLE.PAS file6 BUILD_TABLE\1 PASCAL command reference BUILD_TABLE procedure3 BUILD_TABLE\41 PROCEDURE declarationG TRANSLIT\61 FORWARD or EXTERNAL PROCEDURE declaration, TRANSLIT\171 call reference BUILD_TABLE module= You could now look at the corresponding source code if you= desired. Note that there is a corresponding CTRL/\ key, orC COLLAPSE command, that you can use to hide expanded occurrences.  Attribute Selection@ To avoid finding more occurrences than you want, SCA lets youB select occurrences based on attributes ot her than just the name? of a symbol. In the previous example, you were looking for aD procedure named BUILD_TABLE. However, the results included a file5 and a module, as well as the procedure you wanted.B To get results that include only the BUILD_TABLE procedure with; its corresponding occurrences, type the following query:= LSE command> FIND NAME=BUILD* AND SYMBOL_CLASS=PROCEDURE@ Up to this point, you have selected only occurrences based onB the name of the symbo l. The name of a symbol is only one of its? attributes. In fact, FIND BUILD_TABLE is an abbreviation forB FIND NAME=BUILD_TABLE, where "NAME=" specifies which particular? attribute we are using to select the occurrences found. FINDA BUILD_TABLE without "NAME=" works for the following reason. IfA you don't specify the attribute, SCA assumes you are selectingE occurrences based on a name because this is the most commonly used attribute.B In this new query, you have speci fied that you want to see only? symbols whose name is BUILD_TABLE, and whose symbol class isA PROCEDURE. (Note that the symbol class PROCEDURE is synonymous@ with the classes FUNCTION, SUBROUTINE, ROUTINE, and PROGRAM.)A Symbol classes indicate the type of symbols. Examples of otherB symbol classes that SCA understands are FIELD, CONSTANT, MACRO,E TASK, TYPE, and VARIABLE. For more information and a complete listA of these symbol classes, see the information under the SYMBOL _ CLASS help topic.= In the previous example, you used two selection clauses toD restrict the items found, NAME=BUILD* and SYMBOL_CLASS=PROCEDURE.> Each of these clauses resulted in a set of occurrences. YouE combined the results of the two clauses by using the AND operator,C which resulted in only those occurrences that were found in both sets of results.D The set operators available in SCA are AND, OR, NOT, and XOR. YouE can use any number of set operators to co mbine attribute selectionB clauses (such as SYMBOL_CLASS=PROCEDURE) to specify your query.D In the following display, which resulted from the previous query,B there are two declarations of the BUILD_TABLE procedure and one call reference: BUILD_TABLE procedure3 BUILD_TABLE\41 PROCEDURE declarationG TRANSLIT\61 FORWARD or EXTERNAL PROCEDURE declaration, TRANSLIT\171 call reference? In the previous example, remember that yo u are interested inA seeing only call references to this procedure. You can further@ restrict your query by using the OCCURRENCE= attribute, whichC describes how a particular occurrence of a symbol is used. To do# this, type the query as follows:? LSE Command> FIND BUILD_TABLE AND SYMBOL_CLASS=PROCEDURE -& _LSE Command> AND OCCURRENCE=CALLA This command asks SCA to find the same results as the previous@ query, but to limit the results to those occurrences that are D call references. In the resulting occurrence set, the declaration occurrences no longer appear.@ Because this is a very small example, it seems unnecessary to@ continue refining these queries because you could look at theA source code for only the occurrences you want. However, if theB system were larger, and thousands of occurrences were found forE each query, it would be more important to give as detailed a query/ as possible to avoid extraneous information.@ The  occurrence class attribute describes how an occurrence isA used. Examples of other occurrence classes that are understoodA by SCA are READ, WRITE, POINTER, CALL, DECLARATION , EXPLICIT,@ HIDDEN, and REFERENCE. For a complete list and description ofA these occurrence classes, see the OCCURRENCE_CLASS help topic.B There are two more attributes that you can use to restrict yourD queries. The first attribute, DOMAIN=, allows you to restrict theE occurrences based on the range of  source code in which the symbols> might be used. Possible values for DOMAIN= are INHERITABLE,9 GLOBAL, PREDEFINED, MULTI-MODULE, and MODULE_SPECIFIC.B The second attribute, FILE=, allows you to limit occurrences to> those found within a particular file, such as COPYFILE.PAS.? You could find all the global symbols (those symbols visible@ throughout the program) occurring in the file COPYFILE.PAS by entering the following query:< LSE Command> FIND DOMAIN=GLOBAL AND FILE="COPYFILE.PAS"@ If you do not specify a name, as in the previous example, the default is NAME=*.C In summary, there are five attributes that you can use to select= occurrences: NAME=, SYMBOL_CLASS=, OCCURRENCE=, FILE=, andB DOMAIN=. You can combine these selection clauses using the AND,E OR, XOR, and NOT operators. For more information, request help for each attribute. Relationship FunctionsA Up to this point, you have been navigating through source cod e@ by asking SCA to find occurrences of interesting symbols. SCA? can also help you see the structure of your code. If you areB debugging a routine, such as READ_COMMAND_LINE, you may want toD know which system library routines might be invoked if you calledB READ_COMMAND_LINE. To get this information, type the following:4 LSE command> FIND CALLED_BY (READ_COMMAND_LINE)? In this example, you are invoking the CALLED_BY function andE sending it one argument, the name READ_COMMAND_LINE. The resulting display is as follows:& READ_COMMAND_LINE procedure calls BUILD_TABLE procedure CLI$DCL_PARSE function CLI$GET_VALUE function CLI$PRESENT function EXPAND_STRING function IADDRESS function LENGTH function LIB$GET_FOREIGN function LIB$SIGNAL procedure ODD function OPEN_IN procedure OPEN_OUT procedure SUBSTR function? The query that you just entered resulted in all the routines called by READ_COMMAND_LINE.? However, assume you are interested in finding out only which? system library routines are called by READ_COMMAND_LINE. YouB can also specify that only some of the routines called by READ_A COMMAND_LINE should be a part of the result. That is, SCA lets@ you specify both the caller and the callee in the "called_by"- relationship, as in the following example:; LSE command> FIND CALLED_BY (READ_COMMAND_LINE, LIB$*)+ You will then see the following results:& READ_COMMAND_LINE procedure calls LIB$GET_FOREIGN function LIB$SIGNAL procedure= The first argument to the CALLED_BY function specified the= caller, and the second argument specified the callee. Both? of these arguments can be general query expressions, such as SYMBOL=ROUTINE.C You may notice that there is only one level of depth to the callB trees we have seen. That is, LIB$SIGNAL and LIB$GET_FOREIGN areA called directly by READ_COMMAND_LINE. You may be interested inA looking at a complete call tree from READ_COMMAND_LINE to LIB$: routines, including calls through intervening routines.D To specify the number of levels of the call tree you want to see, type the following command:F LSE command> FIND CALLED_BY (READ_COMMAND_LINE, LIB$*, DEPTH=ALL) The result is as follows:& READ_COMMAND_LINE procedure calls# BUILD_TABLE procedure calls . LIB$SIGNAL procedure+ . SIGNAL_DUPLICATE procedure calls/ . LIB$SIGNAL procedure (See above) LIB$GET_FOREIGN function) LIB$SIGNAL procedure (See above)@ In the previous example, the DEPTH= argument of the CALLED_BYB relationship allowed you to specify the number of levels of the@ call tree. For the DEPTH= argument, you can either specify anC integer value (the default is 1), or you can specify the keyword ALL.C The CALLED_BY relationship is not the only function available inD SCA. As with other relationship functions, the CALLED_BY functionD has an inverse, the CALLING function. To find those routines that4 call READ_COMMAND_LINE, type the following query:= LSE command> FIND CALLING (READ_COMMAND_LINE, DEPTH=ALL) The result is as follows: TRANSLIT procedure calls) READ_COMMAND_LINE procedure calls> If you do not specify the second argument to a relationship@ functio n, it defaults to * (which means anything). This queryA translates to "find anything calling READ_COMMAND_LINE, at anyD depth." You will see that there is only one call to READ_COMMAND_$ LINE from the TRANSLIT procedure.B These relationship displays are like previous query displays in< that you can expand, collapse, and navigate through them.C SCA also has information about two other types of relationships.@ The TYPED_BY and TYPING relationship functions are useful forC f inding information about how things are typed. For example, you can learn the following:F o FIND TYPING in_file - tells you the type of the variable in_fileG o FIND TYPED_BY integer - tells you what things are of type integerE o FIND TYPING (table, depth=all) - tells you what components make' up the aggregate structure table.7 SCA also understands the CONTAINED_BY and CONTAININGE relationships. These functions tell you what symbols are containedD within so mething else. For example, the following query tells youE all the procedures that are within the signal_duplicate procedure:H LSE Command> FIND CONTAINED_BY (SIGNAL_DUPLICATE, SYMBOL=PROCEDURE)A For more information about the relationship functions, see the$ help topic for each relationship.< Because you are debugging READ_COMMAND_LINE, you might beB interested in occurrences of all the symbols contained directlyC or indirectly in READ_COMMAND_LINE. You can get this info rmationB by using the CONTAINED_BY function. However, you can use the INA function instead, which is less general but easier to use. The@ IN function lets you specify the container and the containee,C and traces the relationship through all depths (including nested subroutines, for example).A Type the following query to see all the occurrences of symbols/ used within the READ_COMMAND_LINE procedure:- LSE command> FIND IN (READ_COMMAND_LINE)D The results show that 178 occurrences of symbols were used within# the READ_COMMAND_LINE procedure.  Using Previous QueriesB As you continue to use SCA, you may be interested in looking at@ results from previous queries that you have issued. SCA keepsC track of all your queries, and allows you to move back and forthE between them. To see all your queries, type the following command: LSE command> SHOW QUERY# You will see the following list:7 Name Query express ion Description 2 1 WRITELN (none)2 2 BUILD* (none)9 3 NAME=BUILD* AND SYMBOL_CLASS=PROCEDURE2 (none)M 4 BUILD_TABLE AND SYMBOL_CLASS=PROCEDURE AND OCCURRENCE=CALL2 (none)0 5 CALLED_BY (READ_COMMAND_LINE)2 (none)7 6 CALLED_ BY (READ_COMMAND_LINE, LIB$*)2 (none)A 7 CALLED_BY (READ_COMMAND_LINE, LIB$*,DEPTH=ALL)2 (none)9 8 CALLING (READ_COMMAND_LINE, DEPTH=ALL)2 (none)2 (*) 9 IN (READ_COMMAND_LINE) (none)> You can see that there is an asterisk (*), next to query 9,C which was the last query you entered. This is called the currentD  query. Because query 9 is the current query, you can navigate its: display, and enter GOTO SOURCE commands for that query.C SCA also lets you set the current query with the PREVIOUS QUERY,' NEXT QUERY, and GOTO QUERY commands.B Suppose you want to look at the results of the FIND NAME=BUILD*@ AND SYMBOL_CLASS=PROCEDURE query again. The name of the queryB is 3. To see the results of query 3 in a query buffer, type the following: LSE Command> GOTO QUERY 3D It is  now the current query, and you will be able to navigate it,B and see the source code corresponding to the found occurrences.< You can navigate previously entered queries and use their@ results in new queries. Remember that after you entered queryB 3, NAME=BUILD* AND SYMBOL_CLASS=PROCEDURE, you wanted to refineB that query to see only call occurrences. You then entered a new query as follows:? LSE Command> FIND BUILD_TABLE AND SYMBOL_CLASS=PROCEDURE -& _LSE Command> AND OCCURRENCE=CALL@ You could have entered the new query by typing the following:- LSE Command> FIND @3 AND OCCURRENCE=CALL; The previous command is the same as the following query:? LSE Command> FIND NAME=BUILD* AND SYMBOL_CLASS=PROCEDURE -& _LSE Command> AND OCCURRENCE=CALL Creating Your Own Library? Now that you have seen how to use SCA, you can create an SCAE library with information about your own source code. The followingB example contains th e commands for creating a library at the DCLA level. Remember that any SCA commands can also be entered from within LSE.A In order to create your own SCA library, you must first createB a library directory for it. Using your personal directory, typeA the following command to create a subdirectory for a local SCA library: $ CREATE/DIRECTORY [.LIB1]D Once you have a directory in which to create a library, enter the0 following command to SCA to create a library:! $ SCA CREATE LIBRARY [.LIB1]@ You now have an empty SCA library. To add a module to the SCA4 library, you must first compile your source code.D If you have a Pascal compiler available, you can compile and load6 one of the SCA example files into your new library.E First, copy the example file into your working directory by typing the following command:$ $ COPY SCA$EXAMPLE:TYPES.PAS []C Then, compile it with the /ANALYSIS_DATA qualifier. This createsD  the file TYPES.ANA, which can be loaded into your SCA library. To0 compile this file, use the following command:% $ PASCAL/ANALYSIS_DATA TYPES.PASB If you do not have a Pascal compiler, try adding the /ANALYSIS_@ DATA qualifier when you use any other supported compiler. For example: $ CC/ANALYSIS_DATA myfile.cC Once you have a .ANA file, you can load it into your SCA libraryD either from LSE or standalone SCA. To load the .ANA file and show/ the new module, type the following commands: SCA> LOAD myfile.ANA SCA> SHOW MODULEE You will see that the new module has been loaded into the library,2 and you will now be able to query that library.2 \_(Pathname)C The path name expression allows you to identify specific symbols> based on the path of the expression. This is similar to theB debugger pathname notation. The format of this expression is as follows:: query_expression\query_expression[\query_expression...]> Typically, you use this expression to identify a particularE variable in a routine when you may have declared a variable of theE same name in more than one routine. For example, RETURN_STATUS mayB be a common variable in multiple routines. Some typical queries are as follows:$ 1. FIND MYROUTINE\RETURN_STATUS- 2. FIND MYMODULE\MYROUTINE\RETURN_STATUS* 3. FIND MYMODULE\SYMBOL_CLASS=ROUTINE? The first query returns all occurrences of the RETURN_STATUSB  variable that are declared inside MYROUTINE. The second exampleB returns all occurrences of the RETURN_STATUS variable which are@ declared inside MYROUTINE, where MYROUTINE is declared insideB MYMODULE. The third example returns all occurrences of routines& which are declared inside MYMODULE.B You may also use the pathname when the exact path is not known.D For example, assume that you know the module name and that XYZ isB declared somewhere inside the MYMODULE, but you do not know the8 exact pathname. You can then use the following query: FIND MYMODULE\\XYZA This query locates the XYZ variable that is declared somewhere6 inside MYMODULE and returns all occurrences of XYZ.2 @_(Query_Usage)> A query usage function incorporates the results of previousA queries into query expressions. The function has the following form: @( query_name )A The value of this expression is that of the expression that isA specified as query_name. The default query name is the current query, SCA$CURRENT_QUERY.A You can see an example of its use in the following sequence of queries: FIND X2 FIND @(SCA$CURRENT_QUERY) AND SYMBOL=ROUTINEB The advantage of using this notation is that the results of theD previous query are not reevaluated. Thus the second query will be faster than the query: FIND X AND SYMBOL=ROUTINE 2 CALLED_BY> The CALLED_BY function is a relationship function. It finds?  occurrences that have a CALLED_BY relationship between them.C For example, if routine B is called by routine A, then these twoB occurrences are in a CALLED_BY relationship. In its most common+ form, the function format is as follows:: CALLED_BY( , , DEPTH={ | ALL} )? In this format, and can be any legal query@ expression, and is a positive integer. A typical useE of the function is to find those routines which are called by some" specified routine. For example:( FIND CALLED_BY( xyz, *, DEPTH=ALL )C This query finds the full call tree below XYZ, where XYZ is someD routine in the SCA database. In other words, this query finds allB routines which are either directly or indirectly called by XYZ.E The CALLED_BY function provides the power to return the exact call0 tree you want. The full format is as follows: CALLED_BY( [ END= ],! [ BEGIN= ],)  [ DEPTH={ | ALL} ],( [ RESULT=RESULT_KEYWORD ],* [ TRACE=query_expression ] )D In the previous format, and < caller> is any legal query@ expresion, is a positive integer, RESULT_KEYWORD canA be STRUCTURE, NOSTRUCTURE, ANY_PATH, BEGIN, or END, and QUERY_, EXPRESSION is any legal query expression.@ For a full description of the CALLED_BY relationship, see the! on-line help file SCACOMMANDS. 2 CALLING< The CALLING f unction is a relationship function. It finds> occurrences with the CALLING relationship between them. For= example, if routine A is calling routine B, then these two@ occurrences are in a CALLING relationship. In its most common+ form, the function format is as follows:8 CALLING( , , DEPTH={ | ALL} )? In this format, and can be any legal queryB expression and is a positive integer. A typical use of@ the function is to find those routines which are calling some' specified routine call. For example,& FIND CALLING( abc, *, DEPTH=ALL )C This query finds the full call tree above ABC, where ABC is someE routine in the SCA database. In other words, find all the routines/ that are directly or indirectly calling ABC.C The CALLING function provides the power to return the exact call( tree of interest. The full format is: CALLING ( [ END= ], [ BEGIN= ],(  [ DEPTH={ | ALL} ],' [ RESULT=RESULT_KEYWORD ],) [ TRACE=query_expression ] )C In the previous format, and is any legal queryC expresion, is a positive integer, RESULT_KEYWORD can beB STRUCTURE, ANY_PATH, BEGIN, or END, and QUERY_EXPRESSION is any legal query expression.> For a full description of the CALLING relationship, see the! on-line help file SCACOMMANDS.2 CONTAINED_BYA The CONTAINED_BY function is a relationship function. It findsE occurrences that have a CONTAINED_BY relationship between them. In; its most common form, the function format is as follows:C CONTAINED_BY( , , DEPTH={ | ALL} )E In this format, and can be any legal query2 expression, and is a positive integer.D Some examples will help you understand this function. The diagram* that follows applies to these examples.  A (module)( +-------------------------+( | |( | B (routine) |( | +-------------------+ |( | | | |( | | C (routine) | |( | | +-------------+ | |( | | | | | |( | | | D (variable)| | |( | | | | | |( | | | | | |( | | +-------------+ | |( | | | |( | +-------------------+ |( | |( | E (variable) |( | |( +-------------------------+" Consider the following queries:* 1. FIND CONTAINED_BY( A, *, DEPTH=1 )* 2. FIND CONTAINED_BY( C, *, DEPTH=1 )* 3. FIND CONTAINED_BY( A, *, DEPTH=2 )B The first query returns A (the container), B (a containee),  and@ E (a containee). Similarly, the second query returns C and D.C The third query returns A, B, and C and E. The D variable is NOT: included because it is not reachable at a depth of two.* Now consider the following two queries:, 4. FIND CONTAINED_BY( A, D, DEPTH=ALL )* 5. FIND CONTAINED_BY( A, D, DEPTH=2 )E Query four returns A (the container), B (because it is on the pathE to D), C (becasue it is on the path) and D (which is the containee@ being searched fo r). The fifth query does not return anything> because the D variable cannot be reached at a depth of two.B Where a container begins and ends is determined by the languageC syntax. These boundaries are reported to SCA by the compiler and: used by the CONTAINED_BY function to determine nesting.C The CONTAINED_BY function provides the power to return the exact= nesting structure you want. The full format is as follows:% CONTAINED_BY( [ END= ],' [  BEGIN= ],, [ DEPTH={ | ALL} ],+ [ RESULT=RESULT_KEYWORD ],- [ TRACE=query_expression ] )C In the previous format, and is any legalC query expression, is a positive integer, RESULT_KEYWORDE can be STRUCTURE, NOSTRUCTURE, ANY_PATH, BEGIN, or END, and QUERY_, EXPRESSION is any legal query expression.C For a full description of the CONTAINED_BY relationship, see theN on-line  help file SCACOMMANDS. See also the help topic for the IN function,5 which is similar to the CONTAINED_BY relationship. 2 CONTAINING? The CONTAINING function is a relationship function. It finds@ occurrences that have a CONTAINING relationship between them.> In its most common form, the function format is as follows:A CONTAINING( , , DEPTH={ | ALL} )E In this format, and can be any legal query2 expression, and is a positive integer.B Some examples will help you understand the CONTAINING function.6 The diagram that follows applies to these examples. A (module)( +-------------------------+( | |( | B (routine) |( | +-------------------+ |( | | | |( | | C (routine) | |( | | +-------------+ | |( | | |  | | |( | | | D (variable)| | |( | | | | | |( | | | | | |( | | +-------------+ | |( | | | |( | +-------------------+ |( | |( | E (variable) |( | |( +-------------------------+" Consider the following queries:( 1. FIND CONTAINING( D, *, DEPTH=1 )( 2. FIND CONTAINING( C, *, DEPTH=1 )( 3. FIND CONTAINING( D, *, DEPTH=2 )D The first query returns D (the containee), and C (the container).? Similarly, the second query returns C and B. The third query returns D, C and B.( Now consider the following 2 queries:* 4. FIND CONTAINING( D, A, DEPTH=ALL )( 5. FIND CONTAINING( D, A, DEPTH=2 )@ Query four returns D (the containee), C (because it is on the@ path to A), B (because it is on the path) a nd A (which is the? container being looked for). The fifth query does not return: anything because A cannot be reached at a depth of two.B Where a container begins and ends is determined by the languageC syntax. These boundaries are reported to SCA by the compiler and8 used by the CONTAINING function to determine nesting.A The CONTAINING function provides the power to return the exact= nesting structure you want. The full format is as follows:# CONTAINING( [ END= ],% [ BEGIN= ],* [ DEPTH={ | ALL} ],) [ RESULT=RESULT_KEYWORD ],+ [ TRACE=query_expression ] )C In the previous format, and is any legalC query expression, is a positive integer, RESULT_KEYWORDE can be STRUCTURE, NOSTRUCTURE, ANY_PATH, BEGIN, or END, and QUERY_, EXPRESSION is any legal query expression.A For a full description of the CONTAINING relationship, see the! on-line help file SCACOMMANDS. 2 DOMAIND DOMAIN is an attribute of an occurrence that determines the scopeC of the symbol defined. It is the range of source code in which a* symbol has the potential of being used.A For example, A BLISS OWN declaration creates a symbol that hasB a module-specific symbol domain; it cannot be used outside thatB module. On the other hand, a BLISS GLOBAL declaration creates aD symbol that has a multimodule symbol domain; it has the potential) of being used in more than one module.' The format for DOMAIN is as follows: DOMAIN=(keyword[,keyword...])+ The keyword can be one of the following:@ o INHERITABLE - able to be inherited into other modules (for@ example, through BLISS library, PASCAL environment, or Ada$ compilation system mechanisms)A o GLOBAL - known to multiple modules via linker global symbol definitions? o PREDEFINED - defined by the language (examples: BLISS ap," FORTRAN sin, PASCAL writeln)E o MULTI_MODULE - domain spans more than one module (domain=multi_D module is equivalent to domain=(inheritable,global,predefined)7 o MODULE_SPECIFIC - domain is limited to one module: The previous keywords are SCA terms. For information on> corresponding language-specific terms, request help for theE appropriate language table (for example, FORTRAN_ATTRIBUTES_TABLE)( under the Getting_Started help topic.1 An example using the DOMAIN attribute follows:+ FIND DOMAIN=GLOBAL AND SYMBOL=VARIABLE( This query find all global variables. 2 EXPANDC The EXPAND function determines the symbol to which an occurrenceB belongs and returns the full set of occurrences for the symbol.A For example, the following code fragments, written in a pseudo; language, declare and use the variable i in three files.+ file 1 file 2 file 3+ ------ ------ ------3 GLOBAL i (d) LOCAL i (d) EXTERNAL i (d)7 i := 0 (wr) i := 5 (wr) IF i EQUALS 0 (rr) (d) - declaration (wr) - write reference (rr) - read referenceB The pseudo language defines variables, such that the variable iD in "file 1" and the variable i in "file 3" are the same variable.D The variable i in "file 2", however, is a different variable. SCAD treats these variables in the same manner by saying there are two5 unique symbols which happen to have the same name.? The important point in the previous example is that what theE programmer considers unique items SCA also considers unique items.) In SCA terms, these items are symbols.C Given the previous code fragments, consider the follwoing query:3 FIND SYMBOL_CLASS=VARIABLE AND OCCURRENCE=READD This query returns one occurrence, which is the read reference in) "file 3." Now consider the next query:= FIND EXPAND( symbol_class=variable an d occurrence=read )D This query returns two occurrences of "i" in "file 1" and the twoD occurrences of "i" in "file 3." The EXPAND function uses the readC reference to determine the corresponding symbol and then returnsC all the occurrences for that symbol. In this case the symbol was the global variable "i".E Note that the two occurrences in "file 2" are not returned becauseB they belong to a different symbol. The programmer does not viewE the i in "file 2" to be the  same as the i in "file 1" and "file 3" and SCA reflects that view.D When given more than one occurrence, the EXPAND function performsC this operation iteratively and removes any duplicate occurrences from the result.D In the following example, you use the EXPAND function to find theD declarations of routines defined in the system, but which are not1 used. To do this, specify the following query:9 FIND (SYMBOL=ROUTINE AND OCCURRENCE=PRIMARY) AND NOT4 EXPAND(SYMBOL=ROUTINE AND OCCURRENCE=REFERENCE) 2 FILE_SPECE FILE_SPEC is an attribute selection that specifies the name of theF file. You identify a source file by its OpenVMS file specification.? You should enclose the file specification in quotation marks, because it normally contains a period (.)8 The format for the FILE_SPEC attribute is as follows: FILE_SPEC="filename.filetype"4 An example using the FILE_SPEC attribute follows: FIND FILE_SPEC="MYPROG.FOR";  This query finds all occurrences in the file MYPROG.FOR.2 INC The IN function searches for occurrences inside a container. TheE IN function is a special case of the CONTAINED_BY function. In its7 most common form, the function format is as follows:! IN( , )E In this format, and can be any legal queryE expression. The IN function returns all occurrences that match theD expression as long as those occurrences are somewhere inside the container.> Some examples will help you understand the IN function. The9 following picture applies to the examples that follow. A (module)( +-------------------------+( | |( | B (routine) |( | +-------------------+ |( | | | |( | | C (routine) | |( | | +-------------+ | |(  | | | | | |( | | | D (variable)| | |( | | | | | |( | | | | | |( | | +-------------+ | |( | | | |( | +-------------------+ |( | |( | E (variable) |( | |( +-------------------------+" Consider the following queries: 1. FIND I N( A, *) 2. FIND IN( B, D)D 3. FIND IN( A, SYMBOL_CLASS=ROUTINE and OCCURRENCE=DECLARATION)A The first query returns B (a containee), C (a containee), D (aB containee) and E (a containee). A is not returned because it is the container.E The second query returns only D (the containee). C is not returnedA because it does not match the expression. B is not( returned because it is the container.E The third query returns all routine declarations inside A. In this case, B and C are returned.< The IN function is a convenient way to limit a query to a particular container.4 The full format of the In function is as follows: IN( [END=], [BEGIN=] )E In this format, and can be any legal query expression. 2 INDICATED@ The INDICATED function is available only from within LSE. TheC INDICATED function matches the occurrence on which the cursor isC positione d. The INDICATED function has no parameters. The format is as follows: INDICATED()< An example of using the INDICATED function is as follows: FIND EXPAND( INDICATED() )C This query finds all occurrences of the item on which the cursor is positioned in LSE.2 NAMEB NAME is an attribute of an occurrence that is a string of ASCII= characters which identifies symbols in your source code. A= specific name can be associated with more than one symbol.> ! The language you are using defines the legal characters for? a name. Each name has zero or more characters. Any characterA may appear in a name. Special characters that appear in a nameC must be quoted using double quotes. You do not need to quote the8 following: $, _, *, %, &, -, alphanumeric characters.B You can use wildcards (* and %) in the name expression. You canA override the wildcard characters by using the escape characterA (&). For example, you can find the name c"onsisting of a singleE asterisk using the name expression &*. If you want an ampersand in4 a string, you must use two successive ampersands.3 The format for NAME can be one of the following: name NAME=(name[,name...]) 2 OCCURRENCE= The occurrence class is an attribute of an occurrence thatD identifies the type of occurrence. The occurrence class indicatesA if the occurrence is a declaration, a reference, or one of theE other classes in the list that follows.# If the occurrence class isB a declaration or reference, the occurrence class indicates what* type of declaration or reference it is.? The format for the occurrence class attribute is as follows:$ OCCURRENCE=(keyword[,keyword...])= The occurrence class can be one of the following keywords: Declarations, o PRIMARY - most significant declaration) o ASSOCIATED - associated declaration) o DECLARATION - primary or associated References+ o READ$, FETCH - fetch of a symbol value1 o WRITE, STORE - assignment of a symbol value> o ADDRESS, POINTER - reference to the location of a symbol' o CALL - call to a routine or macro0 o COMMAND_LINE - command line file reference. o INCLUDE - source file include referenece7 o PRECOMPILED - precompiled file include refereneceD o OTHER - any other kind of reference (such as a macro expansion or use of a constant)- o REFERENCE - any of the preceding v%alues* o BASE - Any base class of a C++ class( o FRIEND - Any friend of a C++ class( o MEMBER - Any member of a C++ class= o SPEPARATE - Any Ada package or sub-program unit defined as SEPARATE; o WITH - Any WITH of an Ada package or sub-program unit Other Occurrence Classes$ o EXPLICIT - explicitly declared$ o IMPLICIT - implicitly declared0 o VISIBLE - occurrence appears in the source7 o HIDDEN - occurrence does not appear in the& source: o COMPILATION_UNIT - the declaration that contains all2 occurrences in a particular compilation unit, o LIMITED - Any Ada limited private type< o PRIVATE - Any private C++ objects, or Ada private type* o PROTECTED - Any protected c++ object$ o PUBLIC - Any public C++ object& o VIRTUAL - Any virtual C++ object: The previous keywords are SCA terms. For information on> corresponding language-specific terms, request help for theE appropriate l'anguage table (for example, FORTRAN_ATTRIBUTES_TABLE)( under the Getting_Started help topic.; An example using the occurrence class attribute follows: FIND OCCURRENCE=PRIMARY< This query finds all PRIMARY occurrences of declarations.2 SYMBOL_CLASSE SYMBOL_CLASS is an attribute selection that identifies the type ofE symbol. A symbol can be a variable, constant, or some other class.- The format for SYMBOL_CLASS is as follows:& SYMBOL_CLASS=(keyword[,keywor(d...])9 The SYMBOL_CLASS can be one of the following keywords:E o ARGUMENT - formal argument (such as a routine argument or macro argument)B o CLASS - Any C++ class object construct defined by the union,# structure or class statements- o COMPONENT,FIELD - component of a record: o CONSTANT,LITERAL - named compile-time constant value o EXCEPTION - exception o FILE - file@ o FUNCTION,PROCEDURE, PROGRAM,ROUTINE, SUBROUTINE - callable ) program function o GENERIC - generic unit o KEYWORD - keyword" o LABEL - user-specified label o MACRO - macro@ o MODULE, PACKAGE - collection of logically related elements7 o PLACEHOLDER - marker where program text is needed o PSECT - program section o TAG - comment heading o TASK - task o TYPE - user-defined type o UNBOUND - unbound name! o VARIABLE - program variable' o OTHER - any other class of symbol*: The previous keywords are SCA terms. For information on> corresponding language-specific terms, request help for theE appropriate language table (for example, FORTRAN_ATTRIBUTES_TABLE)( under the Getting_Started help topic.7 An example using the SYMBOL_CLASS attribute follows:$ FIND X AND SYMBOL_CLASS=ROUTINE) This query finds all routines named X. 2 TYPINGD The TYPING function is a relationship function. It finds the type@ of some occurrence. Occurrences + related in this manner have a? TYPING relationship between them. For example, if INTEGER is@ typing variable X, then these two occurrences are in a TYPINGC relationship. In its most common form, the function format is as follows:4 TYPING( , , DEPTH={ | ALL} )< In this format, and can be any legal query@ expression, and is a positive integer. A typical useB of the function is to find the type of a variable. For example: , FIND TYPING( X, *, DEPTH=1)B This query finds the type of X, where X is some variable in the SCA database.D The TYPING function also works on user-defined types. The definedB type can have many levels, in which case the user can specify a depth as follows:2 FIND TYPING( user_defined_type, *, DEPTH=ALL)= This query gives the full type tree for USER_DEFINED_TYPE.B The TYPING function provides the power to return the exact type0 tree you want. The full format -is as follows: TYPING( [ END= ], [ BEGIN= ],& [ DEPTH={ | ALL} ],% [ RESULT=RESULT_KEYWORD ],' [ TRACE=query_expression ] )@ In the previous format, and is any legal queryA expression, is a positive integer, RESULT_KEYWORD canA be STRUCTURE, NOSTRUCTURE, ANY_PATH, BEGIN, or END, and QUERY_, EXPRESSION is any legal query expression.= For a full description of the TYPING relationship, .see the! on-line help file SCACOMMANDS. 2 TYPED_BY= The TYPED_BY function is a relationship function. It finds> occurrences that have a TYPED_BY relationship between them.A For example, if variable X is typed by INTEGER, then these twoA occurrences are in a TYPED_BY relationship. In its most common+ form, the function format is as follows:6 TYPED_BY( , , DEPTH={ | ALL} )< In this format, and can be any legal query@ expressio /n, and is a positive integer. A typical useA of the function is to find what is being typed by INTEGER. For example:( FIND TYPED_BY( INTEGER, *, DEPTH=1)D This query finds everything that is of type INTEGER. The TYPED_BYE function can also tell you the items that are in some way affectedC by a given type. The type can be predefined by language elements8 such as INTEGER, or can be user defined. For example:4 FIND TYPED_BY( user_defined_type, *, DEPTH=ALL)0A This query finds all the items that are directly or indirectly! affected by USER_DEFINED_TYPE.D The TYPED_BY function provides the power to return the exact type0 tree you want. The full format is as follows: TYPED_BY( [ END= ], [ BEGIN= ],( [ DEPTH={ | ALL} ],' [ RESULT=RESULT_KEYWORD ],) [ TRACE=query_expression ] )@ In the previous format, and is any legal queryA expression, is a positive integer, RESULT_KEYWORD canA be STRUCTURE, NOSTRUCTURE, ANY_PATH, BEGIN, or END, and QUERY_, EXPRESSION is any legal query expression.? For a full description of the TYPED_BY relationship, see the! on-line help file SCACOMMANDS.ww&f[Qf DECSETBLD @file-specANALYZEATTACHCONVERTCREATEDELETEEXITEXTRACTFINDGOTOIMPORTINSPECTLOADNEXTPREVIOUS REORGANIZEREPORTSAVESETSHOWSPAWNVERIFY Release_Notes SCA_Topics