Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
COBC(1)				 User Commands			       COBC(1)

       cobc - manual page for cobc (GnuCOBOL) 2.2.0

       lt-cobc [options]... file...

       GnuCOBOL	compiler for most COBOL	dialects with lots of extensions

       -h, -help
	      display this help	and exit

       -V, -version
	      display compiler version and exit

       -i, -info
	      display compiler information (build/environment) and exit

       -v, -verbose
	      display  compiler	 version  and the commands invoked by the com-

       -vv, -verbose=2
	      like -v but additional pass verbose option to assembler/compiler

       -vvv, -verbose=3
	      like -vv but additional pass verbose option to linker

       -q, -brief
	      reduced displays,	commands invoked not shown

       -###   like -v but commands not executed

       -x     build an executable program

       -m     build a dynamically loadable module (default)

       -j [<args>], -job[=<args>]
	      run program after	build, passing <args>

	      warnings/features	for a specific dialect <dialect>  can  be  one
	      of:  default,  cobol2014,	cobol2002, cobol85, xopen, ibm-strict,
	      ibm, mvs-strict,	mvs,  mf-strict,  mf,  bs2000-strict,  bs2000,
	      acu-strict,  acu,	 rm-strict, rm;	see configuration files	in di-
	      rectory config

       -F, -free
	      use free source format

       -fixed use fixed	source format (default)

       -O, -O2,	-O3, -Os
	      enable optimization

       -g     enable C compiler	debug /	stack check / trace

       -d, -debug
	      enable all run-time error	checking

       -o <file>
	      place the	output into <file>

       -b     combine all input	files into a single dynamically	loadable  mod-

       -E     preprocess only; do not compile or link

       -C     translation only;	convert	COBOL to C

       -S     compile only; output assembly file

       -c     compile and assemble, but	do not link

       -T <file>
	      generate and place a wide	program	listing	into <file>

       -t <file>
	      generate and place a program listing into	<file>

	      specify lines per	page in	listing, default = 55

	      specify symbols in listing

       -P[=<dir	or file>]
	      generate preprocessed program listing (.lst)

       -Xref  specify cross reference in listing

       -I <directory>
	      add <directory> to copy/include search path

       -L <directory>
	      add <directory> to library search	path

       -l <lib>
	      link the library <lib>

       -A <options>
	      add <options> to the C compile phase

       -Q <options>
	      add <options> to the C link phase

       -D <define>
	      define <define> for COBOL	compilation

       -K <entry>
	      generate CALL to <entry> as static

	      user-defined dialect configuration; see -std

	      display reserved words

	      display intrinsic	functions

	      display mnemonic names

	      display system routines

	      save intermediate	files -	default: current directory

       -ext <extension>
	      add file extension for resolving COPY

   Warning options:
       -W     enable all warnings

       -Wall  enable most warnings (all	except as noted	below)

	      disable warning enabled by -W or -Wall

	      do not warn if unfinished	features are used - ALWAYS active

	      do not warn if pending features are mentioned - ALWAYS active

	      warn if obsolete features	are used

	      warn if archaic features are used

	      warn incompatible	redefinition of	data items

	      warn field truncation from constant assignments

	      warn possible field truncation - NOT set with -Wall

	      warn overlapping MOVE items

	      warn  MOVE  items	 that may overlap depending on variables - NOT
	      set with -Wall

	      warn lack	of parentheses around AND within OR

	      warn type	mismatch strictly

	      warn implicitly defined data items

	      warn CORRESPONDING with no matching items

	      warn if initial VALUE clause is ignored

	      warn missing FUNCTION prototypes/definitions

	      warn if arithmetic expression precision has changed

	      warn non 01/77 items for CALL params - NOT set with -Wall

	      warn expressions that always resolve to true/false

	      warn text	after program-text area, FIXED format -	NOT  set  with

	      warn lack	of scope terminator END-XXX - NOT set with -Wall

	      warn dangling LINKAGE items - NOT	set with -Wall

	      warn likely unreachable statements - NOT set with	-Wall

	      treat all	warnings as errors

	      treat specified <warning>	as error

   Compiler options:
       -fsign=[ASCII|EBCDIC] define display sign representation
	      -	default: machine native

	      fold COPY	subject	to value - default: no transformation

	      fold  PROGRAM-ID,	 CALL,	CANCEL	subject	to value - default: no

       -fdefaultbyte=<value> initialize	fields without VALUE to	value
	      -	decimal	0..255 or any quoted character -  default:  initialize
	      to picture

       -fmax-errors=<number> maximum number of errors to report
	      -	default: 100

       -fintrinsics=[ALL|intrinsic function name(,name,...)]
	      intrinsics to be used without FUNCTION keyword

	      disable  check  of recursive program call; effectively compiling
	      as RECURSIVE program

	      generate trace code - executed SECTION/PARAGRAPH

	      generate trace code -  executed  SECTION/PARAGRAPH/STATEMENTS  -
	      turned on	by -debug

	      syntax error checking only; don't	emit any output

	      enable debugging lines - 'D' in indicator	column or floating >>D

	      generate	 source	  location   code   -	turned	 on   by  -de-

	      automatic	initialization of the COBOL runtime system

	      PERFORM stack checking - turned on by -debug or -g

	      use AFTER	1 for WRITE of LINE SEQUENTIAL - default: BEFORE 1

	      '*' or '/' in column 1 treated as	comment	- FIXED	format only

	      '$' in indicator area treated as '*', '|'	 treated  as  floating

	      allow numeric field overflow - non-ANSI behaviour

	      adjust  items following OCCURS DEPENDING - requires implicit/ex-
	      plicit relaxed syntax

	      use a single quote (apostrophe)  for  QUOTE  -  default:	double

	      treat all	files as OPTIONAL - unless NOT OPTIONAL	specified

   Compiler dialect configuration options:
	      use of complete/fixed reserved words

	      set number of spaces that	are asumed for tabs

	      set right	margin for source (fixed format	only)

	      maximum number of	characters allowed in the character-string

	      maximum word-length for COBOL words / Programmer defined words

	      maximum literal size in general

	      maximum numeric literal size

	      set way of interpreting ASSIGN

	      binary byte size - defines the allocated bytes according to PIC

	      binary byte order

	      resolve file names at run	time using environment variables.

	      alternate	formatting of numeric fields

	      numeric truncation according to ANSI

	      allow complex OCCURS DEPENDING ON

	      allow REDEFINES to other than last equal level number

	      allow larger REDEFINES items

	      allow certain syntax variations (e.g. REDEFINES position)

	      allow non-matching level numbers

	      LINKAGE-SECTION items remain allocated between invocations

	      MOVE operates as on IBM (left to right, byte by byte)

	      exit  point  of any currently executing perform is recognized if

	      limit precision in intermediate results to  precision  of	 final
	      result (less accurate)

	      evaluate constant	expressions at compile time

	      allow  hexadecimal  value	 'F' for NUMERIC test of signed	PACKED
	      DECIMAL field

	      program names don't lead to a reserved identifier

	      set WITH UPDATE clause as	default	for ACCEPT dest-item,  instead
	      of WITH NO UPDATE

	      set WITH AUTO clause as default for ACCEPT dest-item, instead of
	      WITH TAB

	      assume CONSOLE IS	CRT if not set otherwise

	      NO-ECHO hides input with asterisks like SECURE

	      comment	paragraphs   in	  IDENTIFICATION   DIVISION   (AUTHOR,
	      DATE-WRITTEN, ...)

	      MEMORY-SIZE clause

       -fmultiple-file-tape-clause=<support> MULTIPLE-FILE-TAPE	clause

	      LABEL-RECORDS clause

	      VALUE-OF clause

	      DATA-RECORDS clause

	      OCCURS clause on top-level

	      SYNCHRONIZED clause

	      GOTO statement without name

	      STOP-literal statement

       -fstop-identifier-statement=<support> STOP-identifier statement

	      DEBUGGING	MODE and debugging indicator

       -fuse-for-debugging=<support> USE FOR DEBUGGING


	      NEXT SENTENCE phrase

	      listing-directive	statements EJECT, SKIP1, SKIP2,	SKIP3

	      listing-directive	statement TITLE

	      ENTRY statement

	      move noninteger to alphanumeric

	      move figurative constants	to numeric

	      move figurative constant QUOTE to	numeric

	      OCCURS DEPENDING ON without to

	      section segments

	      ALTER statement

	      OVERFLOW clause for CALL

	      boolean literals (B'1010')

	      hexadecimal-boolean literals (BX'A')

       -fnational-literals=<support> national literals (N'UTF-16 string')

	      hexadecimal-national literals (NX'265E')

	      ACUCOBOL-GT literals (#B #O #H #X)

       -fword-continuation=<support> continuation of COBOL words


       -faccept-display-extensions=<support> extensions	to ACCEPT and DISPLAY

	      RENAMES of 01-, 66- and 77-level items

	      constant	with level 78 item (note: has left to right precedence
	      in expressions)

	      constant with level 01 CONSTANT AS/FROM item

	      CALL/CANCEL with program-prototype-name

	      references to sections not in DECLARATIVES from within  DECLARA-

	      numeric literals in VALUE	clause of numeric-edited items

	      incorrect	order of CONFIGURATION SECTION paragraphs

       -fdefine-constant-directive=<support>  allow  >>	DEFINE CONSTANT	var AS

	      where <support> is one of	the following: 'ok',  'warning',  'ar-
	      chaic', 'obsolete', 'skip', 'ignore', 'error', 'unconformable'

	      word to be taken out of the reserved words list

	      word to be added to reserved words list

	      word to be added to reserved words list as alias

       Written by Keisuke Nishida, Roger While,	Ron Norman, Simon Sobisch, Ed-
       ward Hart Built	   Sep 06 2017 20:39:24	Packaged  Sep 06 2017 18:39:02
       UTC C version "7.0.1 20170430 (prerelease)"

       Report  bugs  to:	or  (preferably) use the issue
       tracker via the home page.
       GnuCOBOL	home page: <>
       General help using GNU software:	<>

       Copyright (C) 2017 Free Software	Foundation, Inc.  License GPLv3+:  GNU
       GPL version 3 or	later <>
       This is free software; see the source for copying conditions.  There is
       NO warranty; not	even for MERCHANTABILITY or FITNESS FOR	 A  PARTICULAR

       The  full documentation for cobc	is maintained as a Texinfo manual.  If
       the info	and cobc programs are properly installed  at  your  site,  the

	      info gnucobol

       should give you access to the complete manual.

cobc (GnuCOBOL)	2.2.0		September 2017			       COBC(1)


Want to link to this manual page? Use this URL:

home | help