matthewstorey.co.uk
In this section Introduction to USS | BPXBATCH | Using COBOL | USS Commands | Using Java

Using COBOL

COBOL compiler

To use the USS command 'cob2' (a COBOL compiler and linker) you need the COBOL compiler version 'OS/390 & VM V2R2' or above installed and the following lines added to your '.profile' file:

More information on the 'cob2' USS command and compiler options can be found in the IBM book:

Bookshelf: COBOL (find bookshelves)

       Book: COBOL Programming Guide (find books)

COBOL programs

Although USS will allow COBOL filenames longer than 8 characters, the program name (specified in the program) can not. To get around this, truncate it to the first 8 characters of the filename. If the program name is the same name as a COBOL reserved word, put double quotes around it.

The filename of the COBOL program must end in '.cbl' otherwise it will not be recognised by the 'cob2' command.

Copybooks

The filename of copybooks are case sensitive and depend on how you coded the name in your program. A '.cpy' as a file extension for copybooks is optional and can be in either upper or lower case.

Compiler options

You specify compiler options on the 'cob2' command using the '-q' parameter. However, there must be no space between the '-q' and the first compiler option e.g. '-qssrange'.

Options involving brackets need to be specified differently, the left bracket becomes '=' and the right bracket becomes ':', so you get '-qPGMNAME=LONGMIXED:' instead of '-qPGMNAME(LONGMIXED)'.

Back to top