Batch Converter : Command-line Interface : Code Generator

If installed, the command-line batch converter exists as a script file named Generator.bat in the Run-time sub-directory of the Keywood installation directory. Note the command must be run from this directory.

Log Information

Each time the Generator runs it appends information to a log file. The file is called Generate.log and it is placed in the \Temp subdirectory of your home directory, for example C:\Temp\Generate.log or H:\Temp\Generate.log.

Generation of JSP-COBOL Files from PDF Files

To generate a JSP-COBOL file from a single PDF file, type:
GENERATOR.BAT PDF_TO_JSPCOBOL <MY PDF FILE>

To generate a JSP-COBOL file for each PDF file in the current directory, type:
GENERATOR.BAT ALL_PDF_TO_JSPCOBOL

To generate a JSP-COBOL file for each PDF file in a specified directory, type:
GENERATOR.BAT ALL_PDF_TO_JSPCOBOL <MY DIRECTORY>

The extension of the generated JSP-COBOL files will be JSP so for example, FRED.JSP will be generated from FRED.PDF.

In all the above cases the JSP-COBOL files will be created in the same directory as the PDF files. However you can direct them to a different location by inserting the OUTPUT qualifier plus a destination directory name immediately after the first parameter. For example:

GENERATOR.BAT PDF_TO_JSPCOBOL OUTPUT \MY_FILES\TEMP_OUTPUT \MY_FILES\PDF_FILES\MY_FILE.PDF

Generation of 'Structured Text' Files from PDF Files

To generate a Structured Text file from a single PDF file, type:
GENERATOR.BAT PDF_TO_STRUCTURED_TEXT <MY PDF FILE>

To generate a Structured Text file for each PDF file in the current directory, type:
GENERATOR.BAT ALL_PDF_TO_STRUCTURED_TEXT

To generate a Structured Text file for each PDF file in a specified directory, type:
GENERATOR.BAT ALL_PDF_TO_STRUCTURED_TEXT <MY DIRECTORY>

The extension of the generated Structured Text will beTXT so for example, FRED.TXT will be generated from FRED.PDF.

In all the above cases the Structured Text files will be created in the same directory as the PDF files. However you can direct them to a different location by inserting the OUTPUT qualifier plus a destination directory name immediately after the first parameter. For example:

GENERATOR.BAT PDF_TO_STRUCTURED_TEXT OUTPUT \MY_FILES\TEMP_OUTPUT MY_FILES\PDF_FILES\MY_FILE.PDF

Generation of JSP-COBOL Files from JSP Tool Files

To generate a JSP-COBOL file from a single JSP Tool file, type:
GENERATOR.BAT JSPTOOL_TO_JSPCOBOL <MY JSP-TOOL FILE>

To generate a JSP-COBOL file for each JSP Tool file in the current directory, type:
GENERATOR.BAT ALL_JSPTOOL_TO_JSPCOBOL

To generate a JSP-COBOL file for each JSP Tool file in a specified directory, type:
GENERATOR.BAT ALL_JSPTOOL_TO_JSPCOBOL <MY DIRECTORY>

The extension of the generated JSP-COBOL files will be JSP so for example, FRED.JSP will be generated from FRED.JSPTool.

In all the above cases the JSP-COBOL files will be created in the same directory as the JSP Tool files. However you can direct them to a different location by inserting the OUTPUT qualifier plus a destination directory name immediately after the first parameter. For example:

GENERATOR.BAT JSPTOOL_TO_JSPCOBOL OUTPUT \MY_FILES\TEMP_OUTPUT \MY_FILES\JSPTOOL_FILES\MY_FILE.JSPTOOL

Generation of COBOL code from an Abbey National 'LST' file

To generate COBOL code from an 'LST' file type:
GENERATOR.BAT LST_FILE <LST file> <COBOL file> COPYLIBS <lib1> <lib2> ... MACROLIBS <lib3> <lib4> ...

For example:
GENERATOR.BAT LST_FILE myprog.lst myprog.cob COPYLIBS \mylibs\copy1 \mylibs\copy2 MACROLIBS \mylibs\macros

If the COBOL file name supplied is just a terminal name then the file will be created in the same directory as the LST file.

The code generation process has two phases. First, each PDF file named in the LST file is converted to a JSP-COBOL file, and then the resultant JSP-COBOL source files are merged together and used to generate a single COBOL output file. Either of these two phases may be skipped:

To just convert all the PDF files named in an LST file to JSP-COBOL (i.e. just the first phase) type:
GENERATOR.BAT LST_FILE_PDF_TO_JSPCOBOL myprog.lst

To take the JSP-COBOL files corresponding to the PDF files named in an LST file and generate COBOL from them (i.e. just the second phase) type:
GENERATOR.BAT LST_FILE_JSPCOBOL_TO_COBOL <LST file> <COBOL file> COPYLIBS <lib1> <lib2> ... MACROLIBS <lib3> <lib4> ...

Note that when intermediate JSP-COBOL files are produced, they are created in the same directory as the LST file, and therefore may overwrite existing JSP COBOL files. For example if an LST file refers to a PDF file called FRED.PDF, then it would produce an intermediate file called FRED.JSP.

Generation of COBOL code from a JSP Tool file

To generate COBOL code from a JSP Tool file type:
GENERATOR.BAT JSPTOOL_TO_COBOL <JSP Tool file> COPYLIBS <lib1> <lib2> ... MACROLIBS <lib3> <lib4> ...

For example:
GENERATOR.BAT JSPTOOL_TO_COBOL myprog.jsptool COPYLIBS \mylibs\copy1 \mylibs\copy2 MACROLIBS \mylibs\macros

The generated COBOL file will be created in the same directory as the JSP Tool file. It will have the same name but a COB extension.

Note that as part of the code generation process an intermediate JSP-COBOL file is produced in the same directory as the JSP Tool file, and this may overwrite an existing JSP COBOL file. For example if the JSP Tool file was FRED.JSPTool, then it would produce an intermediate file called FRED.JSP.

Generation of COBOL code from a JSP-COBOL file

To generate COBOL code from a JSP-COBOL file type:
GENERATOR.BAT JSPCOBOL_TO_COBOL <JSP-COBOL file> COPYLIBS <lib1> <lib2> ... MACROLIBS <lib3> <lib4> ...

For example:
GENERATOR.BAT JSPCOBOL_TO_COBOL myprog.jsp COPYLIBS \mylibs\copy1 \mylibs\copy2 MACROLIBS mylibs\macros

The generated COBOL file will be created in the same directory as the JSP-COBOL file. It will have the same name but a COB extension.

Using a Parameter File with the Generator

Microsoft Windows places a limit on the number of parameters that can be passed to a program invoked from a command prompt window. To overcome this limitation the Generator allows you to supply your parameters in a parameter file. For example suppose that you wanted to do the following using a parameter file:
GENERATOR.BAT LST_FILE myprog.lst myprog.cob COPYLIBS \mylibs\copy1 \mylibs\copy2 MACROLIBS \mylibs\macros

First you would create a simple text file with each parameter on a separate line:

LST_FILE

myprog.lst

myprog.cob

COPYLIBS

\mylibs\copy1

\mylibs\copy2

MACROLIBS

\mylibs\macros

If you called the parameter file MY_PARAMS.TXT, you could then type:
GENERATOR.BAT MY_PARAMS.TXT

Using NOVISUALLOG with the Generator

When you run the Generator from a command prompt window, it creates a separate scrollable window in which it displays progress messages. You can inhibit this, and cause all the progress messages to be displayed in the command prompt window instead by supplying the keyword NOVISUALLOG as the first parameter. For example:

GENERATOR.BAT NOVISUALLOG PDF_TO_JSPCOBOL myfile.pdf

If you are using a parameter file you should put the NOVISUALLOG keyword on the command line before the parameter file name:

PDF_TO_JSPCOBOL

myfile.pdf

GENERATOR.BAT NOVISUALLOG MY_PARAMS.TXT

Options

The original JSP-COBOL processor accepted a number of options that could be specified either in JSP-COBOL source files or (via additional pre-processing tools at Abbey National) in an LST file.


The Keywood Generator supports both these methods of supplying options. However currently only the following options are implemented:

MAC
NOMAC
COP
NOCOP