| ### VisualAge COBOL Program Understanding

Once you have drilled down into your applications with Application Understanding and identified the components that have date impacts, turn to the Program Understanding (PU) tool of Visual Age COBOL, Enterprise. Use the Year 2000 Analysis Tool to automate locating date impacts in your programs. Start with the description of program variables thought to be year related that you have gathered and the sample seed file provided to create a seed list as input to PU. These can be in several forms, including patterns with wild cards and attributes (PIC X(6), for example). Using this seed list, the Year 2000 Analysis Tool checks your program for occurrences of variables that match the seed specifications (identified by pattern) as well as any other variables impacted by such occurrences (identified by inference).

You may find that this is an iterative process as you filter the results with your knowledge of the program and consider further patterns and names that should be included as seeds. This will narrow the scope of program elements that must be inspected and changed. The goal is to find all the impacts with a minimum of " false positives." We offer a possible Year 2000 Impact scenario a bit later, and a more comprehensive scenario, IBM Year 2000 for COBOL and PL/I, is available with your VisualAge COBOL product information.

To run the analysis tool, first compile your COBOL program with the ADATA option using either COBOL for MVS & VM (or COBOL for OS/390 & VM) or VisualAge COBOL. to have a look at compiling from WorkFrame. Then begin analysis, for program eg0 in this case, by entering the tool command on the command line:

OS/2 | Windows
y2krpt eg0 /rego0.xsd | y2krepor eg0 /rego0.xsd
giving the seed file with the /r switch

Note: If the program contains CICS statements, compile it on the workstation so that the reports reflect the original CICS source code rather than the generated code.

#### Input to the Year 2000 Analysis Tool

The input to the Year 2000 Analysis Tool is the SYSADATA file and the seed file, which controls the processing, and the name of the program to be analyzed.

The input seed file contains comments and tag specifications. The file is in a format similar to the tags found in Hypertext Markup Language (HTML). You can annotate the seed file; the annotations will propagate to impacted fields in the .xrl file (the machine-readable report). to see an image of selecting a seed file from within WorkFrame.

##### Seed file tag summary

<seed> tag: Start of a seed specification that may contain:

- <builtin-year> tag. Specifies builtin functions known to be year-related. Use this when you want to control references due to COBOL language date facilities.
- <name> tag. Specifies the name of a variable to be marked as a seed.
- <ddname> tag. Specifies a file buffer to be marked as a seed. Use this when you want to control references by file use.
- <call> tag. Specifies a call and the arguments to be marked as a seed. Use this when you want to control references by parameter use.
- <cics-file-name> tag. Specifies the name of a CICS file or datamap.
- <cics-file-variable> tag. Specifies a variable that holds the name of a CICS file or datamap.
- <output-options> tag. Specifies whether information is to be reported to the standard report output file (.xrl) or an optional file (.xns).
- A <pattern> tag. Specifies a pattern tested against the text of the variable name. The following seed modifiers are used in conjunction with this tag:
  - <attribute> tag. Checks that the variable matched by the pattern is an elementary data item of a certain type (e.g. numeric or character) and length.
  - <except> tag. Excludes certain text patterns.

For example, use the <builtin-year> tag to generate seeds from the COBOL constructs:

- ACCEPT statements where the FROM clause specifies DATE.
- ACCEPT statements where the FROM clause specifies DAY.
- MOVE WHEN COMPILED statement.
- CURRENT-DATE intrinsic
- DATE-OF-INTEGER intrinsic
- DAY-OF-INTEGER intrinsic
- INTEGER-OF-DATE intrinsic
- INTEGER-OF-DAY intrinsic
- WHEN-COMPILED intrinsic

##### Seed list examples

More examples can be found in the PU product online help.

#### Output from the Year 2000 Analysis Tool

The analysis tool creates a line-by-line detail report file, which can be processed by the supplied program Y2KRPT (or your own report writer) for you to view. From this report you know the location of a date data definition and can easily locate that definition in the source with the COBOL editor. to see the two views together. It can also be used as input to editor macros for fixing the date impacts.

You can also to view the graphical flow graph of the program on OS/2.

You will also get an expanded source file of the program.. When the Year 2000 Analysis Tool has evidence that a program variable is being used both as a year and as a non-year, it will mark the variable accordingly (as having kind <used-as-year-and-non-year>). Use the graphical view and the program expanded source to find all the impacts for a date-related variable. to see how to mark all effected variables (variable INV-DUE was clicked with the right mouse button) and to see the results.

##### Report Tag Summary

The generated report output might contain the following tags:

<annotate> <cics-file-name> <cics-file-variable> <comment> <ddname> <def-pos> <file> | <inference> <name> <pos> <procedure> <program> <reason> <result>

##### Y2KPRT (or Y2KREPOR) command

The Y2KRPT command on OS/2 or Y2KREPOR command on Windows provided with the Year 2000 Analysis Tool generates formatted Year 2000 reports for your program. You can use these reports for further analysis to determine where your program is impacted by 2-digit years.

The Y2KRPT output provides cross-reference information from the report output file and the seed input file.

##### Customizing the output

You can customize the output of the Y2KRPT command by using the output information to populate database tables. Once this information is in the database, it can be used by and passed to other COBOL programs for queries of the data.

##### Report example

#### Year 2000 Impact scenario

One recommended way to use the Year 2000 Analysis Tool is to tailor the input seed file for your installation, then start to make batch runs against many programs:

1. Start with a copy of a sample seed file provided with the Year 2000 Analysis Tool.
2. Make any obvious modifications to the seed file, for example making additions related to such things as local installation naming/coding practices, common file formats, tables, and copy files..
3. Analyze a program using the tailored seed file.
4. Check the resulting report output file for generated seed variables that the feature discovered. Use any knowledge that some discovered seeds are or are not date related to modify the base seed file to add this information.
   Note: You can use the report output file as an input to create various report formats, such as is done by the Y2KRPT program.
5. Repeat the above tailoring until the results are a base seed file appropriate for the local installation/application.
6. Apply the base seed file to all the programs that may need change, perhaps modifying it further by making appropriate changes based on new constructs discovered and not yet accounted for.

You can use parameters in the input seed file to control the starting seeds and the reported results. You can specify the starting seeds, let the tool determine them, or both. Different kinds of change can be processed at the same time. You can annotate changes with the motivation for them. Reported results depend on the change you plan to make and thus what you want to analyze. Information in the report that is related to well-understood changes can be suppressed to focus on specific changes and related impacts. The feature will record a reason that indicates one related cause for the generation of an output seed.

### On VSE

If you don't want to download your source from VSE, turn to Opti-Audit for source-code scanning.

Opti-Audit can be used to scan your COBOL source code to help locate potential date-related COBOL verbs and variables. The output of this scanning, which can include or exclude variables you specify as required, is divided into four reports:

The Suspect Verb Analysis report
  date-suspect COBOL verbs
The Suspect Variable Analysis report
  common variables used as date fields
The Suspect Variable Scan Report
  USAGE of variables identified in the previous reports
The Generic Search Results report
  lines of code matching a supplied table of character strings

©1997 IBM Corporation