Preparing the source files to be scanned

Learn how to prepare the source files before you transfer them to the Wazi Analyze container for scanning and analysis.

By default, you need to prepare all the source files to be scanned in a directory without subdirectories on your local machine. Copy all your source files into a local directory that you mount to a directory on the Wazi Analyze container with the Docker run command.

Prepare the source files to scan under the following constraints:
  • Wazi Analyze requires the file name and file extension of the source files to be in all uppercase. You cannot use lowercase or mixed case for the file name and file extension.
    Note: If your source file names do not meet this requirement, you can complete the following steps to convert all file names to be in uppercase.
    • If your source files are mounted from a directory on your host system, convert source file names to uppercase on the host system.
    • If your source files are copied directly into the default project in the container, you can use the following example commands to convert source file names to uppercase.
      1. Navigate to source directory under the project folder.
        cd /home/wazianalyze/data/project/source
      2. Create a directory called ALL_UPPERCASE.
        mkdir ALL_UPPERCASE
      3. Convert the names of all files in different extensions to uppercase. Choose the appropriate statement to run based on the extension of your source files.
        for i in *.cbl *.CBL; do mv "$i" ALL_UPPERCASE/"$(echo ${i%} | tr [:lower:] [:upper:])"; done
        for i in *.cpy *.CPY; do mv "$i" ALL_UPPERCASE/"$(echo ${i%} | tr [:lower:] [:upper:])"; done
        for i in *.jcl *.JCL; do mv "$i" ALL_UPPERCASE/"$(echo ${i%} | tr [:lower:] [:upper:])"; done 
        for i in *.bms *.BMS; do mv "$i" ALL_UPPERCASE/"$(echo ${i%} | tr [:lower:] [:upper:])"; done
      4. Copy all the converted files from ALL_UPPERCASE directory back to the source folder.
        cp ALL_UPPERCASE/* .
      5. Remove the ALL_UPPERCASE folder and its content.
        rm -r ALL_UPPERCASE
  • Wazi Analyze supports scanning applications of COBOL, PL/I, and Assembler languages. For more information, see the following recommended file extensions to be used for scanning.

Recommended file extensions for preparing source files

You can find the recommended file extensions to be used for scanning the source files in the following list.
Note: If you want to use a different file extension other than the ones on the list, you need to update the settings in the .dat file. For more information, see Understanding the scan options in the configuration file.
Use the corresponding file extension for each source type as described in the following list.
  • COBOL language
    • CBL for all COBOL source files
    • CPY for all COBOL copy books
    • CCO for all CICS COBOL source files
    Note: Using the language-specific CICS file extensions enables the Wazi Analyze scanner to distinguish between non-CICS and CICS programs while scanning.
  • PL/I language
    • PLI for all PL/I source files
    • INC for all include files
    • CPLI for all CICS PL/I source files
    Note: Using the language-specific CICS file extensions enables the Wazi Analyze scanner to distinguish between non-CICS and CICS programs while scanning.
  • Assembler language
    • ASM for all Assembler source files
    • MAC for all macro source files
    • CASM for all CICS Assembler source files
    Note: Using the language-specific CICS file extensions enables the Wazi Analyze scanner to distinguish between non-CICS and CICS programs while scanning.
  • IMS feature
    • PSB for all IMS PSB files
    • DBD for all IMS DBD files
    Note: Using the language-specific CICS file extensions enables the Wazi Analyze scanner to distinguish between non-CICS and CICS programs while scanning.

Transferring the source files into the Wazi Analyze container

To scan source files for analysis, you need to transfer your source files from your local directory to a directory on the Wazi Analyze container. You can directly transfer the source files into the default directory where Wazi Analyze scans the source files or you can transfer the source files into a different directory on your Wazi Analyze container. You can use two methods to transfer the source files.

Method 1

You can use the docker cp utility to copy files or directories from your local file system to your Wazi Analyze container’s file system and vice versa. For more information, see Docker cp user documentation.

Type the following command on your terminal:
docker cp <local-source-path>/source <container-id>:<container-destination-path>
Replace the following information:
<local-source-path>
Specify the path of directory on your local machine where you store the source files. Your source files need to be prepared under the source directory.
<container-id>
Specify your Wazi Analyze container ID. You can run the following command to get the container ID.
docker ps
<container-destination-path>
Specify the destination path where you want to store the source files on your Wazi Analyze container. Use /home/wazianalyze/data/project if you want to transfer the source files directly to the default scanned directory.
For example, you can run the following command:
docker cp /Users/sampleUser/source 8b8539045b0f:/home/wazianalyze/data/project
The previous command is to copy the source directory under the /Users/sampleUser/ path on your local machine to the /home/wazianalyze/data/project directory on the container ID 8b8539045b0f. You will get all the files under the source directory on your local machine copied to the /home/wazianalyze/data/project/source directory on the Wazi Analyze container.

Method 2

You can mount your local directory to a directory on the Wazi Analyze container when you run the container.

After you load or pull the Wazi Analyze container into your Docker, type the following command on your terminal to run the Wazi Analyze container with mounting directory option.
docker run -v /<path>/<local-shared-directory>:/home/wazianalyze/data/project/source -it -p 5000:5000 --name <container-name> ibmcom/wazianalyze:<tag>
Note: This command is to mount the local directory to the /home/wazianalyze/data/project/source directory that is the default directory Wazi Analyze scans the source files. Replace this directory with another directory on the Wazi Analyze container if you want to mount your local directory to the other directory on the container.
Replace the following information:
<path>/<local-shared-directory>
Specify the path and directory on your local machine where you store the source files to transfer into the Wazi Analyze container.
<container-name>
Replace it with a container name of your choice.
<tag>
Specify the tag for the Wazi Analyze container that you want to deploy.

When you start your container, all the source files in the local directory will automatically be synchronized to the shared directory on your Wazi Analyze container. When you have more source files to be scanned, you can simply drop them into the local directory.

What to do next

To continue with the tasks for getting started with Wazi Analyze, see Checklist for getting started.