1COBC(1)                          User Commands                         COBC(1)
2
3
4

NAME

6       cobc - manual page for cobc (GnuCOBOL) 3.1.2.0
7

SYNOPSIS

9       cobc [options]... file...
10

DESCRIPTION

12       GnuCOBOL compiler for most COBOL dialects with lots of extensions
13

OPTIONS

15       -h, -help
16              display this help and exit
17
18       -V, -version
19              display compiler version and exit
20
21       -i, -info
22              display compiler information (build/environment) and exit
23
24       -v, -verbose
25              verbose   mode,  display  additional  information;  multiple  -v
26              options increase the verbosity, the maximum is 3 as follows: (1)
27              display  compiler  version  and the commands invoked by the com‐
28              piler, (2) pass verbose option to  assembler/compiler  (3)  pass
29              verbose option to linker
30
31       -q, -brief
32              reduced displays, commands invoked not shown
33
34       -###   like -v but commands not executed
35
36       -x     build an executable program
37
38       -m     build a dynamically loadable module (default)
39
40       -j [<args>], -job[=<args>]
41              run program after build, passing <args>
42
43       -std=<dialect>
44              warnings/features  for  a  specific dialect <dialect> can be one
45              of: default, cobol2014, cobol2002, cobol85,  xopen,  ibm-strict,
46              ibm,  mvs-strict,  mvs,  mf-strict,  mf,  bs2000-strict, bs2000,
47              acu-strict, acu,  rm-strict,  rm;  see  configuration  files  in
48              directory config
49
50       -F, -free
51              use free source format
52
53       -fixed use fixed source format (default)
54
55       -O, -O2, -O3, -Os
56              enable optimization
57
58       -O0    disable optimization
59
60       -g     enable C compiler debug and stack check
61
62       -d, -debug
63              enable  all  run-time  error  checking,  equal  to -fstack-check
64              -fec=EC-ALL
65
66       -fec=<exception-name> enable code generation for <exception-name>,
67              sets -fsource-location
68
69       -fno-ec=<exception-name>
70              disable code generation for <exception-name>
71
72       -o <file>
73              place the output into <file>
74
75       -b     combine all input files into a single dynamically loadable  mod‐
76              ule
77
78       -E     preprocess only; do not compile or link
79
80       -C     translation only; convert COBOL to C
81
82       -S     compile only; output assembly file
83
84       -c     compile and assemble, but do not link
85
86       -T <file>
87              generate and place a wide program listing into <file>
88
89       -t <file>
90              generate and place a program listing into <file>
91
92       --tlines=<lines>
93              specify lines per page in listing, default = 55
94
95       -P[=<dir or file>]
96              generate preprocessed program listing (.lst)
97
98       -Xref  generate  cross reference through 'cobxref' (V. Coen's 'cobxref'
99              must be in path)
100
101       -I <directory>
102              add <directory> to copy/include search path
103
104       -L <directory>
105              add <directory> to library search path
106
107       -l <lib>
108              link the library <lib>
109
110       -A <options>
111              add <options> to the C compile phase
112
113       -Q <options>
114              add <options> to the C link phase
115
116       -D <define>
117              define <define> for COBOL compilation
118
119       -K <entry>
120              generate CALL to <entry> as static
121
122       -conf=<file>
123              user-defined dialect configuration; see -std
124
125       -list-reserved
126              display reserved words
127
128       -list-intrinsics
129              display intrinsic functions
130
131       -list-mnemonics
132              display mnemonic names
133
134       -list-system
135              display system routines
136
137       -save-temps[=<dir>]
138              save intermediate files * default: current directory
139
140       -ext <extension>
141              add file extension for resolving COPY
142
143   Warning options:
144       -Wall  enable most warnings (all except as noted below)
145
146       -Wextra
147              like -Wall but enable some extra warning flags
148
149       -w     disable all warnings
150
151       -Wno-<warning>
152              disable warning enabled by default, -Wall or -Wextra
153
154       -Wadditional
155              additional warnings only raised with -Wall
156
157       -Wno-unfinished
158              do not warn if unfinished features are used * ALWAYS active
159
160       -Wno-pending
161              do not warn if pending features are mentioned * ALWAYS active
162
163       -Wno-ignored-error
164              do not warn about errors in unreachable code parts and  so  nor‐
165              mally ignored * ALWAYS active
166
167       -Wobsolete
168              warn if obsolete features are used
169
170       -Warchaic
171              warn if archaic features are used
172
173       -Wredefinition
174              warn about non-referenced ambiguous data items
175
176       -Wtruncate
177              warn about field truncation from constant assignments
178
179       -Wpossible-truncate
180              warn about possible field truncation * NOT set with -Wall
181
182       -Woverlap
183              warn about overlapping MOVE of items
184
185       -Wpossible-overlap
186              warn about MOVE of items that may overlap depending on variables
187              * NOT set with -Wall
188
189       -Wparentheses
190              warn about lack of parentheses around AND within OR
191
192       -Wstrict-typing
193              warn strictly about type mismatch
194
195       -Wimplicit-define
196              warn about implicitly defined data items * NOT set with -Wall
197
198       -Wno-corresponding
199              do not warn about CORRESPONDING with no matching items *  ALWAYS
200              active
201
202       -Winitial-value
203              warn if initial VALUE clause is ignored
204
205       -Wprototypes
206              warn about missing FUNCTION prototypes/definitions
207
208       -Warithmetic-osvs
209              warn if arithmetic expression precision has changed
210
211       -Wcall-params
212              warn  about  non  01/77 items for CALL parameters * NOT set with
213              -Wall
214
215       -Wconstant-expression
216              warn about expressions that always resolve to true/false
217
218       -Wcolumn-overflow
219              warn about text after program-text area, FIXED format * NOT  set
220              with -Wall
221
222       -Wterminator
223              warn about lack of scope terminator END-XXX * NOT set with -Wall
224
225       -Wlinkage
226              warn about dangling LINKAGE items * NOT set with -Wall
227
228       -Wunreachable
229              warn about likely unreachable statements * NOT set with -Wall
230
231       -Wno-dialect
232              do not warn about dialect specific issues * ALWAYS active
233
234       -Wdangling-text
235              warn source text after program-area * NOT set with -Wall
236
237       -Wno-others
238              do not warn about different issues * ALWAYS active
239
240       -Werror
241              treat all warnings as errors
242
243       -Wno-error
244              don't treat warnings as errors
245
246       -Werror=<warning>
247              treat specified <warning> as error
248
249       -Wno-error=<warning>
250              don't treat specified <warning> as error
251
252   Compiler options:
253       -fsign=[ASCII|EBCDIC] define display sign representation
254              * default: machine native
255
256       -ffold-copy=[UPPER|LOWER]
257              fold COPY subject to value * default: no transformation
258
259       -ffold-call=[UPPER|LOWER]
260              fold  PROGRAM-ID,  CALL,  CANCEL  subject to value * default: no
261              transformation
262
263       -fdefaultbyte=<value> initialize fields without VALUE to value
264              * decimal 0..255 or any quoted character *  default:  initialize
265              to picture
266
267       -fmax-errors=<number> maximum number of errors to report before
268              compilation is aborted * default: 128
269
270       -fintrinsics=[ALL|intrinsic function name(,name,...)]
271              intrinsics to be used without FUNCTION keyword
272
273       -fdump=<scope>
274              dump data fields on abort, <scope> may be a combination of: ALL,
275              WS, LS, RD, FD, SC, LO
276
277       -fcallfh=<name>
278              specifies <name> to be used for I/O as external  provided  EXTFH
279              interface module
280
281       -fno-remove-unreachable
282              disable remove of unreachable code * turned off by -g
283
284       -ftrace
285              generate trace code * scope: executed SECTION/PARAGRAPH
286
287       -ftraceall
288              generate  trace  code * scope: executed SECTION/PARAGRAPH/STATE‐
289              MENTS
290
291       -fsyntax-only
292              syntax error checking only; don't emit any output
293
294       -fdebugging-line
295              enable debugging lines * 'D' in indicator column or floating >>D
296
297       -fsource-location
298              generate   source    location    code    *    turned    on    by
299              -debug/-g/-ftraceall/-fec
300
301       -fimplicit-init
302              automatic initialization of the COBOL runtime system
303
304       -fno-recursive-check
305              disable  check  of recursive program call; effectively compiling
306              as RECURSIVE program
307
308       -fstack-check
309              PERFORM stack checking * turned on by -debug or -g
310
311       -fwrite-after
312              use AFTER 1 for WRITE of LINE SEQUENTIAL * default: BEFORE 1
313
314       -fmfcomment
315              '*' or '/' in column 1 treated as comment * FIXED format only
316
317       -facucomment
318              '$' in indicator area treated as '*', '|'  treated  as  floating
319              comment
320
321       -fnotrunc
322              allow numeric field overflow * non-ANSI behaviour
323
324       -fodoslide
325              adjust items following OCCURS DEPENDING * implies -fcomplex-odo
326
327       -fsingle-quote
328              use  a  single  quote  (apostrophe)  for QUOTE * default: double
329              quote
330
331       -foptional-file
332              treat all files as OPTIONAL * unless NOT OPTIONAL specified
333
334       -fstatic-call
335              output static function calls for the CALL statement
336
337       -fno-gen-c-decl-static-call
338              disable generation of C function declations for subroutines with
339              static CALL
340
341       -fgen-c-line-directives
342              generate source location directives in C code; * turned on by -g
343
344       -fgen-c-labels
345              generate extra labels in C sources; * turned on by -g
346
347       -fno-theaders
348              suppress  all  headers  and  output  of compilation options from
349              listing while keeping page breaks
350
351       -fno-tsource
352              suppress source from listing
353
354       -fno-tmessages
355              suppress warning and error summary from listing
356
357       -ftsymbols
358              specify symbols in listing
359
360       -fno-diagnostics-show-option
361              suppress output of option that directly controls the diagnostic
362
363   Compiler dialect configuration options:
364       -freserved-words=<value>
365              use of complete/fixed reserved words
366
367       -ftab-width=1..12
368              set number of spaces that are assumed for tabs
369
370       -ftext-column=72..255
371              set right margin for source (fixed format only)
372
373       -fpic-length=<number>
374              maximum number of characters  allowed  in  the  PICTURE  charac‐
375              ter-string
376
377       -fword-length=1..63
378              maximum word-length for COBOL (= programmer defined) words
379
380       -fliteral-length=<number>
381              maximum literal size in general
382
383       -fnumeric-literal-length=1..38
384              maximum numeric literal size
385
386       -fbinary-size=<value>
387              binary byte size - defines the allocated bytes according to PIC,
388              may be one of: 2-4-8, 1-2-4-8, 1--8
389
390       -fbinary-byteorder=<value>
391              binary byte order, may be one of: native, big-endian
392
393       -fassign-clause=<value>
394              how to interpret 'ASSIGN word': as  'ASSIGN  EXTERNAL  word'  or
395              'ASSIGN  DYNAMIC word', may be one of: dynamic, external, ibm (=
396              external), mf (= dynamic)
397
398       -fscreen-section-rules=<value>
399              which compiler's rules to apply to SCREEN SECTION item  clauses,
400              may be one of: acu, gc, mf, rm, std, xopen
401
402       -fdpc-in-data=<value>
403              whether  DECIMAL-POINT IS COMMA has effect in XML/JSON GENERATE,
404              may be one of: none, xml, json, all
405
406       -ffilename-mapping
407              resolve file names at run time using environment variables
408
409       -fpretty-display
410              alternate formatting of numeric fields
411
412       -fbinary-truncate
413              numeric truncation according to ANSI
414
415       -fcomplex-odo
416              allow complex OCCURS DEPENDING ON
417
418       -findirect-redefines
419              allow REDEFINES to other than last equal level number
420
421       -flarger-redefines-ok
422              allow larger REDEFINES items
423
424       -frelax-syntax-checks
425              allow certain syntax variations (e.g. REDEFINES position)
426
427       -fref-mod-zero-length
428              allow zero  length  reference-modification  (only  changed  with
429              EC-BOUND-REF-MOD active)
430
431       -frelax-level-hierarchy
432              allow non-matching level numbers
433
434       -fselect-working
435              require ASSIGN USING items to be in WORKING-STORAGE
436
437       -flocal-implies-recursive
438              LOCAL-STORAGE SECTION implies RECURSIVE attribute
439
440       -fsticky-linkage
441              LINKAGE SECTION items remain allocated between invocations
442
443       -fmove-ibm
444              MOVE operates as on IBM (left to right, byte by byte)
445
446       -fperform-osvs
447              exit  point  of any currently executing perform is recognized if
448              reached
449
450       -farithmetic-osvs
451              limit precision in intermediate results to  precision  of  final
452              result (less accurate)
453
454       -fconstant-folding
455              evaluate constant expressions at compile time
456
457       -fhostsign
458              allow  hexadecimal  value  'F' for NUMERIC test of signed PACKED
459              DECIMAL field
460
461       -fprogram-name-redefinition
462              program names don't lead to a reserved identifier
463
464       -faccept-update
465              set WITH UPDATE clause as default for ACCEPT dest-item,  instead
466              of WITH NO UPDATE
467
468       -faccept-auto
469              set WITH AUTO clause as default for ACCEPT dest-item, instead of
470              WITH TAB
471
472       -fconsole-is-crt
473              assume CONSOLE IS CRT if not set otherwise
474
475       -fno-echo-means-secure
476              NO-ECHO hides input with asterisks like SECURE
477
478       -fline-col-zero-default
479              assume a field DISPLAY starts at LINE 0 COL 0 (i.e. at the  cur‐
480              sor), not LINE 1 COL 1
481
482       -fdisplay-special-fig-consts
483              special behaviour of DISPLAY SPACE/ALL X'01'/ALL X'02'/ALL X'07'
484
485       -fbinary-comp-1
486              COMP-1 is a 16-bit signed integer
487
488       -fnumeric-pointer
489              POINTER is a 64-bit unsigned integer
490
491       -fmove-non-numeric-lit-to-numeric-is-zero
492              imply zero in move of non-numeric literal to numeric items
493
494       -fimplicit-assign-dynamic-var implicitly define a variable if an ASSIGN
495              DYNAMIC does not match any data item
496
497       -fcomment-paragraphs=<support>
498              comment   paragraphs   in   IDENTIFICATION   DIVISION   (AUTHOR,
499              DATE-WRITTEN, ...)
500
501       -fmemory-size-clause=<support>
502              MEMORY-SIZE clause
503
504       -fmultiple-file-tape-clause=<support> MULTIPLE-FILE-TAPE clause
505
506       -flabel-records-clause=<support>
507              LABEL-RECORDS clause
508
509       -fvalue-of-clause=<support>
510              VALUE-OF clause
511
512       -fdata-records-clause=<support>
513              DATA-RECORDS clause
514
515       -ftop-level-occurs-clause=<support>
516              OCCURS clause on top-level
517
518       -fsame-as-clause=<support>
519              SAME AS clause
520
521       -ftype-to-clause=<support>
522              TYPE TO clause
523
524       -fusage-type=<support>
525              USAGE type-name
526
527       -fsynchronized-clause=<support>
528              SYNCHRONIZED clause
529
530       -fspecial-names-clause=<support>
531              SPECIAL-NAMES clause
532
533       -fgoto-statement-without-name=<support>
534              GOTO statement without name
535
536       -fstop-literal-statement=<support>
537              STOP-literal statement
538
539       -fstop-identifier-statement=<support> STOP-identifier statement
540
541       -fdebugging-mode=<support>
542              DEBUGGING MODE and debugging indicator
543
544       -fuse-for-debugging=<support> USE FOR DEBUGGING
545
546       -fpadding-character-clause=<support>
547              PADDING CHARACTER clause
548
549       -fnext-sentence-phrase=<support>
550              NEXT SENTENCE phrase
551
552       -flisting-statements=<support>
553              listing-directive statements EJECT, SKIP1, SKIP2, SKIP3
554
555       -ftitle-statement=<support>
556              listing-directive statement TITLE
557
558       -fentry-statement=<support>
559              ENTRY statement
560
561       -fmove-noninteger-to-alphanumeric=<support>
562              move noninteger to alphanumeric
563
564       -fmove-figurative-constant-to-numeric=<support>
565              move figurative constants to numeric
566
567       -fmove-figurative-space-to-numeric=<support>
568              move figurative constant SPACE to numeric
569
570       -fmove-figurative-quote-to-numeric=<support>
571              move figurative constant QUOTE to numeric
572
573       -fodo-without-to=<support>
574              OCCURS DEPENDING ON without to
575
576       -fsection-segments=<support>
577              section segments
578
579       -falter-statement=<support>
580              ALTER statement
581
582       -fcall-overflow=<support>
583              OVERFLOW clause for CALL
584
585       -fnumeric-boolean=<support>
586              boolean literals (B'1010')
587
588       -fhexadecimal-boolean=<support>
589              hexadecimal-boolean literals (BX'A')
590
591       -fnational-literals=<support> national literals (N'UTF-16 string')
592
593       -fhexadecimal-national-literals=<support>
594              hexadecimal-national literals (NX'265E')
595
596       -fnational-character-literals=<support>
597              non-standard national literals (NC'UTF-16 string')
598
599       -fhp-octal-literals=<support> HP COBOL octal literals (%377)
600
601       -facu-literals=<support>
602              ACUCOBOL-GT literals (#B #O #H #X)
603
604       -fword-continuation=<support> continuation of COBOL words
605
606       -fnot-exception-before-exception=<support>
607              NOT ON EXCEPTION before ON EXCEPTION
608
609       -faccept-display-extensions=<support> extensions to ACCEPT and DISPLAY
610
611       -frenames-uncommon-levels=<support>
612              RENAMES of 01-, 66- and 77-level items
613
614       -fsymbolic-constant=<support> constants defined in SPECIAL-NAMES
615
616       -fconstant-78=<support>
617              constant  with level 78 item (note: has left to right precedence
618              in expressions)
619
620       -fconstant-01=<support>
621              constant with level 01 CONSTANT AS/FROM item
622
623       -fperform-varying-without-by=<support>
624              PERFORM VARYING without BY phrase (implies BY 1)
625
626       -freference-out-of-declaratives=<support>
627              references to sections not in DECLARATIVES from within  DECLARA‐
628              TIVES
629
630       -fprogram-prototypes=<support>
631              CALL/CANCEL with program-prototype-name
632
633       -fcall-convention-mnemonic=<support>
634              specifying call-convention by mnemonic
635
636       -fcall-convention-linkage=<support>
637              specifying call-convention by WITH ... LINKAGE
638
639       -fnumeric-value-for-edited-item=<support>
640              numeric literals in VALUE clause of numeric-edited items
641
642       -fincorrect-conf-sec-order=<support>
643              incorrect order of CONFIGURATION SECTION paragraphs
644
645       -fdefine-constant-directive=<support>  allow  >> DEFINE CONSTANT var AS
646              literal
647
648       -ffree-redefines-position=<support>
649              REDEFINES clause not following entry-name in definition
650
651       -frecords-mismatch-record-clause=<support>
652              record sizes does not match RECORD clause
653
654       -frecord-delimiter=<support>
655              RECORD DELIMITER clause
656
657       -fsequential-delimiters=<support>
658              BINARY-SEQUENTIAL and LINE-SEQUENTIAL phrases in  RECORD  DELIM‐
659              ITER
660
661       -frecord-delim-with-fixed-recs=<support>
662              RECORD DELIMITER clause on file with fixed-length records
663
664       -fmissing-statement=<support>  missing  statement (e.g. empty IF / PER‐
665              FORM)
666
667       -fzero-length-literals=<support>
668              zero-length literals, e.g. '' and ""
669
670       -fxml-generate-extra-phrases=<support>
671              XML GENERATE's phrases other than COUNT IN
672
673       -fcontinue-after=<support>
674              AFTER phrase in CONTINUE statement
675
676       -fgoto-entry=<support>
677              ENTRY FOR GOTO and GOTO ENTRY statements
678
679       -fassign-variable=<support>
680              ASSIGN [TO] variable in SELECT
681
682       -fassign-using-variable=<support>
683              ASSIGN USING/VARYING variable in SELECT
684
685       -fassign-ext-dyn=<support>
686              ASSIGN EXTERNAL/DYNAMIC in SELECT
687
688       -fassign-disk-from=<support>
689              ASSIGN DISK FROM variable in SELECT
690
691       -fvsam-status=<support>
692              VSAM status in FILE STATUS
693
694              where <support>  is  one  of  the  following:  'ok',  'warning',
695              'archaic',   'obsolete',   'skip',  'ignore',  'error',  'uncon‐
696              formable'
697
698       -fnot-reserved=<word>
699              word to be taken out of the reserved words list
700
701       -freserved=<word>
702              word to be added to reserved words list
703
704       -freserved=<word>:<alias>
705              word to be added to reserved words list as alias
706
707       -fnot-register=<word>
708              special register to disable
709
710       -fregister=<word>
711              special register to enable
712

AUTHOR

714       Written by Keisuke Nishida, Roger While,  Ron  Norman,  Simon  Sobisch,
715       Edward  Hart  Built      Dec  23  2020  11:52:50  Packaged  Dec 23 2020
716       10:51:50 UTC C version "8.3.0"
717

REPORTING BUGS

719       Report bugs to: bug-gnucobol@gnu.org  or  (preferably)  use  the  issue
720       tracker via the home page.
721       GnuCOBOL home page: <https://www.gnu.org/software/gnucobol/>
722       General help using GNU software: <https://www.gnu.org/gethelp/>
723
725       Copyright  ©  2020  Free Software Foundation, Inc.  License GPLv3+: GNU
726       GPL version 3 or later <https://gnu.org/licenses/gpl.html>
727       This is free software; see the source for copying conditions.  There is
728       NO  warranty;  not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
729       PURPOSE.
730

SEE ALSO

732       The full documentation for cobc is maintained as a Texinfo manual.   If
733       the  info  and  cobc  programs are properly installed at your site, the
734       command
735
736              info gnucobol
737
738       should give you access to the complete manual.
739
740
741
742cobc (GnuCOBOL) 3.1.2.0          December 2020                         COBC(1)
Impressum