This is ocfaq.info, produced by makeinfo version 4.11 from ocfaq.texi.  File: ocfaq.info, Node: Top, Up: (dir) Top *** * Menu: * OpenCOBOL FAQ::  File: ocfaq.info, Node: OpenCOBOL FAQ, Prev: Top, Up: Top 1 OpenCOBOL FAQ *************** [image src="images/opencobol.png" alt="OpenCOBOL"] .. Attention:: This is a 1.0 release candidate of the OpenCOBOL FAQ. Sourced at ocfaq.rst (http://opencobol.add1tocobol.com/ocfaq.rst) .. Suggestions in general: 1. Remove the leading "Q." because most points are questions and the answers weren't titled as "A." 2. Change the (minor) version number every time you do something (1.0rc, 1.0rc2, ...). 3. If possible: use images for "back to index links" 4. If possible: remove all backlinks via css if file is printed. 5. Why is this called a FAQ? 1 done 2 done 3 and 4 corrected with use of :backlinks: option of contents directive 5 Good question :Authors: Brian Tiffin [btiffin]_, John Ellis [jrls_swla]_, human [human]_, Joseph James Frantz [aoirthoir]_, Roger While [Roger]_, Keisuke Nishida [Keisuke]_ (with the invaluable assistance of many others) :Organization: The OpenCOBOL Project :Version: 1.0rc21, February 6, 2009 :Status: Release Candidate :Copyright: |copyleft| :ChangeLog: changelog_ .. note:: This FAQ is more than a FAQ and less than a FAQ, someday that will change and this document will be split into an OpenCOBOL manual and a simplified Frequently Asked Questions file. .. Attention:: Regarding COBOL Standards, Official COBOL Standards: There are many references to *standards* in this document. Very few of them are _technically_ correct references. Apologies to all the hard working men and women of the technical committees for this unintentional slight. For specific details on what wordings should be used please see `What are the Official COBOL Standards?`_ .. contents:: FAQ Contents depth 2 backlinks entry * Menu: * OpenCOBOL:: * History:: * Using OpenCOBOL:: * Notes:: * Authors:: * Maintainers and Contributors:: * ChangeLog::  File: ocfaq.info, Node: OpenCOBOL, Next: History, Up: OpenCOBOL FAQ 1.1 OpenCOBOL ============= * Menu: * What is OpenCOBOL?:: * What is COBOL?:: * How is OpenCOBOL licensed?:: * What platforms are supported by OpenCOBOL?:: * Are there pre-built OpenCOBOL packages:: * What is the most recent version of OpenCOBOL?:: * How complete is OpenCOBOL?:: * Will I be amazed by OpenCOBOL?:: * Who do I thank for OpenCOBOL?:: * Does OpenCOBOL include a Test Suite?:: * Does OpenCOBOL pass the NIST Test Suite?:: * What about OpenCOBOL and benchmarks?:: * Can OpenCOBOL be used for CGI?:: * Can OpenCOBOL be used for production applications?:: * Where can I get more information about COBOL?:: * Where can I get more information about OpenCOBOL?:: * Can I help out with the OpenCOBOL project?:: * Is there an OpenCOBOL mailing list?:: * Where can I find more information about COBOL standards?:: * Do you know any good jokes?::  File: ocfaq.info, Node: What is OpenCOBOL?, Next: What is COBOL?, Up: OpenCOBOL 1.1.1 What is OpenCOBOL? ------------------------ OpenCOBOL_ is an open-source COBOL_ compiler. OpenCOBOL implements a substantial part of the `COBOL 85`_ and `COBOL 2002`_ standards, as well as many extensions of the existent COBOL compilers. OpenCOBOL translates COBOL into C and compiles the translated code using the native C compiler. You can build your COBOL programs on various platforms, including Unix/Linux, Mac OS X, and Microsoft Windows.  File: ocfaq.info, Node: What is COBOL?, Next: How is OpenCOBOL licensed?, Prev: What is OpenCOBOL?, Up: OpenCOBOL 1.1.2 What is COBOL? -------------------- COBOL_ is an acronym for COmmon Business Oriented Language. This author has always thought of it as "Common Business" Oriented more than Common "Business Oriented", but that emphasis is perhaps up to the readers point of view.  File: ocfaq.info, Node: How is OpenCOBOL licensed?, Next: What platforms are supported by OpenCOBOL?, Prev: What is COBOL?, Up: OpenCOBOL 1.1.3 How is OpenCOBOL licensed? -------------------------------- The compiler is licensed under GNU General Public License (http://www.gnu.org/licenses/gpl.html). The run-time library is licensed under GNU Lesser General Public License (http://www.gnu.org/licenses/lgpl.html). All source codes are copyright by the respective authors. OpenCOBOL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.  File: ocfaq.info, Node: What platforms are supported by OpenCOBOL?, Next: Are there pre-built OpenCOBOL packages, Prev: How is OpenCOBOL licensed?, Up: OpenCOBOL 1.1.4 What platforms are supported by OpenCOBOL? ------------------------------------------------ `OpenCOBOL 1.0`_ the current official release version, hosted on SourceForge.net, compiles on: * All 32-bit MS Windows (95/98/NT/2000/XP) * All POSIX (Linux/BSD/UNIX-like OSes) * OS/X `OpenCOBOL 1.1`_, has been built on * MS Windows native * MS Windows with Cygwin * POSIX Systems including OpenSolaris * OS/X  File: ocfaq.info, Node: Are there pre-built OpenCOBOL packages, Next: What is the most recent version of OpenCOBOL?, Prev: What platforms are supported by OpenCOBOL?, Up: OpenCOBOL 1.1.5 Are there pre-built OpenCOBOL packages -------------------------------------------- Yes. Debian APT, and RPM packages exist. Packages for NetBSD. Many. Google _opencobol packages_ for any late breaking news. A Debian apt binary package exists for OpenCOBOL 1.0 as *open-cobol* and lists dependencies of * libc6 (>= 2.7-1), * libcob1, * libcob1-dev (= 1.0-1), * libdb4.5 (>= 4.5.20-3), * libdb4.5-dev, * libgmp3-dev, * libgmp3c2, * libltdl3-dev, * libncurses5 (>= 5.6+20071006-3) Thanks to the gracious efforts of Bart Martens, bartm on Debian's .org domain. Also check out http://www.kiska.net/opencobol/ (http://www.kiska.net/opencobol/) and http://www.kiska.net/opencobol/1.1/ (http://www.kiska.net/opencobol/1.1/) for binary builds on various platforms. Thanks to Sergey Kashyrin.  File: ocfaq.info, Node: What is the most recent version of OpenCOBOL?, Next: How complete is OpenCOBOL?, Prev: Are there pre-built OpenCOBOL packages, Up: OpenCOBOL 1.1.6 What is the most recent version of OpenCOBOL? --------------------------------------------------- See `What is the current version of OpenCOBOL?`_  File: ocfaq.info, Node: How complete is OpenCOBOL?, Next: Will I be amazed by OpenCOBOL?, Prev: What is the most recent version of OpenCOBOL?, Up: OpenCOBOL 1.1.7 How complete is OpenCOBOL? -------------------------------- `OpenCOBOL 1.0`_ implements a substantial portion of `COBOL 85`_, supports many of the advances and clarifications of `COBOL 2002`_, and includes many extensions in common use from Micro Focus COBOL, ACUCOBOL and other existent compilers. `OpenCOBOL 1.1`_ implements a more substantial portion of the `COBOL 85`_ Dialect, `COBOL 2002`_ and a growing number of vendor extensions. Some proposed COBOL 2008 features have also been implemented. Compatibility support includes: * MF for Micro Focus * IBM for IBM compatibility * MVS * BS2000 OpenCOBOL also includes some advanced features allowing source code such as CALL "cfunction" USING BY REFERENCE ADDRESS OF VAR-IN-LINKAGE-SECTION. Passing the equivalent of char**, pointer to pointer to char. Just as a small example of the level of coverage provided by OpenCOBOL. .. note:: While OpenCOBOL can be held to a high standard of quality and robustness, the authors _DO NOT_ claim it to be a "Standard Conforming" implementation of COBOL.  File: ocfaq.info, Node: Will I be amazed by OpenCOBOL?, Next: Who do I thank for OpenCOBOL?, Prev: How complete is OpenCOBOL?, Up: OpenCOBOL 1.1.8 Will I be amazed by OpenCOBOL? ------------------------------------ This author believes so. For an open source implementation of COBOL, OpenCOBOL may surprise you in the depth and breadth of its COBOL feature support, usability and robustness.  File: ocfaq.info, Node: Who do I thank for OpenCOBOL?, Next: Does OpenCOBOL include a Test Suite?, Prev: Will I be amazed by OpenCOBOL?, Up: OpenCOBOL 1.1.9 Who do I thank for OpenCOBOL? ----------------------------------- Many people. In particular Keisuke Nishida and Roger While. See the THANKS file in the source code archive for more names of people that have worked on the OpenCOBOL project. Roger points out that the list is woefully incomplete. To quote: The OC project would not have been where it is today without the significant/enormous help from many-many persons. The THANKS file does not even do justice to this.  File: ocfaq.info, Node: Does OpenCOBOL include a Test Suite?, Next: Does OpenCOBOL pass the NIST Test Suite?, Prev: Who do I thank for OpenCOBOL?, Up: OpenCOBOL 1.1.10 Does OpenCOBOL include a Test Suite? ------------------------------------------- Why yes it does. 74 syntax tests, 170 coverage tests, and 16 data representation tests at last count. From the development tarball: $ make check will evaluate and report on the test suite. From a run in December 2008: make check-recursive make[1]: Entering directory `open-cobol-1.1' Making check in lib make[2]: Entering directory `open-cobol-1.1/lib' make[2]: Nothing to be done for `check'. make[2]: Leaving directory `open-cobol-1.1/lib' Making check in libcob make[2]: Entering directory `open-cobol-1.1/libcob' make[2]: Nothing to be done for `check'. make[2]: Leaving directory `open-cobol-1.1/libcob' Making check in cobc make[2]: Entering directory `open-cobol-1.1/cobc' make check-am make[3]: Entering directory `open-cobol-1.1/cobc' make[3]: Nothing to be done for `check-am'. make[3]: Leaving directory `open-cobol-1.1/cobc' make[2]: Leaving directory `open-cobol-1.1/cobc' Making check in bin make[2]: Entering directory `open-cobol-1.1/bin' make[2]: Nothing to be done for `check'. make[2]: Leaving directory `open-cobol-1.1/bin' Making check in config make[2]: Entering directory `open-cobol-1.1/config' make[2]: Nothing to be done for `check'. make[2]: Leaving directory `open-cobol-1.1/config' Making check in copy make[2]: Entering directory `open-cobol-1.1/copy' make[2]: Nothing to be done for `check'. make[2]: Leaving directory `open-cobol-1.1/copy' Making check in po make[2]: Entering directory `open-cobol-1.1/po' make[2]: Nothing to be done for `check'. make[2]: Leaving directory `open-cobol-1.1/po' Making check in texi make[2]: Entering directory `open-cobol-1.1/texi' make[2]: Nothing to be done for `check'. make[2]: Leaving directory `open-cobol-1.1/texi' Making check in tests make[2]: Entering directory `open-cobol-1.1/tests' Making check in cobol85 make[3]: Entering directory `open-cobol-1.1/tests/cobol85' make[3]: Nothing to be done for `check'. make[3]: Leaving directory `open-cobol-1.1/tests/cobol85' make[3]: Entering directory `open-cobol-1.1/tests' make check-TESTS make[4]: Entering directory `open-cobol-1.1/tests' ## --------------------------------------- ## ## OpenCOBOL 1.1 test suite: Syntax Tests. ## ## --------------------------------------- ## 1: COPY: file not found ok 2: COPY: replacement order ok 3: COPY: separators ok 4: COPY: partial replacement ok 5: COPY: recursive replacement ok 6: Invalid PROGRAM-ID ok 7: Undefined data name ok 8: Undefined group name ok 9: Undefined data name in group ok 10: Reference not a group name ok 11: Incomplete 01 definition ok 12: Same labels in different sections ok 13: Redefinition of 01 items ok 14: Redefinition of 01 and 02 items ok 15: Redefinition of 02 items ok 16: Redefinition of 77 items ok 17: Redefinition of 01 and 77 items ok 18: Redefinition of 88 items ok 19: Ambiguous reference to 02 items ok 20: Ambiguous reference to 02 and 03 items ok 21: Ambigous reference with qualification ok 22: Unique reference with ambiguous qualifiers ok 23: Undefined procedure name ok 24: Redefinition of section names ok 25: Redefinition of section and paragraph names ok 26: Redefinition of paragraph names ok 27: Ambiguous reference to paragraph name ok 28: Non-matching level numbers (extension) ok 29: Ambiguous AND/OR ok 30: START on SEQUENTIAL file ok 31: Subscripted item requires OCCURS clause ok 32: The number of subscripts ok 33: OCCURS with level 01, 66, 77, and 88 ok 34: OCCURS with variable-occurrence data item ok 35: Nested OCCURS clause ok 36: OCCURS DEPENDING followed by another field ok 37: OCCURS DEPENDING without TO clause ok 38: REDEFINES: not following entry-name ok 39: REDEFINES: level 02 by 01 ok 40: REDEFINES: level 03 by 02 ok 41: REDEFINES: level 66 ok 42: REDEFINES: level 88 ok 43: REDEFINES: lower level number ok 44: REDEFINES: with OCCURS ok 45: REDEFINES: with subscript ok 46: REDEFINES: with variable occurrence ok 47: REDEFINES: with qualification ok 48: REDEFINES: multiple redefinition ok 49: REDEFINES: size exceeds ok 50: REDEFINES: with VALUE ok 51: REDEFINES: with intervention ok 52: REDEFINES: within REDEFINES ok 53: Numeric item (integer) ok 54: Numeric item (non-integer) ok 55: Numeric item with picture P ok 56: Signed numeric literal ok 57: Alphabetic item ok 58: Alphanumeric item ok 59: Alphanumeric group item ok 60: Numeric-edited item ok 61: Alphanumeric-edited item ok 62: MOVE SPACE TO numeric or numeric-edited item ok 63: MOVE ZERO TO alphabetic item ok 64: MOVE alphabetic TO x ok 65: MOVE alphanumeric TO x ok 66: MOVE alphanumeric-edited TO x ok 67: MOVE numeric (integer) TO x ok 68: MOVE numeric (non-integer) TO x ok 69: MOVE numeric-edited TO x ok 70: Operands must be groups ok 71: MOVE: misc ok 72: Category check of Format 1 ok 73: Category check of Format 2 ok 74: Category check of literals ok 75: SET: misc ok ## ------------- ## ## Test results. ## ## ------------- ## All 75 tests were successful. PASS: ./syntax ## ------------------------------------ ## ## OpenCOBOL 1.1 test suite: Run Tests. ## ## ------------------------------------ ## 1: DISPLAY literals ok 2: DISPLAY literals, Decimal Point is COMMA ok 3: Hexadecimal literal ok 4: DISPLAY data items with VALUE clause ok 5: DISPLAY data items with MOVE statement ok 6: GLOBAL at same level ok 7: GLOBAL at lower level ok 8: non-numeric subscript ok 9: The range of subscripts ok 10: Subscript out of bounds (1) ok 11: Subscript out of bounds (2) ok 12: Value of DEPENDING ON N out of bounds (lower)ok 13: Value of DEPENDING ON N out of bounds (upper)ok 14: Subscript bounds with ODO (lower) ok 15: Subscript bounds with ODO (upper) ok 16: Subscript bounds with ODO ok 17: Subscript by arithmetic expression ok 18: Separate sign positions ok 19: Static reference modification ok 20: Dynamic reference modification ok 21: Static out of bounds ok 22: Offset underflow ok 23: Offset overflow ok 24: Length underflow ok 25: Length overflow ok 26: ACCEPT ok 27: INITIALIZE group entry with OCCURS ok 28: INITIALIZE OCCURS with numeric edited ok 29: INITIALIZE complex group (1) ok 30: INITIALIZE complex group (2) ok 31: INITIALIZE with REDEFINES ok 32: Source file not found ok 33: Comma separator without space ok 34: LOCAL-STORAGE ok 35: EXTERNAL data item ok 36: EXTERNAL AS data item ok 37: cobcrun validation ok 38: MOVE to itself ok 39: MOVE with refmod ok 40: MOVE with refmod (variable) ok 41: MOVE with group refmod ok 42: MOVE indexes ok 43: MOVE X'00' ok 44: Level 01 subscripts ok 45: Class check with reference modification ok 46: Index and parenthesized expression ok 47: Alphanumeric and binary numeric ok 48: Dynamic call with static linking ok 49: CALL m1. CALL m2. CALL m1. ok 50: CALL binary literal parameter/LENGTH OF ok 51: INSPECT REPLACING LEADING ZEROS BY SPACES ok 52: INSPECT: No repeat conversion check ok 53: INSPECT: REPLACING figurative constant ok 54: INSPECT: TALLYING BEFORE ok 55: INSPECT: TALLYING AFTER ok 56: INSPECT REPLACING TRAILING ZEROS BY SPACES ok 57: INSPECT REPLACING complex ok 58: SWITCHES ok 59: Nested PERFORM ok 60: EXIT PERFORM ok 61: EXIT PERFORM CYCLE ok 62: EXIT PARAGRAPH ok 63: EXIT SECTION ok 64: 88 with FILLER ok 65: Non-overflow after overflow ok 66: PERFORM ... CONTINUE ok 67: STRING with subscript reference ok 68: UNSTRING DELIMITED ALL LOW-VALUE ok 69: READ INTO AT-END sequence ok 70: First READ on empty SEQUENTIAL INDEXED file ok 71: REWRITE a RELATIVE file with RANDOM access ok 72: SORT: table sort ok 73: SORT: EBCDIC table sort ok 74: SORT nonexistent file ok 75: PIC ZZZ-, ZZZ+ ok 76: Larger REDEFINES lengths ok 77: PERFORM type OSVS ok 78: Sticky LINKAGE ok 79: COB_PRE_LOAD test ok 80: COB_LOAD_CASE=UPPER test ok 81: 88 level with FALSE IS clause ok 82: ALLOCATE/FREE with BASED item ok 83: INITIZIALIZE with reference modification ok 84: CALL with OMITTED parameter ok 85: ANY LENGTH ok 86: BASED item non-ALLOCATED (debug) ok 87: COMP-5 ok 88: Hexadecimal numeric literal ok 89: Semi-parenthesized condition ok 90: ADDRESS OF ok 91: LENGTH OF ok 92: WHEN-COMPILED ok 93: Complex OCCURS DEPENDING ON ok 94: MOVE NON-INTEGER TO ALPHA-NUMERIC ok 95: CALL USING file-name ok 96: CALL unusual program-id. ok 97: ASSIGN MF ok 98: ASSIGN IBM ok 99: ASSIGN mapping ok 100: ASSIGN expansion ok 101: ASSIGN with COB_FILE_PATH ok 102: NUMBER-OF-CALL-PARAMETERS ok 103: PROCEDURE DIVISION USING BY ... ok 104: PROCEDURE DIVISION CHAINING ... ok 105: STOP RUN RETURNING ok 106: ENTRY ok 107: LINE SEQUENTIAL write ok 108: LINE SEQUENTIAL read ok 109: ASSIGN to KEYBOARD/DISPLAY ok 110: Environment/Argument variable ok 111: RETURN-CODE moving ok 112: RETURN-CODE passing ok 113: FUNCTION ABS ok 114: FUNCTION ACOS ok 115: FUNCTION ANNUITY ok 116: FUNCTION ASIN ok 117: FUNCTION ATAN ok 118: FUNCTION CHAR ok 119: FUNCTION COMBINED-DATETIME ok 120: FUNCTION COS ok 121: FUNCTION DATE-OF-INTEGER ok 122: FUNCTION DATE-TO-YYYYMMDD ok 123: FUNCTION DAY-OF-INTEGER ok 124: FUNCTION DAY-TO-YYYYDDD ok 125: FUNCTION E ok 126: FUNCTION EXCEPTION-FILE ok 127: FUNCTION EXCEPTION-LOCATION ok 128: FUNCTION EXCEPTION-STATEMENT ok 129: FUNCTION EXCEPTION-STATUS ok 130: FUNCTION EXP ok 131: FUNCTION FACTORIAL ok 132: FUNCTION FRACTION-PART ok 133: FUNCTION INTEGER ok 134: FUNCTION INTEGER-OF-DATE ok 135: FUNCTION INTEGER-OF-DAY ok 136: FUNCTION INTEGER-PART ok 137: FUNCTION LENGTH ok 138: FUNCTION LOCALE-DATE ok 139: FUNCTION LOCALE-TIME ok 140: FUNCTION LOCALE-TIME-FROM-SECONDS ok 141: FUNCTION LOG ok 142: FUNCTION LOG10 ok 143: FUNCTION LOWER-CASE ok 144: FUNCTION LOWER-CASE with reference modding ok 145: FUNCTION MAX ok 146: FUNCTION MEAN ok 147: FUNCTION MEDIAN ok 148: FUNCTION MIDRANGE ok 149: FUNCTION MIN ok 150: FUNCTION MOD ok 151: FUNCTION NUMVAL ok 152: FUNCTION NUMVAL-C ok 153: FUNCTION ORD ok 154: FUNCTION ORD-MAX ok 155: FUNCTION ORD-MIN ok 156: FUNCTION PI ok 157: FUNCTION PRESENT-VALUE ok 158: FUNCTION RANGE ok 159: FUNCTION REM ok 160: FUNCTION REVERSE ok 161: FUNCTION REVERSE with reference modding ok 162: FUNCTION SECONDS-FROM-FORMATTED-TIME ok 163: FUNCTION SECONDS-PAST-MIDNIGHT ok 164: FUNCTION SIGN ok 165: FUNCTION SIN ok 166: FUNCTION SQRT ok 167: FUNCTION STANDARD-DEVIATION ok 168: FUNCTION STORED-CHAR-LENGTH ok 169: FUNCTION TAN ok 170: FUNCTION TRIM ok 171: FUNCTION TRIM with reference modding ok 172: FUNCTION UPPER-CASE ok 173: FUNCTION UPPER-CASE with reference modding ok 174: FUNCTION VARIANCE ok 175: FUNCTION WHEN-COMPILED ok ## ------------- ## ## Test results. ## ## ------------- ## All 175 tests were successful. PASS: ./run ## Run time tests with -O option ## ## ------------------------------------ ## ## OpenCOBOL 1.1 test suite: Run Tests. ## ## ------------------------------------ ## 1: DISPLAY literals ok 2: DISPLAY literals, Decimal Point is COMMA ok 3: Hexadecimal literal ok 4: DISPLAY data items with VALUE clause ok 5: DISPLAY data items with MOVE statement ok 6: GLOBAL at same level ok 7: GLOBAL at lower level ok 8: non-numeric subscript ok 9: The range of subscripts ok 10: Subscript out of bounds (1) ok 11: Subscript out of bounds (2) ok 12: Value of DEPENDING ON N out of bounds (lower)ok 13: Value of DEPENDING ON N out of bounds (upper)ok 14: Subscript bounds with ODO (lower) ok 15: Subscript bounds with ODO (upper) ok 16: Subscript bounds with ODO ok 17: Subscript by arithmetic expression ok 18: Separate sign positions ok 19: Static reference modification ok 20: Dynamic reference modification ok 21: Static out of bounds ok 22: Offset underflow ok 23: Offset overflow ok 24: Length underflow ok 25: Length overflow ok 26: ACCEPT ok 27: INITIALIZE group entry with OCCURS ok 28: INITIALIZE OCCURS with numeric edited ok 29: INITIALIZE complex group (1) ok 30: INITIALIZE complex group (2) ok 31: INITIALIZE with REDEFINES ok 32: Source file not found ok 33: Comma separator without space ok 34: LOCAL-STORAGE ok 35: EXTERNAL data item ok 36: EXTERNAL AS data item ok 37: cobcrun validation ok 38: MOVE to itself ok 39: MOVE with refmod ok 40: MOVE with refmod (variable) ok 41: MOVE with group refmod ok 42: MOVE indexes ok 43: MOVE X'00' ok 44: Level 01 subscripts ok 45: Class check with reference modification ok 46: Index and parenthesized expression ok 47: Alphanumeric and binary numeric ok 48: Dynamic call with static linking ok 49: CALL m1. CALL m2. CALL m1. ok 50: CALL binary literal parameter/LENGTH OF ok 51: INSPECT REPLACING LEADING ZEROS BY SPACES ok 52: INSPECT: No repeat conversion check ok 53: INSPECT: REPLACING figurative constant ok 54: INSPECT: TALLYING BEFORE ok 55: INSPECT: TALLYING AFTER ok 56: INSPECT REPLACING TRAILING ZEROS BY SPACES ok 57: INSPECT REPLACING complex ok 58: SWITCHES ok 59: Nested PERFORM ok 60: EXIT PERFORM ok 61: EXIT PERFORM CYCLE ok 62: EXIT PARAGRAPH ok 63: EXIT SECTION ok 64: 88 with FILLER ok 65: Non-overflow after overflow ok 66: PERFORM ... CONTINUE ok 67: STRING with subscript reference ok 68: UNSTRING DELIMITED ALL LOW-VALUE ok 69: READ INTO AT-END sequence ok 70: First READ on empty SEQUENTIAL INDEXED file ok 71: REWRITE a RELATIVE file with RANDOM access ok 72: SORT: table sort ok 73: SORT: EBCDIC table sort ok 74: SORT nonexistent file ok 75: PIC ZZZ-, ZZZ+ ok 76: Larger REDEFINES lengths ok 77: PERFORM type OSVS ok 78: Sticky LINKAGE ok 79: COB_PRE_LOAD test ok 80: COB_LOAD_CASE=UPPER test ok 81: 88 level with FALSE IS clause ok 82: ALLOCATE/FREE with BASED item ok 83: INITIZIALIZE with reference modification ok 84: CALL with OMITTED parameter ok 85: ANY LENGTH ok 86: BASED item non-ALLOCATED (debug) ok 87: COMP-5 ok 88: Hexadecimal numeric literal ok 89: Semi-parenthesized condition ok 90: ADDRESS OF ok 91: LENGTH OF ok 92: WHEN-COMPILED ok 93: Complex OCCURS DEPENDING ON ok 94: MOVE NON-INTEGER TO ALPHA-NUMERIC ok 95: CALL USING file-name ok 96: CALL unusual program-id. ok 97: ASSIGN MF ok 98: ASSIGN IBM ok 99: ASSIGN mapping ok 100: ASSIGN expansion ok 101: ASSIGN with COB_FILE_PATH ok 102: NUMBER-OF-CALL-PARAMETERS ok 103: PROCEDURE DIVISION USING BY ... ok 104: PROCEDURE DIVISION CHAINING ... ok 105: STOP RUN RETURNING ok 106: ENTRY ok 107: LINE SEQUENTIAL write ok 108: LINE SEQUENTIAL read ok 109: ASSIGN to KEYBOARD/DISPLAY ok 110: Environment/Argument variable ok 111: RETURN-CODE moving ok 112: RETURN-CODE passing ok 113: FUNCTION ABS ok 114: FUNCTION ACOS ok 115: FUNCTION ANNUITY ok 116: FUNCTION ASIN ok 117: FUNCTION ATAN ok 118: FUNCTION CHAR ok 119: FUNCTION COMBINED-DATETIME ok 120: FUNCTION COS ok 121: FUNCTION DATE-OF-INTEGER ok 122: FUNCTION DATE-TO-YYYYMMDD ok 123: FUNCTION DAY-OF-INTEGER ok 124: FUNCTION DAY-TO-YYYYDDD ok 125: FUNCTION E ok 126: FUNCTION EXCEPTION-FILE ok 127: FUNCTION EXCEPTION-LOCATION ok 128: FUNCTION EXCEPTION-STATEMENT ok 129: FUNCTION EXCEPTION-STATUS ok 130: FUNCTION EXP ok 131: FUNCTION FACTORIAL ok 132: FUNCTION FRACTION-PART ok 133: FUNCTION INTEGER ok 134: FUNCTION INTEGER-OF-DATE ok 135: FUNCTION INTEGER-OF-DAY ok 136: FUNCTION INTEGER-PART ok 137: FUNCTION LENGTH ok 138: FUNCTION LOCALE-DATE ok 139: FUNCTION LOCALE-TIME ok 140: FUNCTION LOCALE-TIME-FROM-SECONDS ok 141: FUNCTION LOG ok 142: FUNCTION LOG10 ok 143: FUNCTION LOWER-CASE ok 144: FUNCTION LOWER-CASE with reference modding ok 145: FUNCTION MAX ok 146: FUNCTION MEAN ok 147: FUNCTION MEDIAN ok 148: FUNCTION MIDRANGE ok 149: FUNCTION MIN ok 150: FUNCTION MOD ok 151: FUNCTION NUMVAL ok 152: FUNCTION NUMVAL-C ok 153: FUNCTION ORD ok 154: FUNCTION ORD-MAX ok 155: FUNCTION ORD-MIN ok 156: FUNCTION PI ok 157: FUNCTION PRESENT-VALUE ok 158: FUNCTION RANGE ok 159: FUNCTION REM ok 160: FUNCTION REVERSE ok 161: FUNCTION REVERSE with reference modding ok 162: FUNCTION SECONDS-FROM-FORMATTED-TIME ok 163: FUNCTION SECONDS-PAST-MIDNIGHT ok 164: FUNCTION SIGN ok 165: FUNCTION SIN ok 166: FUNCTION SQRT ok 167: FUNCTION STANDARD-DEVIATION ok 168: FUNCTION STORED-CHAR-LENGTH ok 169: FUNCTION TAN ok 170: FUNCTION TRIM ok 171: FUNCTION TRIM with reference modding ok 172: FUNCTION UPPER-CASE ok 173: FUNCTION UPPER-CASE with reference modding ok 174: FUNCTION VARIANCE ok 175: FUNCTION WHEN-COMPILED ok ## ------------- ## ## Test results. ## ## ------------- ## All 175 tests were successful. PASS: ./run-O ## ---------------------------------------------- ## ## OpenCOBOL 1.1 test suite: Data Representation. ## ## ---------------------------------------------- ## 1: BINARY: 2-4-8 big-endian ok 2: BINARY: 2-4-8 native ok 3: BINARY: 1-2-4-8 big-endian ok 4: BINARY: 1-2-4-8 native ok 5: BINARY: 1--8 big-endian ok 6: BINARY: 1--8 native ok 7: BINARY: full-print ok 8: DISPLAY: Sign ascii ok 9: DISPLAY: Sign ebcdic ok 10: PACKED-DECIMAL dump ok 11: PACKED-DECIMAL display ok 12: PACKED-DECIMAL move ok 13: PACKED-DECIMAL arithmetic (1) ok 14: PACKED-DECIMAL arithmetic (2) ok 15: PACKED-DECIMAL numeric test ok 16: POINTER: display ok ## ------------- ## ## Test results. ## ## ------------- ## All 16 tests were successful. PASS: ./data-rep ## Data representation tests with -O option ## ## ---------------------------------------------- ## ## OpenCOBOL 1.1 test suite: Data Representation. ## ## ---------------------------------------------- ## 1: BINARY: 2-4-8 big-endian ok 2: BINARY: 2-4-8 native ok 3: BINARY: 1-2-4-8 big-endian ok 4: BINARY: 1-2-4-8 native ok 5: BINARY: 1--8 big-endian ok 6: BINARY: 1--8 native ok 7: BINARY: full-print ok 8: DISPLAY: Sign ascii ok 9: DISPLAY: Sign ebcdic ok 10: PACKED-DECIMAL dump ok 11: PACKED-DECIMAL display ok 12: PACKED-DECIMAL move ok 13: PACKED-DECIMAL arithmetic (1) ok 14: PACKED-DECIMAL arithmetic (2) ok 15: PACKED-DECIMAL numeric test ok 16: POINTER: display ok ## ------------- ## ## Test results. ## ## ------------- ## All 16 tests were successful. PASS: ./data-rep-O ================== All 5 tests passed ==================  File: ocfaq.info, Node: Does OpenCOBOL pass the NIST Test Suite?, Next: What about OpenCOBOL and benchmarks?, Prev: Does OpenCOBOL include a Test Suite?, Up: OpenCOBOL 1.1.11 Does OpenCOBOL pass the NIST Test Suite? ----------------------------------------------- OpenCOBOL passes many of the tests included in the NIST sponsored COBOL 85 test suite. While it passes over 9000 of the tests, OpenCOBOL does not claim conformance to any level of COBOL _Standard_. The National Institute of Standards and Technology, NIST, maintains a COBOL 85 implementation verification suite of tests. An archive of the tests can be found at http://www.itl.nist.gov/div897/ctg/cobol_form.htm (http://www.itl.nist.gov/div897/ctg/cobol_form.htm) Instructions for use of the NIST suite is included in the build archive under: tests/cobol85/README Basically, it is a simple *uncompress* and *make* then sit back and relax. The scripts run OpenCOBOL over some 364 programs/modules and includes thousands of test passes. Test Modules ------------ Core tests: NC - COBOL nucleus tests SM - COPY sentence tests IC - CALL sentence tests File I-O tests: SQ - Sequential file I-O tests RL - Relative file I-O tests IX - Indexed file I-O tests ST - SORT sentence tests Advanced facilities: IF - Intrinsic Function tests With the addition of GLOBAL support, the OpenCOBOL 1.1 pre-release fails none of the attempted tests. The summary.log from a run in February 2009: ------ Directory Information ------- --- Total Tests Information --- Module Programs Executed Error Crash Pass Fail Deleted Inspect Total ------ -------- -------- ----- ----- ----- ---- ------- ------- ----- NC 92 92 0 0 4363 0 6 11 4380 SM 15 15 0 0 290 0 3 1 294 IC 24 24 0 0 246 0 4 0 250 SQ 81 81 0 0 512 0 6 81 599 RL 32 32 0 0 1827 0 5 0 1832 IX 39 39 0 0 507 0 1 0 508 ST 39 39 0 0 278 0 0 0 278 SG 5 5 0 0 193 0 0 0 193 OB 5 5 0 0 16 0 0 0 16 IF 42 42 0 0 732 0 0 0 732 ------ -------- -------- ----- ----- ----- ---- ------- ------- ----- Total 374 374 0 0 8964 0 25 93 9082  File: ocfaq.info, Node: What about OpenCOBOL and benchmarks?, Next: Can OpenCOBOL be used for CGI?, Prev: Does OpenCOBOL pass the NIST Test Suite?, Up: OpenCOBOL 1.1.12 What about OpenCOBOL and benchmarks? ------------------------------------------- COBOL has a legacy dating back to 1959. Many features of the COBOL standard provide defaults more suitable to mainframe architecture than the personal computer a 3rd millennium OpenCOBOL developer will likely be using. OpenCOBOL, by default, generates code optimized for big-endian_ hardware. Fairly dramatic speed improvements on Intel architecture can come from simple *USAGE IS COMPUTATIONAL-5* clauses in the DATA DIVISION.  File: ocfaq.info, Node: Can OpenCOBOL be used for CGI?, Next: Can OpenCOBOL be used for production applications?, Prev: What about OpenCOBOL and benchmarks?, Up: OpenCOBOL 1.1.13 Can OpenCOBOL be used for CGI? ------------------------------------- Yes. Through standard IO redirection and the extended *ACCEPT ... FROM ENVIRONMENT ...* feature, OpenCOBOL is more than capable of supporting advanced CGI programming. COBOL >>SOURCE FORMAT IS FIXED ********************************_*_ Author: Brian Tiffin, Francois Hiniger * Date: 30-Aug-2008 * Purpose: Display the CGI environment space * Tectonics: cobc -x cgienv.cob * Move cgienv to the cgi-bin directory as cgienv.cgi * browse http://localhost/cgi-bin/cgienv.cgi (http://localhost/cgi-bin/cgienv.cgi) or cgienvform.html********************************** identification division. program-id. cgienv. environment division. input-output section. file-control. select webinput assign to KEYBOARD. data division. file section. fd webinput. 01 postchunk pic x(1024). working-storage section. 78 name-count value 34. 01 newline pic x value x'0a'. 01 name-index pic 99 usage comp-5. 01 value-string pic x(256). 01 environment-names. 02 name-strings. 03 filler pic x(20) value 'AUTH_TYPE'. 03 filler pic x(20) value 'CONTENT_LENGTH'. 03 filler pic x(20) value 'CONTENT_TYPE'. 03 filler pic x(20) value 'DOCUMENT_ROOT'. 03 filler pic x(20) value 'GATEWAY_INTERFACE'. 03 filler pic x(20) value 'HTTP_ACCEPT'. 03 filler pic x(20) value 'HTTP_ACCEPT_CHARSET'. 03 filler pic x(20) value 'HTTP_ACCEPT_ENCODING'. 03 filler pic x(20) value 'HTTP_ACCEPT_LANGUAGE'. 03 filler pic x(20) value 'HTTP_COOKIE'. 03 filler pic x(20) value 'HTTP_CONNECTION'. 03 filler pic x(20) value 'HTTP_HOST'. 03 filler pic x(20) value 'HTTP_REFERER'. 03 filler pic x(20) value 'HTTP_USER_AGENT'. 03 filler pic x(20) value 'LIB_PATH'. 03 filler pic x(20) value 'PATH'. 03 filler pic x(20) value 'PATH_INFO'. 03 filler pic x(20) value 'PATH_TRANSLATED'. 03 filler pic x(20) value 'QUERY_STRING'. 03 filler pic x(20) value 'REMOTE_ADDR'. 03 filler pic x(20) value 'REMOTE_HOST'. 03 filler pic x(20) value 'REMOTE_IDENT'. 03 filler pic x(20) value 'REMOTE_PORT'. 03 filler pic x(20) value 'REQUEST_METHOD'. 03 filler pic x(20) value 'REQUEST_URI'. 03 filler pic x(20) value 'SCRIPT_FILENAME'. 03 filler pic x(20) value 'SCRIPT_NAME'. 03 filler pic x(20) value 'SERVER_ADDR'. 03 filler pic x(20) value 'SERVER_ADMIN'. 03 filler pic x(20) value 'SERVER_NAME'. 03 filler pic x(20) value 'SERVER_PORT'. 03 filler pic x(20) value 'SERVER_PROTOCOL'. 03 filler pic x(20) value 'SERVER_SIGNATURE'. 03 filler pic x(20) value 'SERVER_SOFTWARE'. 02 filler redefines name-strings. 03 name-string pic x(20) occurs name-count times. procedure division. * Always send out the Content-type before any other IO display "Content-type: text/html" newline end-display. display "" end-display. display "

CGI environment with OpenCOBOL

" end-display. display 'To cgienvform.html' "

" end-display. * Accept and display some of the known CGI environment values perform varying name-index from 1 by 1 until name-index > name-count accept value-string from environment name-string(name-index) end-accept display "" end-display if (name-string(name-index) = "REQUEST_METHOD") and (value-string = "POST") open input webinput read webinput at end move spaces to postchunk end-read close webinput display '" end-display end-if end-perform. display "
" name-string(name-index) ": " function trim (value-string trailing) "
' "First chunk of POST:" postchunk(1:72) "

" end-display. COOL goback. cgienv.cgi form OpenCOBOL sample CGI form

OpenCOBOL sample CGI form

Text:
Password:
Checkbox:
One
Two

 File: ocfaq.info, Node: Can OpenCOBOL be used for production applications?, Next: Where can I get more information about COBOL?, Prev: Can OpenCOBOL be used for CGI?, Up: OpenCOBOL 1.1.14 Can OpenCOBOL be used for production applications? --------------------------------------------------------- Depends. OpenCOBOL is still in active development. Feature coverage is growing, and while the current implementation offers great coverage, applicability to any given situation would need to analyzed and risks evaluated before commitment to production use. The licensing allows for commercial use, but OpenCOBOL also ships with notice of indemnity, meaning that there are no guarantees when using OpenCOBOL, directly or indirectly. There may be a time when commercial support of OpenCOBOL is offered, but at the time of writing no known offering exists. _Search google just in case!_ And yes, OpenCOBOL is used in production environments. From [Roger]_: Incidentally, OC has been (and still is) used in production environments since 2005. (This includes projects that I personally worked on plus other   projects reported to me; these worldwide) The OC project would not have been where it is today without the significant/enormous help from many-many persons. The THANKS file does not even do justice to this.  File: ocfaq.info, Node: Where can I get more information about COBOL?, Next: Where can I get more information about OpenCOBOL?, Prev: Can OpenCOBOL be used for production applications?, Up: OpenCOBOL 1.1.15 Where can I get more information about COBOL? ---------------------------------------------------- The `COBOL FAQ`_ by William M Klein is a great place to start. A google of the search words "COBOL" or "OpenCOBOL" are bound to lead to enough days worth of reading of in-depth articles, opinions and technical information to satisfy the greatest of curiosities. The COBUG_ site _COBOL User Groups_ is also a wonderful resource for OpenCOBOL developers.  File: ocfaq.info, Node: Where can I get more information about OpenCOBOL?, Next: Can I help out with the OpenCOBOL project?, Prev: Where can I get more information about COBOL?, Up: OpenCOBOL 1.1.16 Where can I get more information about OpenCOBOL? -------------------------------------------------------- The opencobol.org_ website is probably the best place to find out more about the OpenCOBOL system.  File: ocfaq.info, Node: Can I help out with the OpenCOBOL project?, Next: Is there an OpenCOBOL mailing list?, Prev: Where can I get more information about OpenCOBOL?, Up: OpenCOBOL 1.1.17 Can I help out with the OpenCOBOL project? ------------------------------------------------- Absolutely. Visit the opencobol.org_ website and either post a message asking what needs to be done, or perhaps join the development mailing list to find out the current state of development. See `Is there an OpenCOBOL mailing list?`_ for some details. OpenCOBOL is a GPL licensed open source project and while [Roger]_ is the lead developer he is quite open to code submissions. Having a central point of development allows for consistency and the very high level of quality control enjoyed by OpenCOBOL users.  File: ocfaq.info, Node: Is there an OpenCOBOL mailing list?, Next: Where can I find more information about COBOL standards?, Prev: Can I help out with the OpenCOBOL project?, Up: OpenCOBOL 1.1.18 Is there an OpenCOBOL mailing list? ------------------------------------------ Yes. Visit opencobol.org_ for details. The OpenCOBOL development mailing list is graciously hosted by SourceForge. The ML archive is available at http://sourceforge.net/mailarchive/forum.php?forum_name=open-cobol-list (http://sourceforge.net/mailarchive/forum.php?forum_name=open-cobol-list) and once you have subscribed, the list will accept messages at the open-cobol-list email destination at lists.sourceforge.net.  File: ocfaq.info, Node: Where can I find more information about COBOL standards?, Next: Do you know any good jokes?, Prev: Is there an OpenCOBOL mailing list?, Up: OpenCOBOL 1.1.19 Where can I find more information about COBOL standards? --------------------------------------------------------------- The `COBOL 85`_ standard is documented in * ANSI X3.23-1985 * ISO 1989-1985 * ANSI X3.23a-1989 * ANSI X3.23b-1993  File: ocfaq.info, Node: Do you know any good jokes?, Prev: Where can I find more information about COBOL standards?, Up: OpenCOBOL 1.1.20 Do you know any good jokes? ---------------------------------- Maybe. * A computer without COBOL and Fortran is like a piece of chocolate cake without ketchup or mustard. _John Krueger_ * A determined coder can write COBOL programs in any language. _Author: unknown_ * Rumour has it that the object oriented specification for COBOL was code named _ADD 1 TO COBOL GIVING COBOL._ _Author: unknown_ A less verbose, more concise version; _very unCOBOL that_ _ADD 1 TO COBOL._ _Thanks to aoirthoir_ And, just because; _ADD 1 TO COBOL GIVING OpenCOBOL_ * A common disrepect of COBOL joke is that the acronym stands for: Completely Obsolete Business Oriented Language. _Author unkown_ We know better. The reality is: Can't Obsolesce Because Of Legacy. _And why would you want to?_ _Brian Tiffin_ * COBOL Certainly Old But Often Limber. _Brian Tiffin_ * Ruby on Rails? Don't forget COBOL ON COGS. http://www.coboloncogs.org/INDEX.HTM (http://www.coboloncogs.org/INDEX.HTM) * Eat COBOL, 200 billion lines can't be wrong. _Brian Tiffin_ * What did COBOL yell to the escaping thief? *STOP RUN RETURNING NOW.* _Brian Tiffin_ * What did COBOL reply to the executive? _Why yes, I can_ *PERFORM JUMPS THRU HOOPS.* _Brian Tiffin_ * What did OpenCOBOL reply to the executive? _Sir, I can_ *PERFORM JUMPS THRU FLAMING-HOOPS UNTIL HELL-FREEZES-OVER.* _And being COBOL, I have to show you how little code it takes:_ identification division. program-id. freeze. data division. working-storage section. 01 hell pic 9. 88 hell-freezes-over value 1. procedure division. perform jumps thru flaming-hoops until hell-freezes-over. stop run. jumps. flaming-hoops. divide 1 by 0 giving hell. _Brian Tiffin_ And how about a 5-7-5 haiku? program-id. no. procedure division. add 1 to return-code. _Brian Tiffin_  File: ocfaq.info, Node: History, Next: Using OpenCOBOL, Prev: OpenCOBOL, Up: OpenCOBOL FAQ 1.2 History =========== * Menu: * What is the history of COBOL?:: * What are the Official COBOL Standards?:: * What is the development history of OpenCOBOL?:: * What is the current version of OpenCOBOL?::  File: ocfaq.info, Node: What is the history of COBOL?, Next: What are the Official COBOL Standards?, Up: History 1.2.1 What is the history of COBOL? ----------------------------------- Starting in 1959, a committee was formed under the sponsorship of the United States Department of Defense to recommend a short range option regarding business computing. The Conference on Data System Languages (CODASYL) led by Joe Wegstein of National Bureau of Standards (now National Institute of Standards and Technology) developed a new language, and created the first standardized business computer programming language. The COmmon Business Oriented Language acronym was announced on September 18th, 1959. Late in 1960, _essentially_ the same COBOL program ran on two different hardware platforms, and stakeholders espied the potential for fulfilling the objective of industry wide, compatible business systems. Admiral Grace Hopper (http://en.wikipedia.org/wiki/Grace_Hopper) is affectionately referred to as the _mother of the COBOL language_ as she and her previous work with FLOW-MATIC greatly influenced the specifications of the first COBOL. Standards have been published for: * COBOL-68 * COBOL-74 * COBOL-85 * COBOL-2002 * Draft work for COBOL-2008 is |currently| underway and these roughly correspond to the year they were produced. Note the y2k flavour of four digit naming occurred after the millennium change. Estimates vary, but it is entirely reasonable to believe that of the some 300,000,000,000 (three hundred thousand million) lines of computer source code in production today, 200,000,000,000 (two hundred thousand million) lines are COBOL. A full 2/3rds of the world's source code. See the Wikipedia entry for COBOL_ for a lot more details.  File: ocfaq.info, Node: What are the Official COBOL Standards?, Next: What is the development history of OpenCOBOL?, Prev: What is the history of COBOL?, Up: History 1.2.2 What are the Official COBOL Standards? -------------------------------------------- Many thanks to William Klein for details on what wordings are to be used when referencing COBOL Standards: There are several references to "COBOL 85" and these are often distinguished from "Intrinsic Functions". The official (but really obscure) term that should be used is "Amended Third Standard COBOL". The "clearer" (and IMHO better) term that should be used is something like - "'85 Standard COBOL with its amendments" By 1991 (actually 1993 for ISO rather than ANSI) there was no such thing as "just '85 Standard COBOL". The only recognized Standard was the "base" document (X3.23-1985) ALONG with its two amendments - Intrinsic Functions Module Amendment - Corrections Amendment An interesting related fact is that the "Intrinsic Functions Module" was OPTIONAL in the ANSI and ISO COBOL Standards but was REQUIRED (at the HIGH level) for FIPS COBOL. As the "certification tests" were aimed at getting US government contracts, most vendors (who were still doing certification) actually treated Intrinsic Functions required not optional for "High-level" certification. (They were NOT included in the FIPS intermediate certification process). Bottom-Line: Although some intrinsic functions were added in the '02 Standard (and more are included in the draft revision), it is not proper (in my opinion) to distinguish between supporting the '85 Standard and supporting intrinsic functions. P.S. The corrections amendment did make some technical changes but all of these were included in the '02 Standard. Therefore, hopefully, what it did won't impact OpenCOBOL much.  File: ocfaq.info, Node: What is the development history of OpenCOBOL?, Next: What is the current version of OpenCOBOL?, Prev: What are the Official COBOL Standards?, Up: History 1.2.3 What is the development history of OpenCOBOL? --------------------------------------------------- OpenCOBOL was initially developed by Keisuke Nishida [Keisuke]_ from experience working on TinyCOBOL (http://tiny-cobol.sourceforge.net/index.php) originally developed by Rildo Pragana. The first public release was version 0.9.0 on January 25th, 2002. Development continued apace, with version 0.30 released by Keisuke on August 8th, 2004. Roger While [Roger]_ then took up the role as lead developer on October 30th, 2004. Version 0.31 was released February 1st, 2005. Version 0.32 was released May 12th, 2005. Version 0.33 started on May 13th, 2005. Version 1.0 was released on December 27th, 2007.  File: ocfaq.info, Node: What is the current version of OpenCOBOL?, Prev: What is the development history of OpenCOBOL?, Up: History 1.2.4 What is the current version of OpenCOBOL? ----------------------------------------------- OpenCOBOL 1.0 was released December 27th, 2007 by Roger While [Roger]_. The decision to go 1.0 from the 0.33 version followed many incremental enhancements from 2005 through till late in 2007. OpenCOBOL 1.1 pre-release became active on December 27th, 2007 and is |currently| in active development. The pre-release source tar can be found at `OpenCOBOL 1.1`_ with installer instructions at `OpenCOBOL Install`_ and in the INSTALLING text file of the sources. After a download $ ./configure $ make $ make check $ sudo make install will place a new set of binaries rooted off */usr/local* If you build a pre-release OC1.1, you will be able to compile the *occurlrefresh.cbl* (with *occurlsym.cpy*) application and an early *occurl.c* libCURL wrapper that allows file transfers off the Internet. *occurlrefresh* includes default filenames for retrieving the most recent pre-release source archive and only updates the local copy if there has been a newer upload. Thanks to [aoirthoir]_ for hosting these; |currently| at occurlrefresh.cbl (http://opencobol.add1tocobol.com/occurlrefresh.cbl) occurlsym.cpy (http://opencobol.add1tocobol.com/occurlsym.cpy) occurl.c (http://opencobol.add1tocobol.com/occurl.c) and then simply $ ./occurlrefresh to download any new development archives. libCURL tests the modification timestamps, so this procedure is very resource efficient, only pulling from the server if there is something new.  File: ocfaq.info, Node: Using OpenCOBOL, Next: Notes, Prev: History, Up: OpenCOBOL FAQ 1.3 Using OpenCOBOL =================== * Menu: * How do I install OpenCOBOL?:: * What are the configure options available for building OpenCOBOL?:: * Does OpenCOBOL have any other dependencies?:: * How does the OpenCOBOL compiler work?:: * What is cobc?:: * What is cobcrun?:: * What is cob-config?:: * What compiler options are supported?:: * What dialects are supported by OpenCOBOL?:: * What are the OpenCOBOL compile time configuration files?:: * Do you have a reasonable source code skeleton for OpenCOBOL?:: * What is ocdoc?:: * Does OpenCOBOL support any SQL databases?:: * What are the OpenCOBOL RESERVED WORDS?:: * Does OpenCOBOL support modules?:: * What is COB_PRE_LOAD?:: * What is the OpenCOBOL LINKAGE SECTION for?:: * What does the -fstatic-linkage OpenCOBOL compiler option do?:: * Can OpenCOBOL interface with Ada?:: * Does OpenCOBOL support SCREEN SECTION?:: * What are the OpenCOBOL SCREEN SECTION colour values?:: * Does OpenCOBOL support CRT STATUS?:: * What is CobCurses?:: * What is CobXRef?:: * Does OpenCOBOL implement Report Writer?:: * Does OpenCOBOL implement LINAGE?:: * Does OpenCOBOL implement any Intrinsic FUNCTIONs?:: * Can you clarify the use of FUNCTION in OpenCOBOL?:: * What is the difference between the LENGTH verb and FUNCTION LENGTH?:: * What STOCK CALL LIBRARY does OpenCOBOL offer?:: * What are the XF4 XF5 and X91 routines?:: * What is CBL_OC_NANOSLEEP OpenCOBOL library routine?:: * Can I run background processes using OpenCOBOL?:: * Can I use ctags with OpenCOBOL?:: * What about debugging OpenCOBOL programs?:: * Is there a C interface to OpenCOBOL?:: * What are some idioms for dealing with C char * data from OpenCOBOL?:: * Does OpenCOBOL support COPY includes?:: * Does OpenCOBOL support WHEN-COMPILED?:: * What is PI in OpenCOBOL?:: * Does OpenCOBOL support the Object features of the 2002 standard?:: * Does OpenCOBOL implement PICTURE 78?:: * Does OpenCOBOL implement CONSTANT?:: * What source formats are accepted by OpenCOBOL?:: * Does OpenCOBOL support continuation lines?:: * Does OpenCOBOL support string concatenation?:: * Does OpenCOBOL support D indicator debug lines?:: * Does OpenCOBOL support mixed case source code?:: * What is the shortest OpenCOBOL program?:: * What is the shortest Hello World program in OpenCOBOL?:: * How do I get those nifty sequential sequence numbers in a source file?:: * Is there a way to count trailing spaces in data fields using OpenCOBOL?:: * Is there a way to left justify an edited numeric field?:: * Is there a way to detemermine when OpenCOBOL is running ASCII or EBCDIC?:: * Is there a way to determine when OpenCOBOL is running on 32 or 64 bits?:: * Does OpenCOBOL support recursion?:: * Does OpenCOBOL capture arithmetic overflow?:: * Can OpenCOBOL be used for plotting?::  File: ocfaq.info, Node: How do I install OpenCOBOL?, Next: What are the configure options available for building OpenCOBOL?, Up: Using OpenCOBOL 1.3.1 How do I install OpenCOBOL? --------------------------------- Installation instructions can be found at `OpenCOBOL Install`_. Debian The Debian binary package makes installing OpenCOBOL 1.0 a snap. From *root* or using sudo $ apt-get open-cobol Windows Build from sources under Cygwin or MinGW. Follow the instructions from the site listed above. Also see `What is the current version of OpenCOBOL?`_  File: ocfaq.info, Node: What are the configure options available for building OpenCOBOL?, Next: Does OpenCOBOL have any other dependencies?, Prev: How do I install OpenCOBOL?, Up: Using OpenCOBOL 1.3.2 What are the configure options available for building OpenCOBOL? ---------------------------------------------------------------------- _configure_ is a defacto standard development tool for POSIX compliant operating systems, in particular GNU/Linux. It examines the current environment and creates a Makefile suitable for the target computer and the package being built. For OpenCOBOL, the _configure_ script accepts *-help* as a command line option to display all of the available configuration choices. `configure' configures OpenCOBOL 1.1 to adapt to many kinds of systems. Usage: ./configure [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit ---quiet, --silent do not print `checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-experimental (OpenCOBOL) enable experimental code (Developers only!) --enable-param-check (OpenCOBOL) enable CALL parameter checking --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-rpath do not hardcode runtime library paths --disable-nls do not use Native Language Support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-cc= (OpenCOBOL) specify the C compiler used by cobc --with-seqra-extfh (OpenCOBOL) Use external SEQ/RAN file handler --with-cisam (OpenCOBOL) Use CISAM for ISAM I/O --with-disam (OpenCOBOL) Use DISAM for ISAM I/O --with-vbisam (OpenCOBOL) Use VBISAM for ISAM I/O --with-index-extfh (OpenCOBOL) Use external ISAM file handler --with-db1 (OpenCOBOL) use Berkeley DB 1.85 (libdb-1.85) --with-db (OpenCOBOL) use Berkeley DB 3.0 or later (libdb)(default) --with-lfs64 (OpenCOBOL) use large file system for file I/O (default) --with-dl (OpenCOBOL) use system dynamic loader (default) --with-patch-level (OpenCOBOL) define a patch level (default 0) --with-varse (OpenCOBOL) define variable sequential format (default 0) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to .  File: ocfaq.info, Node: Does OpenCOBOL have any other dependencies?, Next: How does the OpenCOBOL compiler work?, Prev: What are the configure options available for building OpenCOBOL?, Up: Using OpenCOBOL 1.3.3 Does OpenCOBOL have any other dependencies? ------------------------------------------------- OpenCOBOL relies on a native C compiler with POSIX compatibility. GCC being a freely available compiler collection supported by most operating systems |currently| in use. OpenCOBOL requires the following external libraries to be installed: GNU MP (libgmp) 4.1.2 or later libgmp is used to implement decimal arithmetic. GNU MP is licensed under GNU Lesser General Public License. GNU Libtool (libltdl) libltdl is used to implement dynamic CALL statements. GNU Libtool is licensed under GNU Lesser General Public License. NOTE - Libtool is not required for Linux and Windows (including MinGW and Cygwin) The following libraries are optional: Berkeley DB (libdb) 1.85 or later libdb can be used to implement indexed file I/O and SORT/MERGE. Berkeley DB is licensed under the original BSD License (1.85) or their own open-source license (2.x or later). Note that, as of 2.x, if you linked your software with Berkeley DB, you must distribute the source code of your software along with your software, or you have to pay royalty to Oracle Corporation. For more information about Oracle Berkeley DB dual licensing go to : Oracle / Embedded / Oracle Berkeley DB Ncurses (libncurses) 5.2 or later libncurses can be used to implement SCREEN SECTION. Ncurses is licensed under a BSD-style license.  File: ocfaq.info, Node: How does the OpenCOBOL compiler work?, Next: What is cobc?, Prev: Does OpenCOBOL have any other dependencies?, Up: Using OpenCOBOL 1.3.4 How does the OpenCOBOL compiler work? ------------------------------------------- OpenCOBOL is a multi-stage command line driven compiler. Command line options control what stages are performed during processing. 1. Preprocess #. Translate #. Compile #. Assemble #. Link #. Build OpenCOBOL produces intermediate C source code that is then passed to a configured C compiler and other tools. the GNU C compiler, *gcc* being a standard. The main tool, *cobc*, by default, produces modules, linkable shared object files. Example $ cat hello.cob Original source code; 000100* HELLO.COB OpenCOBOL FAQ example 000200 IDENTIFICATION DIVISION. 000300 PROGRAM-ID. hello. 000400 PROCEDURE DIVISION. 000500 DISPLAY "Hello World!". 000600 STOP RUN. OpenCOBOL stages. Preprocess $ cobc -E hello.cob Preprocess only; For one thing, FIXED format becomes FREE format. For another COPY is processed. Displays # 1 "hello.cob" IDENTIFICATION DIVISION. PROGRAM-ID. hello. PROCEDURE DIVISION. DISPLAY "Hello World!". STOP RUN. to standard out. Translate $ cobc -C hello.cob Translate only; preprocesses and then translates the COBOL sources into C. You can examine these files to get a good sense of how the OpenCOBOL environment interacts with the native C facilities. OpenCOBOL 1.1 produced *hello.c.h* and *hello.c*. hello.c.h /* Generated by cobc 1.1.0 _/ /_ Generated from hello.cob _/ /_ Generated at Oct 04 2008 00:19:36 EDT _/ /_ OpenCOBOL build date Oct 01 2008 22:15:19 _/ /_ OpenCOBOL package date Oct 01 2008 16:31:26 CEST _/ /_ Compile command cobc -C hello.cob */ /* PROGRAM-ID : hello */ static unsigned char b_5[4] __attribute__((aligned)); /* COB-CRT-STATUS _/ static unsigned char b_1[4] __attribute__((aligned)); /_ RETURN-CODE _/ static unsigned char b_2[4] __attribute__((aligned)); /_ SORT-RETURN _/ static unsigned char b_3[4] __attribute__((aligned)); /_ NUMBER-OF-CALL-PARAMETERS */ /* attributes */ static cob_field_attr a_1 = {16, 4, 0, 0, NULL}; static cob_field_attr a_2 = {33, 0, 0, 0, NULL}; /* fields _/ static cob_field f_5 = {4, b_5, &a_1}; /_ COB-CRT-STATUS */ /* constants _/ static cob_field c_1 = {12, (unsigned char_)"Hello World!", &a_2}; /* --------------------------------------------- */ hello.c /* Generated by cobc 1.1.0 _/ /_ Generated from hello.cob _/ /_ Generated at Oct 04 2008 00:19:36 EDT _/ /_ OpenCOBOL build date Oct 01 2008 22:15:19 _/ /_ OpenCOBOL package date Oct 01 2008 16:31:26 CEST _/ /_ Compile command cobc -C hello.cob */ #define __USE_STRING_INLINES 1 #include #include #include #include #include #define COB_SOURCE_FILE "hello.cob" #define COB_PACKAGE_VERSION "1.1" #define COB_PATCH_LEVEL 0 /* function prototypes */ static int hello_ (const int); int hello (void); /* functions */ int hello () { return hello_ (0); } /* end functions */ static int hello_ (const int entry) { #include "hello.c.h" /* local variables */ static int initialized = 0; static cob_field *cob_user_parameters[COB_MAX_FIELD_PARAMS]; static cob_module module = { NULL, NULL, &f_5, NULL, cob_user_parameters, 0, '.', '$', ',', 1, 1, 1, 0}; /* perform frame stack _/ int frame_index; struct frame { int perform_through; void_return_address; } frame_stack[255]; /* Start of function code */ if (unlikely(entry < 0)) { if (!initialized) { return 0; } initialized = 0; return 0; } module.next = cob_current_module; cob_current_module = &module; if (unlikely(initialized == 0)) { if (!cob_initialized) { cob_fatal_error (COB_FERROR_INITIALIZED); } cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL); if (module.next) cob_set_cancel ((const char _)"hello", (void_)hello, (void _)hello_); (_(int _) (b_1)) = 0; (_(int _) (b_2)) = 0; (_(int *) (b_3)) = 0; memset (b_5, 48, 4); initialized = 1; } /* initialize frame stack */ frame_index = 0; frame_stack[0].perform_through = -1; /* initialize number of call params _/ (_(int *) (b_3)) = cob_call_params; cob_save_call_params = cob_call_params; goto l_2; /* PROCEDURE DIVISION */ /* hello: */ l_2:; /* MAIN SECTION: */ /* MAIN PARAGRAPH: */ /* hello.cob:5: DISPLAY _/ { cob_new_display (0, 1, 1, &c_1); } /_ hello.cob:6: STOP _/ { cob_stop_run ((_(int *) (b_1))); } cob_current_module = cob_current_module->next; return (_(int_) (b_1)); } /* end function stuff */ Generate assembler: $ cobc -S hello.cob hello.s .file "cob9141_0.c" .text .globl hello .type hello, @function hello: pushl %ebp movl %esp, %ebp subl $8, %esp movl $0, (%esp) call hello_ leave ret .size hello, .-hello .data .align 4 .type module.5786, @object .size module.5786, 28 module.5786: .long 0 .long 0 .long f_5.5782 .long 0 .long cob_user_parameters.5785 .byte 0 .byte 46 .byte 36 .byte 44 .byte 1 .byte 1 .byte 1 .byte 0 .local cob_user_parameters.5785 .comm cob_user_parameters.5785,256,32 .local initialized.5784 .comm initialized.5784,4,4 .section .rodata .LC0: .string "Hello World!" .data .align 4 .type c_1.5783, @object .size c_1.5783, 12 c_1.5783: .long 12 .long .LC0 .long a_2.5781 .align 4 .type f_5.5782, @object .size f_5.5782, 12 f_5.5782: .long 4 .long b_5.5776 .long a_1.5780 .align 4 .type a_2.5781, @object .size a_2.5781, 8 a_2.5781: .byte 33 .byte 0 .byte 0 .byte 0 .long 0 .align 4 .type a_1.5780, @object .size a_1.5780, 8 a_1.5780: .byte 16 .byte 4 .byte 0 .byte 0 .long 0 .local b_3.5779 .comm b_3.5779,4,16 .local b_2.5778 .comm b_2.5778,4,16 .local b_1.5777 .comm b_1.5777,4,16 .local b_5.5776 .comm b_5.5776,4,16 .section .rodata .LC1: .string "1.1" .LC2: .string "hello.cob" .LC3: .string "hello" .text .type hello_, @function hello_: pushl %ebp movl %esp, %ebp subl $2072, %esp movl 8(%ebp), %eax shrl $31, %eax testl %eax, %eax je .L4 movl initialized.5784, %eax testl %eax, %eax jne .L5 movl $0, -2052(%ebp) jmp .L6 .L5: movl $0, initialized.5784 movl $0, -2052(%ebp) jmp .L6 .L4: movl cob_current_module, %eax movl %eax, module.5786 movl $module.5786, cob_current_module movl initialized.5784, %eax testl %eax, %eax sete %al movzbl %al, %eax testl %eax, %eax je .L7 movl cob_initialized, %eax testl %eax, %eax jne .L8 movl $0, (%esp) call cob_fatal_error .L8: movl $0, 8(%esp) movl $.LC1, 4(%esp) movl $.LC2, (%esp) call cob_check_version movl module.5786, %eax testl %eax, %eax je .L9 movl $hello_, 8(%esp) movl $hello, 4(%esp) movl $.LC3, (%esp) call cob_set_cancel .L9: movl $b_1.5777, %eax movl $0, (%eax) movl $b_2.5778, %eax movl $0, (%eax) movl $b_3.5779, %eax movl $0, (%eax) movl $4, 8(%esp) movl $48, 4(%esp) movl $b_5.5776, (%esp) call memset movl $1, initialized.5784 .L7: movl $0, -4(%ebp) movl $-1, -2044(%ebp) movl $b_3.5779, %edx movl cob_call_params, %eax movl %eax, (%edx) movl cob_call_params, %eax movl %eax, cob_save_call_params .L10: movl $c_1.5783, 12(%esp) movl $1, 8(%esp) movl $1, 4(%esp) movl $0, (%esp) call cob_new_display movl $b_1.5777, %eax movl (%eax), %eax movl %eax, (%esp) call cob_stop_run .L6: movl -2052(%ebp), %eax leave ret .size hello_, .-hello_ .ident "GCC: (Debian 4.3.1-9) 4.3.1" .section .note.GNU-stack,"",@progbits Compile only; outputs assembly file. Produces *hello.s*. Produce object code $ cobc -c hello.cob Compile and assemble, do not link. Produces *hello.o*. Build modules $ cobc -m hello.cob Build dynamically loadable module. The is the _default behaviour_. This example produces *hello.so* or *hello.dll*. Module run $ cobcrun hello Will scan the DSO_ hello.so, and then link, load, and execute hello. $ cobc -x hello.cob Build an executable program. This examples produces *hello* or *hello.exe*. *This is important*. _cobc_ produces a _Dynamic Shared Object_ by default. _To create executables_, you need to use *-x*. $ ./hello Hello World! OpenCOBOL also supports features for multiple source, multiple language programming, detailed in the FAQ at `Does OpenCOBOL support modules?`_.  File: ocfaq.info, Node: What is cobc?, Next: What is cobcrun?, Prev: How does the OpenCOBOL compiler work?, Up: Using OpenCOBOL 1.3.5 What is cobc? ------------------- *cobc* is the OpenCOBOL compiler. See `What compiler options are supported?`_ for more information.  File: ocfaq.info, Node: What is cobcrun?, Next: What is cob-config?, Prev: What is cobc?, Up: Using OpenCOBOL 1.3.6 What is cobcrun? ---------------------- *cobcrun* is the OpenCOBOL driver program that allows the execution of programs stored in OpenCOBOL modules. The *cobc* compiler, by default, produces modules (the _-m_ option). These modules are linkable dynamic shared objects (DSO). Using GNU/Linux for example $ cobc -x hello.cob $ ./hello Hello World! $ cobc hello.cob $ cobcrun hello Hello World! The *cobc -x hello.cob* built an executable binary called hello. The *cobc hello.cob* produced a DSO_ hello.so, and cobcrun resolves the entry point and executes the code, right from the DSO_. *cobcrun* _is the compiler author's preferred way to manage OpenCOBOL development._ It alleviates knowing which source file needs _-x_ while encouraging proper modular programming, a mainstay of OpenCOBOL.  File: ocfaq.info, Node: What is cob-config?, Next: What compiler options are supported?, Prev: What is cobcrun?, Up: Using OpenCOBOL 1.3.7 What is cob-config? ------------------------- *cob-config* is a program that can be used to find the C compiler flags and libraries required for compiling. Using GNU/Linux for example: $ cob-config Usage: cob-config [OPTIONS] Options: [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] $ cob-config --libs -L/usr/local/lib -lcob -lm -lgmp -lncurses -ldb $ cob-config --cflags -I/usr/local/include You may need to use these features during mixed source language development, usually by back-ticking the command output inline with other *gcc* commands.  File: ocfaq.info, Node: What compiler options are supported?, Next: What dialects are supported by OpenCOBOL?, Prev: What is cob-config?, Up: Using OpenCOBOL 1.3.8 What compiler options are supported? ------------------------------------------ The OpenCOBOL system strives to be standards compliant, yet also remain a viable compiler option for the many billions of existing lines of COBOL sources. Many details of the compile can be controlled with command line options. Please also see `What are the OpenCOBOL compile time configuration files?`_ for more details on this finely tuned control. $ cobc -V cobc (OpenCOBOL) 1.1.0 Copyright (C) 2001-2008 Keisuke Nishida / Roger While Built Oct 29 2008 16:32:02 Packaged Oct 28 2008 19:05:45 CET $ cobc --help Usage: cobc [options] file... Options: --help Display this message --version, -V Display compiler version -v Display the programs invoked by the compiler -x Build an executable program -m Build a dynamically loadable module (default) -std= Compile for a specific dialect : cobol2002 Cobol 2002 cobol85 Cobol 85 ibm IBM Compatible mvs MVS Compatible bs2000 BS2000 Compatible mf Micro Focus Compatible default When not specified See config/default.conf and config/*.conf -free Use free source format -fixed Use fixed source format (default) -O, -O2, -Os Enable optimization -g Produce debugging information in the output -debug Enable all run-time error checking -o Place the output into -b Combine all input files into a single dynamically loadable module -E Preprocess only; do not compile, assemble or link -C Translation only; convert COBOL to C -S Compile only; output assembly file -c Compile and assemble, but do not link -t Generate and place a program listing into -I Add to copy/include search path -L Add to library search path -l Link the library -D Pass to the C compiler -conf= User defined dialect configuration - See -std= --list-reserved Display reserved words --list-intrinsics Display intrinsic functions --list-mnemonics Display mnemonic names -save-temps(=) Save intermediate files (default current directory) -MT Set target file used in dependency list -MF Place dependency list into -ext Add default file extension -W Enable ALL warnings -Wall Enable all warnings except as noted below -Wobsolete Warn if obsolete features are used -Warchaic Warn if archaic features are used -Wredefinition Warn incompatible redefinition of data items -Wconstant Warn inconsistent constant -Wparentheses Warn lack of parentheses around AND within OR -Wstrict-typing Warn type mismatch strictly -Wimplicit-define Warn implicitly defined data items -Wcall-params Warn non 01/77 items for CALL params (NOT set with -Wall) -Wcolumn-overflow Warn text after column 72 (FIXED format, NOT set with -Wall) -Wterminator Warn lack of scope terminator (END-XXX, NOT set with -Wall) -Wtruncate Warn possible field truncation (NOT set with -Wall) -Wlinkage Warn dangling LINKAGE items (NOT set with -Wall) -ftrace Generate trace code (Executed SECTION/PARAGRAPH) -ftraceall Generate trace code (Executed SECTION/PARAGRAPH/STATEMENTS) -fsyntax-only Syntax error checking only; don't emit any output -fdebugging-line Enable debugging lines ('D' in indicator column) -fsource-location Generate source location code (Turned on by -debug or -g) -fimplicit-init Do automatic initialization of the Cobol runtime system -fsign-ascii Numeric display sign ASCII (Default on ASCII machines) -fsign-ebcdic Numeric display sign EBCDIC (Default on EBCDIC machines) -fstack-check PERFORM stack checking (Turned on by -debug or -g) -ffold-copy-lower Fold COPY subject to lower case (Default no transformation) -ffold-copy-upper Fold COPY subject to upper case (Default no transformation) -fnotrunc Do not truncate binary fields according to PICTURE -ffunctions-all Allow use of intrinsic functions without FUNCTION keyword -fmfcomment '*' or '/' in column 1 treated as comment (FIXED only) -fnull-param Pass extra NULL terminating pointers on CALL statements  File: ocfaq.info, Node: What dialects are supported by OpenCOBOL?, Next: What are the OpenCOBOL compile time configuration files?, Prev: What compiler options are supported?, Up: Using OpenCOBOL 1.3.9 What dialects are supported by OpenCOBOL? ----------------------------------------------- Using the *std=* compiler option, OpenCOBOL can be configured to compile using specific historical COBOL compiler features and quirks. Supported dialects include: * default * cobol85 * cobol2002 * ibm * mvs * mf * bs2000 For details on what options and switches are used to support these dialect compiles, see the *config/* directory of your OpenCOBOL installation. For Debian GNU/Linux, that will be */usr/share/open-cobol/config/* if you used APT to install an OpenCOBOL package or */usr/local/share/open-cobol/config/* after a build from the source archive. For example: the _bs2000.conf_ file restricts data representations to 2, 4 or 8 byte binary while _mf.conf_ allows data representations from 1 thru 8 bytes. _cobol85.conf_ allows debugging lines, _cobol2002.conf_ configures the compiler to warn that this feature is obsolete.  File: ocfaq.info, Node: What are the OpenCOBOL compile time configuration files?, Next: Do you have a reasonable source code skeleton for OpenCOBOL?, Prev: What dialects are supported by OpenCOBOL?, Up: Using OpenCOBOL 1.3.10 What are the OpenCOBOL compile time configuration files? --------------------------------------------------------------- To assist in the support of the various existent COBOL compilers, OpenCOBOL reads configuration files controlling various aspects of a compile pass. Each supported dialect will also have a _.conf_ file in the *config/* sub-directory of its installation. For Debian GNU/Linux, these will be in */usr/share/open-cobol/config/* or */usr/local/share/open-cobol/config* under default package and default _make_ conditions. For example, the default configuration, _default.conf_ is: # COBOL compiler configuration -*- sh -*- # Value: any string name: "OpenCOBOL" # Value: int tab-width: 8 text-column: 72 # Value: `cobol2002', `mf', `ibm' # assign-clause: mf # If yes, file names are resolved at run time using environment variables. # For example, given ASSIGN TO "DATAFILE", the actual file name will be # 1. the value of environment variable `DD_DATAFILE' or # 2. the value of environment variable `dd_DATAFILE' or # 3. the value of environment variable `DATAFILE' or # 4. the literal "DATAFILE" # If no, the value of the assign clause is the file name. # # Value: `yes', `no' filename-mapping: yes # Value: `yes', `no' pretty-display: yes # Value: `yes', `no' auto-initialize: yes # Value: `yes', `no' complex-odo: no # Value: `yes', `no' indirect-redefines: no # Value: signed unsigned bytes # ------ -------- ----- # `2-4-8' 1 - 4 2 # 5 - 9 4 # 10 - 18 8 # # `1-2-4-8' 1 - 2 1 # 3 - 4 2 # 5 - 9 4 # 10 - 18 8 # # `1--8' 1 - 2 1 - 2 1 # 3 - 4 3 - 4 2 # 5 - 6 5 - 7 3 # 7 - 9 8 - 9 4 # 10 - 11 10 - 12 5 # 12 - 14 13 - 14 6 # 15 - 16 15 - 16 7 # 17 - 18 17 - 18 8 binary-size: 1-2-4-8 # Value: `yes', `no' binary-truncate: yes # Value: `native', `big-endian' binary-byteorder: big-endian # Value: `yes', `no' larger-redefines-ok: no # Value: `yes', `no' relaxed-syntax-check: no # Perform type OSVS - If yes, the exit point of any currently executing perform # is recognized if reached. # Value: `yes', `no' perform-osvs: no # If yes, non-parameter linkage-section items remain allocated # between invocations. # Value: `yes', `no' sticky-linkage: no # If yes, allow non-matching level numbers # Value: `yes', `no' relax-level-hierarchy: no # not-reserved: # Value: Word to be taken out of the reserved words list # (case independent) # Dialect features # Value: `ok', `archaic', `obsolete', `skip', `ignore', `unconformable' author-paragraph: obsolete memory-size-clause: obsolete multiple-file-tape-clause: obsolete label-records-clause: obsolete value-of-clause: obsolete data-records-clause: obsolete top-level-occurs-clause: skip synchronized-clause: ok goto-statement-without-name: obsolete stop-literal-statement: obsolete debugging-line: obsolete padding-character-clause: obsolete next-sentence-phrase: archaic eject-statement: skip entry-statement: obsolete move-noninteger-to-alphanumeric: error odo-without-to: ok  File: ocfaq.info, Node: Do you have a reasonable source code skeleton for OpenCOBOL?, Next: What is ocdoc?, Prev: What are the OpenCOBOL compile time configuration files?, Up: Using OpenCOBOL 1.3.11 Do you have a reasonable source code skeleton for OpenCOBOL? ------------------------------------------------------------------- Maybe. Style is a very personal developer choice. OpenCOBOL pays homage to this freedom of choice. Here is the FIXED form header that this author uses. It includes *ocdoc* lines. _>_* _>>SOURCE FORMAT IS FIXED_> ******************************** _><_ =========== _><_ _><_ =========== _><_ :Author: _><_ :Date: _><_ :Purpose: _><_ :Tectonics: cobc _>_******************************* identification division. program-id. . environment division. configuration section. input-output section. file-control. _> select_> assign to _> organization is_> . data division. file section. _>fd ._> 01 . working-storage section. local-storage section. linkage section. screen section. _>_******************************** procedure division. goback. end program . _><_ _><_ Last Update: dd-Mmm-yyyy Fill in the _program-id_ and _end program_ to compile. Fill in the ocdoc title for generating documentation. See `What is ocdoc?`_ for more information on _(one method of)_ inline documentation. Here are some templates that can cut and pasted. Fixed form in lowercase _>_* _>>SOURCE FORMAT IS FIXED_> ******************************** _> Author:_> Date: _> Purpose:_> Tectonics: cobc _>_******************************* identification division. program-id. . environment division. configuration section. input-output section. _> file-control._> select _> assign to_> organization is *> . data division. _> file section._> fd . *> 01 . working-storage section. local-storage section. linkage section. screen section. _>_******************************** procedure division. goback. end program . Fixed form in UPPERCASE OCOBOL >>SOURCE FORMAT IS FIXED ********************************_*_ Author: * Date: * Purpose: * Tectonics: cobc********************************** IDENTIFICATION DIVISION. PROGRAM-ID. . ENVIRONMENT DIVISION. CONFIGURATION SECTION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT ASSIGN TO ORGANIZATION IS . DATA DIVISION. FILE SECTION. FD . 01 . WORKING-STORAGE SECTION. LOCAL-STORAGE SECTION. LINKAGE SECTION. SCREEN SECTION. *****************_*_**************** PROCEDURE DIVISION. GOBACK. END PROGRAM . The OCOBOL "sequence number" can safely be removed. It is there to ensure proper alignment in the browser. Free form. Due to an indentation formatting problem with ReST documentation sources, the first line is separated out: >>SOURCE FORMAT IS FREE the above line must start in column 7, or use *cobc -free* _>_*********************************_*_> Author: _> Date:_> Purpose: _> Tectonics: cobc -free_>*********************************_*_ identification division. program-id. . environment division. configuration section. input-output section. file-control. select assign to organization is . data division. file section. fd . 01 . working-storage section. local-storage section. linkage section. screen section. procedure division. goback. end program . These files can be downloaded from * headfix.cob (http://opencobol.add1tocobol.com/sources/headfix.cob) * headfixuppper.cob (http://opencobol.add1tocobol.com/sources/headfixupper.cob) * headfree.cob (http://opencobol.add1tocobol.com/sources/headfree.cob)  File: ocfaq.info, Node: What is ocdoc?, Next: Does OpenCOBOL support any SQL databases?, Prev: Do you have a reasonable source code skeleton for OpenCOBOL?, Up: Using OpenCOBOL 1.3.12 What is ocdoc? --------------------- *ocdoc* is a small utility used to annotate sample programs and to support generation of Usage Documentation using COBOL sourced ReStructuredText extract lines. ocdoc.cob _>_* _>>SOURCE FORMAT IS FIXED_> ******************************** _><_ ===================== _><_ ocdoc.cob usage guide _><_ ===================== _><_ .. sidebar:: Table of Contents _><_ _><_ .. contents:: :local: _><_ _><_ :Author: Brian Tiffin _><_ :Date: 30-Sep-2008 _><_ :Rights: Copyright (c) 2008, Brian Tiffin. _><_ GNU FDL License. _><_ :Purpose: Extract usage document lines from COBOL sources. _><_ Using OpenCOBOL 1.1pr. OpenCOBOL is tasty. _><_ :Tectonics: cobc -x ocdoc.cob _><_ :Docgen: $ ./ocdoc ocdoc.cob ocdoc.rst ocdoc.html skin.css _>_******************************* _><_ _><_ -----------_><_ Command line _><_ -----------_><_ _ocdoc_ runs in two forms. _><_ _><_ Without arguments, _ocdoc_ will act as a pipe filter. _><_ Reading from standard in and writing the extract to standard _><+ out._><* _><_ The _ocdoc_ command also takes an input file, an extract _><+ filename, an optional result file (with optional_><+ stylesheet) and a verbosity option _-v_ or a _><+ special_-fixed* flag (to force skipping sequence numbers). _><_ If a result file is given, ocdoc will automatically _><_ run an _rst2html_ command using the SYSTEM service. _><_ _><_ Due to an overly simplistic argument handler, you can only _><+ turn on verbosity or -fixed when using all four filenames._><* _><_ Examples:: _><_ _><_ $ cat ocdoc.cob | ocdoc >ocdoc.rst _><_ $ ./ocdoc ocdoc.cob ocdoc.rst _><_ $ ./ocdoc ocdoc.cob ocdoc.rst _><+ ocdoc.html skin.css -fixed_><* ... _><_ Input : ocdoc.cob _><_ Output : ocdoc.rst _><_ Command: rst2html -stylesheet=skin.css _><+ ocdoc.rst ocdoc.html_><* _><_ ----------------_><_ What is extracted _><_ ----------------_><_ - Lines that begin with *><* _ignoring spaces_, are _><+ extracted._><* _><_ - Lines that begin with *><+ are appended to the _><+ previous output line. As lines are trimmed of trailing_><+ spaces, and _ocdoc_ removes the space following the _><+ extract triggers, you may need two spaces after an_><+ ocdoc append. _><_ _><_ - Lines that begin with *><[ begin a here document _><+ with lines that follow extracted as is._><* _><_ - Lines that begin with *><] close a here document. _><+ Here document start and end lines are excluded from the_><+ extract. _><_ _><_ ----------_><_ Source code _><_ ----------_><_ `Download ocdoc.cob _><+ `__><* `See ocdocseq.cob _><+ `__><* _><* _><_ ----------------------_><_ identification division _><_ ----------------------_><_ _><_ :: _><_ *><[ identification division. program-id. OCDOC. environment division. input-output section. file-control. select standard-input assign to KEYBOARD. select standard-output assign to DISPLAY. select source-input assign to source-name organization is line sequential . select doc-output assign to doc-name organization is line sequential . _><]_><* _><_ ------------_><_ data division _><_ ------------_><_ _><_ :: _><_ *><[ data division. file section. fd standard-input. 01 stdin-record pic x(256). fd standard-output. 01 stdout-record pic x(256). fd source-input. 01 source-record pic x(256). fd doc-output. 01 doc-record pic x(256). working-storage section. 01 arguments pic x(256). 01 source-name pic x(256). 01 doc-name pic x(256). 01 result-name pic x(256). 01 style-name pic x(256). 01 verbosity pic x(9). 88 verbose values "-v" "-v" "-verbose" "-verbose". 88 skipseqnum values "-fix" "-fixed" "-fix" "-fixed". 01 usagehelp pic x(6). 88 helping values "-h" "-h" "-help" "-help". 01 filter-flag pic x value low-value. 88 filtering value high-value. 01 line-count usage binary-long. 01 line-display pic z(8)9. _><]_><* _><_ Note the conditional test for end of here doc _><_ _><_ :: _><_ _><[ 01 trimmed pic x(256). 88 herestart value "_><[". 88 hereend value "*><]". 01 hereflag pic x value low-value. 88 heredoc value high-value. 88 herenone value low-value. _><]_><* _><_ Note the here-record adds an ocdoc extract to lines that _><+ follow._><* _><_ :: _><_ _><[ 01 here-record. 02 filler pic x(5) value "_><* ". 02 here-data pic x(251). 01 seq-record. 02 filler pic x(7) value " ". 02 seq-data pic x(249). 01 doc-buffer pic x(256). 01 buffer-offset pic 999 usage comp-5 value 1. 01 buffer-flag pic x value low-value. 88 buffer-empty value low-value. 88 buffered-output value high-value. 01 counter pic 999 usage comp-5. 01 len-of-comment pic 999 usage comp-5. 01 first-part pic x(8). 88 special values "_><_" "_><+". 88 autodoc value "_><_". 88 autoappend value "_><+". 01 rst-command pic x(256). 01 result usage binary-long. _><]_><* _><_ -----------------_><_ procedure division _><_ -----------------_><_ _><_ :: _><_ _><[_> ***************_*_*************** procedure division. _><]_><* _><_ Accept command line arguments. See if help requested. _><_ _><_ :: _><_ *><[ accept arguments from command-line end-accept move arguments to usagehelp if helping display "$ ./ocdoc source markover [output [skin [-fixed]]]" end-display display "$ ./ocdoc" end-display display " without arguments extracts stdin to stdout" end-display goback end-if _><]_><* _><_ Either run as filter or open given files. Two filenames _><+ will generate an extract. Three will run the extract_><+ through _rst2html_ using an optional fourth filename _><+ as a stylesheet._><* _><_ :: _><_ _><[_> Determine if this is running as a filter if arguments not equal spaces unstring arguments delimited by all spaces into source-name doc-name result-name style-name verbosity end-unstring open input source-input open output doc-output else set filtering to true open input standard-input open output standard-output end-if _><]_><* _><_ Initialize the output buffer, and line count. _><_ _><_ :: _><_ *><[ set buffer-empty to true move 1 to buffer-offset move spaces to doc-record move 0 to line-count _><]_><* _><_ The read is either from file or stdin. Start with the _><+ first record._><* _><_ :: _><_ _><[_> filtering requires different reader loop if filtering read standard-input at end move high-values to stdin-record end-read move stdin-record to source-record else read source-input at end move high-values to source-record end-read end-if _><]_><* _><_ The main loop starts here, having done a pre-read to start _><+ things off._><* _><_ :: _><_ *><[ perform until source-record = high-values add 1 to line-count _><]_><* _><_ Small wrinkle if processing fixed form with sequence numbers, _><+ as the heredoc end marker needs to be recognized_><+ but we still want the sequence numbers in the heredoc. _><_ _><_ So files processed -fixed play some data shuffling games. _><_ _><_ :: _><_ *><[ if skipseqnum if heredoc move source-record(7 : 248) to trimmed move source-record to seq-data move seq-record to source-record else move source-record(7 : 248) to source-record move source-record to trimmed end-if else move function trim(source-record leading) to trimmed end-if _><]_><* _><_ First to check for here doc start and end, setting flag _><+ if trimmed conditional the heredoc start or heredoc end_><+ strings. _><_ _><_ :: _><_ *><[ if herestart set heredoc to true end-if if hereend set herenone to true end-if _><]_><* _><_ Inside the loop, we skip over heredoc entries. _><+ If it is normal, than check for heredoc and include_><+ source lines that follow, by prepending the extract tag _><_ _><_ :: _><_ *><[ if (not herestart) and (not hereend) if heredoc move source-record to here-data move here-record to trimmed end-if _><]_><* _><_ Unstring the line, looking for special tags in the first _><+ part._><* _><_ :: _><_ *><[ unstring trimmed delimited by all spaces into first-part count in counter end-unstring _><]_><* _><_ If special, we either buffer or append to buffer _><_ _><_ :: _><_ *><[ evaluate true when special if autoappend and buffer-empty move spaces to doc-record move 1 to buffer-offset end-if if autodoc and buffered-output if filtering move doc-record to stdout-record write stdout-record end-write else write doc-record end-write end-if if verbose display function trim(doc-record trailing) end-display end-if move spaces to doc-record set buffer-empty to true move 1 to buffer-offset end-if _><]_><* _><_ Skip over where the tag was found plus an extra space. _><_ Adding 2 skips over the assumed space after a special tag _><_ _><_ :: _><_ *><[ add 2 to counter compute len-of-comment = function length(trimmed) - counter end-compute if len-of-comment > 0 move trimmed(counter : len-of-comment) to doc-buffer else move spaces to doc-buffer end-if _><]_><* _><_ Buffer the line, either to position 1 or appending to last. _><_ _><_ :: _><_ _><[ string function trim(doc-buffer trailing) delimited by size into doc-record with pointer buffer-offset on overflow move line-count to line-display display "__* truncation_** reading line " line-display end-display end-string set buffered-output to true end-evaluate end-if _><]_><* _><_ Again, we either read the next record from file or stdin. _><_ _><_ :: _><_ *><[ if filtering read standard-input at end move high-values to stdin-record end-read move stdin-record to source-record else read source-input at end move high-values to source-record end-read end-if end-perform _><]_><* _><_ We may or may not end up with buffered data _><_ _><_ :: _><_ *><[ if buffered-output set buffer-empty to true move 1 to buffer-offset if filtering move doc-record to stdout-record write stdout-record end-write else write doc-record end-write end-if if verbose display function trim(doc-record trailing) end-display end-if move spaces to doc-record end-if _><]_><* _><_ Close the OpenCOBOL files _><_ _><_ :: _><_ *><[ if filtering close standard-output close standard-input else close doc-output close source-input end-if if verbose display "Input : " function trim(source-name) end-display display "Output : " function trim(doc-name) end-display end-if _><]_><* _><_ If we have a result file, use the SYSTEM service to _><+ generate an HTML file, possibly with stylesheet._><* _><_ :: _><_ _><[_> pass the extract through a markover, in this case ReST move spaces to rst-command if result-name not equal spaces if style-name equal spaces string "rst2html " delimited by size doc-name delimited by space " " delimited by size result-name delimited by space into rst-command end-string else string "rst2html -stylesheet=" delimited by size style-name delimited by space " " delimited by size doc-name delimited by space " " delimited by size result-name delimited by space into rst-command end-string end-if if verbose display "Command: " function trim(rst-command trailing) end-display end-if call "SYSTEM" using rst-command returning result end-call if result not equal zero display "HTML generate failed: " result end-display end-if end-if _><]_><* _><_ And before you know it, we are done. _><_ _><_ :: _><_ *><[ goback. end program OCDOC. _><]_><* _><_ Don't forget to visit http://opencobol.org (http://opencobol.org) _><_ _><_ Cheers _><_ _><_ _Last edit:_ 03-Oct-2008 See ocdoc.html (http://opencobol.add1tocobol.com/ocdoc.html) for the output from processing _ocdoc.cob_ with *ocdoc*.  File: ocfaq.info, Node: Does OpenCOBOL support any SQL databases?, Next: What are the OpenCOBOL RESERVED WORDS?, Prev: What is ocdoc?, Up: Using OpenCOBOL 1.3.13 Does OpenCOBOL support any SQL databases? ------------------------------------------------ Yes and no. There is no embedded SQL in OpenCOBOL in terms of EXEC but there are at least two usable CALL extensions. There are |currently| quite a few active developments for external SQL engine access. There are early prototypes for SQLite at ocshell.c (http://opencobol.add1tocobol.com/ocshell.c) with a sample usage program at sqlscreen.cob (http://opencobol.add1tocobol.com/sqlscreen.cob) and supporting documentation at sqlscreen.html (http://opencobol.add1tocobol.com/sqlscreen.html) The SQLite extension comes in two flavours; a shell mode discussed above and a direct API interface housed at ocsqlite.c (http://add1tocobol.com/tiki-list_file_gallery.php?galleryId=12) A libdbi (generic database access) extension is also available. See cobdbi (http://add1tocobol.com/tiki-read_article.php?articleId=1) for full details. Rumours of a potential Postgres layer have also been heard.  File: ocfaq.info, Node: What are the OpenCOBOL RESERVED WORDS?, Next: Does OpenCOBOL support modules?, Prev: Does OpenCOBOL support any SQL databases?, Up: Using OpenCOBOL 1.3.14 What are the OpenCOBOL RESERVED WORDS? --------------------------------------------- COBOL_ is a reserved word rich language. The OpenCOBOL compiler recognizes: .. Note to maintainers. Built with $ cobc -list-reserved, followed by a 74 column wide reformat and 4 space indent. The counts were calculated from $ wc and grepping for the literal "-1" in the cobc/reserved.c source. _`Reserved Words` ======================= ======================= ======================= * ACCEPT_ * ENTRY * POINTER * ACCESS_ x. ENTRY-CONVENTION * POSITION x. ACTIVE-CLASS_ * ENVIRONMENT * POSITIVE * ADD_ * ENVIRONMENT-NAME x. PRESENT * ADDRESS_ * ENVIRONMENT-VALUE * PREVIOUS * ADVANCING_ x. EO * PRINTER * AFTER_ * EOL x. PRINTING x. ALIGNED * EOP * PROCEDURE * ALL_ * EOS * PROCEDURE-POINTER * ALLOCATE_ * EQUAL * PROCEDURES * ALPHABET_ * EQUALS * PROCEED * ALPHABETIC_ * ERASE * PROGRAM * ALPHABETIC-LOWER_ * ERROR * PROGRAM-ID * ALPHABETIC-UPPER_ * ESCAPE * PROGRAM-POINTER * ALPHANUMERIC_ x. ESI * PROMPT * ALPHANUMERIC-EDITED_ * EVALUATE x. PROPERTY * ALSO_ * EXCEPTION x. PROTOTYPE * ALTER_ x. EXCEPTION-OBJECT x. PURGE * ALTERNATE_ * EXCLUSIVE x. QUEUE * AND_ * EXIT * QUOTE * ANY_ x. EXPANDS * QUOTES x. ANYCASE * EXTEND x. RAISE * ARE_ * EXTERNAL x. RAISING * AREA_ x. FACTORY * RANDOM x. AREAS * FALSE x. RD * ARGUMENT-NUMBER * FD * READ * ARGUMENT-VALUE_ * FILE x. RECEIVE x. ARITHMETIC * FILE-CONTROL * RECORD * AS * FILE-ID * RECORDING * ASCENDING * FILLER * RECORDS * ASSIGN x. FINAL * RECURSIVE * AT * FIRST * REDEFINES x. ATTRIBUTE x. FLOAT-EXTENDED * REEL * AUTO * FLOAT-LONG * REFERENCE * AUTO-SKIP * FLOAT-SHORT x. RELATION * AUTOMATIC * FOOTING * RELATIVE * AUTOTERMINATE * FOR * RELEASE x. B-AND * FOREGROUND-COLOR * REMAINDER x. B-NOT x. FOREVER * REMOVAL x. B-OR x. FORMAT * RENAMES x. B-XOR * FREE x. REPLACE * BACKGROUND-COLOR_ * FROM * REPLACING * BASED_ * FULL x. REPORT * BEEP_ * FUNCTION_ x. REPORTING * BEFORE x. FUNCTION-ID x. REPORTS * BELL_ x. GENERATE x. REPOSITORY * BINARY x. GET * REQUIRED * BINARY-C-LONG * GIVING_ * RESERVE * BINARY-CHAR * GLOBAL x. RESET * BINARY-DOUBLE * GO x. RESUME * BINARY-LONG * GOBACK_ x. RETRY * BINARY-SHORT * GREATER * RETURN x. BIT x. GROUP * RETURNING * BLANK_ x. GROUP-USAGE * REVERSE-VIDEO * BLINK x. HEADING * REWIND * BLOCK * HIGH-VALUE * REWRITE x. BOOLEAN * HIGH-VALUES x. RF * BOTTOM * HIGHLIGHT x. RH * BY * I-O * RIGHT x. BYTE-LENGTH * I-O-CONTROL * ROLLBACK * CALL_ * ID * ROUNDED * CANCEL * IDENTIFICATION * RUN x. CD * IF * SAME x. CENTER * IGNORING * SCREEN x. CF x. IMPLEMENTS * SD x. CH * IN * SEARCH x. CHAIN * INDEX x. SECONDS * CHAINING * INDEXED * SECTION * CHARACTER x. INDICATE * SECURE * CHARACTERS x. INHERITS x. SEGMENT * CLASS * INITIAL * SELECT x. CLASS-ID * INITIALIZE x. SELF x. CLASSIFICATION * INITIALIZED x. SEND * CLOSE x. INITIATE * SENTENCE x. CODE * INPUT * SEPARATE * CODE-SET * INPUT-OUTPUT * SEQUENCE * COL * INSPECT * SEQUENTIAL * COLLATING x. INTERFACE * SET * COLS x. INTERFACE-ID * SHARING * COLUMN * INTO * SIGN * COLUMNS x. INTRINSIC * SIGNED * COMMA * INVALID * SIGNED-INT * COMMAND-LINE x. INVOKE * SIGNED-LONG * COMMIT * IS * SIGNED-SHORT * COMMON * JUST * SIZE x. COMMUNICATION * JUSTIFIED * SORT_ * COMP * KEY * SORT-MERGE_ * COMP-1 * LABEL * SOURCE * COMP-2 x. LAST * SOURCE-COMPUTER * COMP-3 x. LC_ALL x. SOURCES * COMP-4 x. LC_COLLATE * SPACE * COMP-5 x. LC_CTYPE * SPACES * COMP-X x. LC_MESSAGES * SPECIAL-NAMES_ * COMPUTATIONAL x. LC_MONETARY * STANDARD * COMPUTATIONAL-1 x. LC_NUMERIC * STANDARD-1 * COMPUTATIONAL-2 x. LC_TIME * STANDARD-2 * COMPUTATIONAL-3 * LEADING * START * COMPUTATIONAL-4 * LEFT x. STATEMENT * COMPUTATIONAL-5 * LENGTH * STATUS * COMPUTATIONAL-X * LESS x. STEP * COMPUTE x. LIMIT * STOP x. CONDITION x. LIMITS * STRING * CONFIGURATION * LINAGE_ x. STRONG * CONSTANT * LINAGE-COUNTER_ x. SUB-QUEUE-1 * CONTAINS * LINE x. SUB-QUEUE-2 * CONTENT x. LINE-COUNTER x. SUB-QUEUE-3 * CONTINUE * LINES * SUBTRACT x. CONTROL * LINKAGE x. SUM x. CONTROLS * LOCAL-STORAGE x. SUPER * CONVERTING * LOCALE x. SUPPRESS * COPY * LOCK x. SYMBOL * CORR * LOW-VALUE_ * SYMBOLIC * CORRESPONDING * LOW-VALUES_ * SYNC * COUNT * LOWLIGHT_ * SYNCHRONIZED * CRT * MANUAL x. SYSTEM-DEFAULT * CURRENCY * MEMORY x. TABLE * CURSOR * MERGE * TALLYING * CYCLE x. MESSAGE * TAPE * DATA x. METHOD x. TERMINAL x. DATA-POINTER x. METHOD-ID x. TERMINATE * DATE * MINUS * TEST * DAY * MODE x. TEXT * DAY-OF-WEEK * MOVE_ * THAN x. DE * MULTIPLE * THEN * DEBUGGING * MULTIPLY * THROUGH * DECIMAL-POINT * NATIONAL * THRU * DECLARATIVES * NATIONAL-EDITED * TIME * DEFAULT * NATIVE * TIMES * DELETE * NEGATIVE * TO * DELIMITED x. NESTED * TOP * DELIMITER * NEXT * TRAILING * DEPENDING * NO * TRUE * DESCENDING x. NONE x. TYPE x. DESTINATION x. NORMAL x. TYPEDEF x. DETAIL * NOT x. UCS-4 x. DISABLE * NULL * UNDERLINE * DISK * NULLS * UNIT * DISPLAY * NUMBER x. UNIVERSAL * DIVIDE * NUMBERS * UNLOCK * DIVISION * NUMERIC * UNSIGNED * DOWN * NUMERIC-EDITED * UNSIGNED-INT * DUPLICATES x. OBJECT * UNSIGNED-LONG * DYNAMIC * OBJECT-COMPUTER * UNSIGNED-SHORT * EBCDIC_ x. OBJECT-REFERENCE * UNSTRING x. EC * OCCURS * UNTIL x. EGI * OF * UP * ELSE * OFF * UPDATE x. EMI * OMITTED * UPON x. ENABLE * ON * USAGE_ * END * ONLY * USE * END-ACCEPT * OPEN x. USER-DEFAULT * END-ADD * OPTIONAL * USING * END-CALL x. OPTIONS x. UTF-16 * END-COMPUTE * OR x. UTF-8 * END-DELETE * ORDER x. VAL-STATUS * END-DISPLAY * ORGANIZATION x. VALID * END-DIVIDE * OTHER x. VALIDATE * END-EVALUATE * OUTPUT x. VALIDATE-STATUS * END-IF * OVERFLOW * VALUE * END-MULTIPLY * OVERLINE * VALUES * END-OF-PAGE x. OVERRIDE * VARYING * END-PERFORM * PACKED-DECIMAL * WHEN * END-READ * PADDING * WITH x. END-RECEIVE * PAGE * WORKING-STORAGE * END-RETURN x. PAGE-COUNTER * WRITE * END-REWRITE * PARAGRAPH * YYYYDDD * END-SEARCH * PERFORM * YYYYMMDD * END-START x. PF * ZERO * END-STRING x. PH * ZEROES * END-SUBTRACT * PIC * ZEROS * END-UNSTRING * PICTURE_ * SORT-RETURN_ * END-WRITE * PLUS ======================= ======================= ======================= 514 words in OC 1.1, 136 of which are marked not yet implemented. 378 functional reserved words, as of August 2008. * Menu: * ACCEPT:: * ACCESS:: * ACTIVE-CLASS:: * ADD:: * ADDRESS:: * ADVANCING:: * AFTER:: * ALIGNED:: * ALL:: * ALLOCATE:: * ALPHABET:: * ALPHABETIC:: * ALPHABETIC-LOWER:: * ALPHABETIC-UPPER:: * ALPHANUMERIC:: * ALPHANUMERIC-EDITED:: * ALSO:: * ALTER:: * ALTERNATE:: * AND:: * ANY:: * ANYCASE:: * ARE:: * AREA:: * AREAS:: * ARGUMENT-NUMBER:: * ARGUMENT-VALUE:: * ARITHMETIC:: * ASx:: * ASCENDING:: * ASSIGN:: * ATx:: * ATTRIBUTE:: * AUTO:: * AUTO-SKIP:: * AUTOMATIC:: * AUTOTERMINATE:: * B-AND:: * B-NOT:: * B-OR:: * B-XOR:: * BACKGROUND-COLOR:: * BASED:: * BEEP:: * BEFORE:: * BELL:: * BINARY:: * BINARY-C-LONG:: * BINARY-CHAR:: * BINARY-DOUBLE:: * BINARY-LONG:: * BINARY-SHORT:: * BIT:: * BLANK:: * BLINK:: * BLOCK:: * BOOLEAN:: * BOTTOM:: * BYx:: * BYTE-LENGTH:: * CALL:: * CANCEL:: * CDx:: * CENTER:: * CFx:: * CHx:: * CHAIN:: * CHAINING:: * CHARACTER:: * CHARACTERS:: * CLASS:: * CLASS-ID:: * CLASSIFICATION:: * CLOSE:: * CODE:: * CODE-SET:: * COL:: * COLLATING:: * COLS:: * COLUMN:: * COLUMNS:: * COMMA:: * COMMAND-LINE:: * COMMIT:: * COMMON:: * COMMUNICATION:: * COMP:: * COMP-1:: * COMP-2:: * COMP-3:: * COMP-4:: * COMP-5:: * COMP-X:: * COMPUTATIONAL:: * COMPUTATIONAL-1:: * COMPUTATIONAL-2:: * COMPUTATIONAL-3:: * COMPUTATIONAL-4:: * COMPUTATIONAL-5:: * COMPUTATIONAL-X:: * COMPUTE:: * CONDITION:: * CONFIGURATION:: * CONSTANT:: * CONTAINS:: * CONTENT:: * CONTINUE:: * CONTROL:: * CONTROLS:: * CONVERTING:: * COPY:: * CORR:: * CORRESPONDING:: * COUNT:: * CRT:: * CURRENCY:: * CURSOR:: * CYCLE:: * DATA:: * DATA-POINTER:: * DATE:: * DAY:: * DAY-OF-WEEK:: * DEx:: * DEBUGGING:: * DECIMAL-POINT:: * DECLARATIVES:: * DEFAULT:: * DELETE:: * DELIMITED:: * DELIMITER:: * DEPENDING:: * DESCENDING:: * DESTINATION:: * DETAIL:: * DISABLE:: * DISK:: * DISPLAY:: * DIVIDE:: * DIVISION:: * DOWN:: * DUPLICATES:: * DYNAMIC:: * EBCDIC:: * ECx:: * EGI:: * ELSE:: * EMI:: * ENABLE:: * END:: * END-ACCEPT:: * END-ADD:: * END-CALL:: * END-COMPUTE:: * END-DELETE:: * END-DISPLAY:: * END-DIVIDE:: * END-EVALUATE:: * END-IF:: * END-MULTIPLY:: * END-OF-PAGE:: * END-PERFORM:: * END-READ:: * END-RECEIVE:: * END-RETURN:: * END-REWRITE:: * END-SEARCH:: * END-START:: * END-STRING:: * END-SUBTRACT:: * END-UNSTRING:: * END-WRITE:: * ENTRY:: * ENTRY-CONVENTION:: * ENVIRONMENT:: * ENVIRONMENT-NAME:: * ENVIRONMENT-VALUE:: * EOx:: * EOL:: * EOP:: * EOS:: * EQUAL:: * EQUALS:: * ERASE:: * ERROR:: * ESCAPE:: * ESI:: * EVALUATE:: * EXCEPTION:: * EXCEPTION-OBJECT:: * EXCLUSIVE:: * EXIT:: * EXPANDS:: * EXTEND:: * EXTERNAL:: * FACTORY:: * FALSE:: * FDx:: * FILE:: * FILE-CONTROL:: * FILE-ID:: * FILLER:: * FINAL:: * FIRST:: * FLOAT-EXTENDED:: * FLOAT-LONG:: * FLOAT-SHORT:: * FOOTING:: * FOR:: * FOREGROUND-COLOR:: * FOREVER:: * FORMAT:: * FREE:: * FROM:: * FULL:: * FUNCTION:: * FUNCTION-ID:: * GENERATE:: * GET:: * GIVING:: * GLOBAL:: * GOx:: * GOBACK:: * GREATER:: * GROUP:: * GROUP-USAGE:: * HEADING:: * HIGH-VALUE:: * HIGH-VALUES:: * HIGHLIGHT:: * I-O:: * I-O-CONTROL:: * IDx:: * IDENTIFICATION:: * IFx:: * IGNORING:: * IMPLEMENTS:: * INx:: * INDEX:: * INDEXED:: * INDICATE:: * INHERITS:: * INITIAL:: * INITIALIZE:: * INITIALIZED:: * INITIATE:: * INPUT:: * INPUT-OUTPUT:: * INSPECT:: * INTERFACE:: * INTERFACE-ID:: * INTO:: * INTRINSIC:: * INVALID:: * INVOKE:: * ISx:: * JUST:: * JUSTIFIED:: * KEY:: * KEYBOARD:: * LABEL:: * LAST:: * LC_ALL:: * LC_COLLATE:: * LC_CTYPE:: * LC_MESSAGES:: * LC_MONETARY:: * LC_NUMERIC:: * LC_TIME:: * LEADING:: * LEFT:: * LENGTH:: * LESS:: * LIMIT:: * LIMITS:: * LINAGE:: * LINAGE-COUNTER:: * LINE:: * LINE-COUNTER:: * LINES:: * LINKAGE:: * LOCAL-STORAGE:: * LOCALE:: * LOCK:: * LOW-VALUE:: * LOW-VALUES:: * LOWLIGHT:: * MANUAL:: * MEMORY:: * MERGE:: * MESSAGE:: * METHOD:: * METHOD-ID:: * MINUS:: * MODE:: * MOVE:: * MULTIPLE:: * MULTIPLY:: * NATIONAL:: * NATIONAL-EDITED:: * NATIVE:: * NEGATIVE:: * NESTED:: * NEXT:: * NOx:: * NONE:: * NORMAL:: * NOT:: * NULL:: * NULLS:: * NUMBER:: * NUMBERS:: * NUMERIC:: * NUMERIC-EDITED:: * OBJECT:: * OBJECT-COMPUTER:: * OBJECT-REFERENCE:: * OCCURS:: * OFx:: * OFF:: * OMITTED:: * ONx:: * ONLY:: * OPEN:: * OPTIONAL:: * OPTIONS:: * ORx:: * ORDER:: * ORGANIZATION:: * OTHER:: * OUTPUT:: * OVERFLOW:: * OVERLINE:: * OVERRIDE:: * PACKED-DECIMAL:: * PADDING:: * PAGE:: * PAGE-COUNTER:: * PARAGRAPH:: * PERFORM:: * PFx:: * PHx:: * PIC:: * PICTURE:: * PLUS:: * POINTER:: * POSITION:: * POSITIVE:: * PRESENT:: * PREVIOUS:: * PRINTER:: * PRINTING:: * PROCEDURE:: * PROCEDURE-POINTER:: * PROCEDURES:: * PROCEED:: * PROGRAM:: * PROGRAM-ID:: * PROGRAM-POINTER:: * PROMPT:: * PROPERTY:: * PROTOTYPE:: * PURGE:: * QUEUE:: * QUOTE:: * QUOTES:: * RAISE:: * RAISING:: * RANDOM:: * RDx:: * READ:: * RECEIVE:: * RECORD:: * RECORDING:: * RECORDS:: * RECURSIVE:: * REDEFINES:: * REEL:: * REFERENCE:: * RELATION:: * RELATIVE:: * RELEASE:: * REMAINDER:: * REMOVAL:: * RENAMES:: * REPLACE:: * REPLACING:: * REPORT:: * REPORTING:: * REPORTS:: * REPOSITORY:: * REQUIRED:: * RESERVE:: * RESET:: * RESUME:: * RETRY:: * RETURN:: * RETURNING:: * REVERSE-VIDEO:: * REWIND:: * REWRITE:: * RFx:: * RHx:: * RIGHT:: * ROLLBACK:: * ROUNDED:: * RUN:: * SAME:: * SCREEN:: * SDx:: * SEARCH:: * SECONDS:: * SECTION:: * SECURE:: * SEGMENT:: * SELECT:: * SELF:: * SEND:: * SENTENCE:: * SEPARATE:: * SEQUENCE:: * SEQUENTIAL:: * SET:: * SHARING:: * SIGN:: * SIGNED:: * SIGNED-INT:: * SIGNED-LONG:: * SIGNED-SHORT:: * SIZE:: * SORT:: * SORT-MERGE:: * SORT-RETURN:: * SOURCE:: * SOURCE-COMPUTER:: * SOURCES:: * SPACE:: * SPACES:: * SPECIAL-NAMES:: * STANDARD:: * STANDARD-1:: * STANDARD-2:: * START:: * STATEMENT:: * STATUS:: * STEP:: * STOP:: * STRING:: * STRONG:: * SUB-QUEUE-1:: * SUB-QUEUE-2:: * SUB-QUEUE-3:: * SUBTRACT:: * SUM:: * SUPER:: * SUPPRESS:: * SYMBOL:: * SYMBOLIC:: * SYNC:: * SYNCHRONIZED:: * SYSTEM-DEFAULT:: * TABLE:: * TALLYING:: * TAPE:: * TERMINAL:: * TERMINATE:: * TEST:: * TEXT:: * THAN:: * THEN:: * THROUGH:: * THRU:: * TIME:: * TIMES:: * TOx:: * TOPx:: * TRAILING:: * TRUE:: * TYPE:: * TYPEDEF:: * UCS-4:: * UNDERLINE:: * UNIT:: * UNIVERSAL:: * UNLOCK:: * UNSIGNED:: * UNSIGNED-INT:: * UNSIGNED-LONG:: * UNSIGNED-SHORT:: * UNSTRING:: * UNTIL:: * UPx:: * UPDATE:: * UPON:: * USAGE:: * USE:: * USER-DEFAULT:: * USING:: * UTF-16:: * UTF-8:: * VAL-STATUS:: * VALID:: * VALIDATE:: * VALIDATE-STATUS:: * VALUE:: * VALUES:: * VARYING:: * WHEN:: * WITH:: * WORKING-STORAGE:: * WRITE:: * YYYYDDD:: * YYYYMMDD:: * ZERO:: * ZEROES:: * ZEROS::  File: ocfaq.info, Node: ACCEPT, Next: ACCESS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.1 ACCEPT ............... ACCEPT variable FROM CONSOLE. ACCEPT variable FROM ENVIRONMENT "path". ACCEPT variable FROM COMMAND LINE. ACCEPT screen-variable.  File: ocfaq.info, Node: ACCESS, Next: ACTIVE-CLASS, Prev: ACCEPT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.2 ACCESS ............... SELECT filename ASSIGN TO "filename.dat" ACCESS MODE IS RANDOM RELATIVE KEY IS keyfield.  File: ocfaq.info, Node: ACTIVE-CLASS, Next: ADD, Prev: ACCESS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.3 ACTIVE-CLASS ..................... Not yet implemented. Object COBOL feature.  File: ocfaq.info, Node: ADD, Next: ADDRESS, Prev: ACTIVE-CLASS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.4 ADD ............ ADD 1 TO cobol GIVING OpenCOBOL END-ADD.  File: ocfaq.info, Node: ADDRESS, Next: ADVANCING, Prev: ADD, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.5 ADDRESS ................ SET pointer-variable TO ADDRESS OF linkage-store.  File: ocfaq.info, Node: ADVANCING, Next: AFTER, Prev: ADDRESS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.6 ADVANCING .................. DISPLAY "Legend: " WITH NO ADVANCING END-DISPLAY. WRITE printrecord AFTER ADVANCING PAGE END-WRITE.  File: ocfaq.info, Node: AFTER, Next: ALIGNED, Prev: ADVANCING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.7 AFTER .............. PERFORM WITH TEST AFTER VARYING variable FROM 1 BY 1 UNTIL variable > 10 DISPLAY variable END-DISPLAY END-PERFORM.  File: ocfaq.info, Node: ALIGNED, Next: ALL, Prev: AFTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.8 ALIGNED ................  File: ocfaq.info, Node: ALL, Next: ALLOCATE, Prev: ALIGNED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.9 ALL ............ INSPECT variable REPLACING ALL "123" WITH "456".  File: ocfaq.info, Node: ALLOCATE, Next: ALPHABET, Prev: ALL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.10 ALLOCATE .................. ALLOCATE based-var INITIALIZED RETURNING pointer-var.  File: ocfaq.info, Node: ALPHABET, Next: ALPHABETIC, Prev: ALLOCATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.11 ALPHABET .................. * Set up for a mixed case SORT COLLATING SEQUENCE IS CONFIGURATION SECTION. SPECIAL-NAMES. ALPHABET name IS "AaBbCcDdEe..".  File: ocfaq.info, Node: ALPHABETIC, Next: ALPHABETIC-LOWER, Prev: ALPHABET, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.12 ALPHABETIC .................... IF variable IS ALPHABETIC DISPLAY "alphabetic" END-DISPLAY END-IF  File: ocfaq.info, Node: ALPHABETIC-LOWER, Next: ALPHABETIC-UPPER, Prev: ALPHABETIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.13 ALPHABETIC-LOWER .......................... IF variable IS ALPHABETIC-LOWER DISPLAY "alphabetic-lower" END-DISPLAY END-IF  File: ocfaq.info, Node: ALPHABETIC-UPPER, Next: ALPHANUMERIC, Prev: ALPHABETIC-LOWER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.14 ALPHABETIC-UPPER .......................... DISPLAY variable "alphabetic-upper " WITH NO ADVANCING IF variable IS ALPHABETIC-UPPER DISPLAY "true" END-DISPLAY ELSE DISPLAY "false" END-DISPLAY END-IF  File: ocfaq.info, Node: ALPHANUMERIC, Next: ALPHANUMERIC-EDITED, Prev: ALPHABETIC-UPPER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.15 ALPHANUMERIC ...................... INITIALIZE data-record REPLACING ALPHANUMERIC BY literal-value  File: ocfaq.info, Node: ALPHANUMERIC-EDITED, Next: ALSO, Prev: ALPHANUMERIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.16 ALPHANUMERIC-EDITED ............................. INITIALIZE data-record REPLACING ALPHANUMERIC-EDITED BY identifier-1  File: ocfaq.info, Node: ALSO, Next: ALTER, Prev: ALPHANUMERIC-EDITED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.17 ALSO .............. EVALUATE variable ALSO second-test WHEN "A" ALSO 1 THRU 5 PERFORM first-case WHEN "A" ALSO 6 PERFORM second-case WHEN "A" ALSO 7 THRU 9 PERFORM third-case WHEN OTHER PERFORM invalid-case END-EVALUATE  File: ocfaq.info, Node: ALTER, Next: ALTERNATE, Prev: ALSO, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.18 ALTER ............... Yeah, just don't.  File: ocfaq.info, Node: ALTERNATE, Next: AND, Prev: ALTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.19 ALTERNATE ................... SELECT file ASSIGN TO filename ACCESS MODE IS RANDOM RECORD KEY IS key-field ALTERNATE KEY IS alt-key WITH DUPLICATES.  File: ocfaq.info, Node: AND, Next: ANY, Prev: ALTERNATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.20 AND ............. COBOL rules of precedence are; NOT, AND, OR. IF field = "A" AND num = 3 DISPLAY "got 3" END-DISPLAY END-IF COBOL also allows abbreviated combined relational conditions. IF NOT (a NOT > b AND c AND NOT d) code END-IF is equivalent to IF NOT (((a NOT > b) AND (a NOT > c)) AND (NOT (a NOT > d))) code END-IF  File: ocfaq.info, Node: ANY, Next: ANYCASE, Prev: AND, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.21 ANY ............. EVALUATE TRUE ALSO TRUE WHEN a > 3 ALSO ANY _> b can be any value_* PERFORM a-4-b-any WHEN a = 3 ALSO b = 1 PERFORM a-3-b-1 END-EVALUATE  File: ocfaq.info, Node: ANYCASE, Next: ARE, Prev: ANY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.22 ANYCASE .................  File: ocfaq.info, Node: ARE, Next: AREA, Prev: ANYCASE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.23 ARE ............. 01 cond-1 PIC X. 88 first-truth VALUES ARE "A" "B" "C". 88 second-truth VALUES ARE "X" "Y" "Z".  File: ocfaq.info, Node: AREA, Next: AREAS, Prev: ARE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.24 AREA .............. I-O-CONTROL. SAME RECORD AREA FOR file1, file2.  File: ocfaq.info, Node: AREAS, Next: ARGUMENT-NUMBER, Prev: AREA, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.25 AREAS ...............  File: ocfaq.info, Node: ARGUMENT-NUMBER, Next: ARGUMENT-VALUE, Prev: AREAS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.26 ARGUMENT-NUMBER .........................  File: ocfaq.info, Node: ARGUMENT-VALUE, Next: ARITHMETIC, Prev: ARGUMENT-NUMBER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.27 ARGUMENT-VALUE ........................ Returns the next command line argument. This post from John on opencobol.org_ is an excellent idiom for parsing command line arguments without too much worry as to the order. >>source format is free _>_*********************************_*_> Author: jrls (John Ellis) _> Date: Nov-2008_> Purpose: command line processing _>_*********************************_* identification division. program-id. cmdline. data division._> working-storage section. _>_*********_*_*********_* 01 argv pic x(100) value spaces. 88 recv value "-r", "-recv". 88 email value "-e", "-email". 88 delivered value "-d", "-delivered". 01 cmdstatus pic x value spaces. 88 lastcmd value "l". 01 reptinfo. 05 rept-recv pic x(30) value spaces. 05 rept-howsent pic x(10) value spaces._> procedure division. 0000-start. _> perform until lastcmd move low-values to argv accept argv from argument-value if argv > low-values perform 0100-process-arguments else move "l" to cmdstatus end-if end-perform display reptinfo. stop run._> 0100-process-arguments. _> evaluate true when recv if rept-recv = spaces accept rept-recv from argument-value else display "duplicate " argv end-if when email move "email" to rept-howsent when delivered move "delivered" to rept-howsent when other display "invalid switch: " argv end-evaluate._><* Example run: ./cmdline --recv "john ellis" -e -f invalid switch: -f john ellis email  File: ocfaq.info, Node: ARITHMETIC, Next: ASx, Prev: ARGUMENT-VALUE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.28 ARITHMETIC ....................  File: ocfaq.info, Node: ASx, Next: ASCENDING, Prev: ARITHMETIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.29 ASx .............  File: ocfaq.info, Node: ASCENDING, Next: ASSIGN, Prev: ASx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.30 ASCENDING ...................  File: ocfaq.info, Node: ASSIGN, Next: ATx, Prev: ASCENDING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.31 ASSIGN ................  File: ocfaq.info, Node: ATx, Next: ATTRIBUTE, Prev: ASSIGN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.32 ATx .............  File: ocfaq.info, Node: ATTRIBUTE, Next: AUTO, Prev: ATx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.33 ATTRIBUTE ...................  File: ocfaq.info, Node: AUTO, Next: AUTO-SKIP, Prev: ATTRIBUTE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.34 AUTO ..............  File: ocfaq.info, Node: AUTO-SKIP, Next: AUTOMATIC, Prev: AUTO, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.35 AUTO-SKIP ...................  File: ocfaq.info, Node: AUTOMATIC, Next: AUTOTERMINATE, Prev: AUTO-SKIP, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.36 AUTOMATIC ...................  File: ocfaq.info, Node: AUTOTERMINATE, Next: B-AND, Prev: AUTOMATIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.37 AUTOTERMINATE .......................  File: ocfaq.info, Node: B-AND, Next: B-NOT, Prev: AUTOTERMINATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.38 B-AND ...............  File: ocfaq.info, Node: B-NOT, Next: B-OR, Prev: B-AND, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.39 B-NOT ...............  File: ocfaq.info, Node: B-OR, Next: B-XOR, Prev: B-NOT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.40 B-OR ..............  File: ocfaq.info, Node: B-XOR, Next: BACKGROUND-COLOR, Prev: B-OR, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.41 B-XOR ...............  File: ocfaq.info, Node: BACKGROUND-COLOR, Next: BASED, Prev: B-XOR, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.42 BACKGROUND-COLOR .......................... 05 BLANK SCREEN BACKGROUND-COLOR 7 FOREGROUND-COLOR 0.  File: ocfaq.info, Node: BASED, Next: BEEP, Prev: BACKGROUND-COLOR, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.43 BASED ............... 01 based-var PIC X(80) BASED. A sample posted by [human]_ _---------------------------------------------------------------- IDENTIFICATION DIVISION. PROGRAM-ID. 'MEMALL'. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. INPUT-OUTPUT SECTION. FILE-CONTROL. DATA DIVISION. FILE SECTION._ WORKING-STORAGE SECTION. * 77 mychar pic x. 01 REC-TEST BASED. 03 REC-TEST-PART1 PIC X(5500000). 03 REC-TEST-PART2 PIC X(0100000). 03 REC-TEST-PART3 PIC X(1200000). 03 REC-TEST-PART4 PIC X(1200000). 03 REC-TEST-PART5 PIC X(1700000). _---------------------------------------------------------------- LINKAGE SECTION._---------------------------------------------------------------- PROCEDURE DIVISION. declaratives. end declaratives. _---------------------------------------------------------------- main section. 00. FREE ADDRESS OF REC-TEST display 'MEMALL loaded and REC-TEST FREEd before ALLOCATE' accept mychar_ IF ADDRESS OF REC-TEST = NULL display 'REC-TEST was not allocated before' ELSE display 'REC-TEST was allocated before' END-IF accept mychar * ALLOCATE REC-TEST move all '9' to REC-TEST display 'REC-TEST allocated and filled with ' REC-TEST (1:9) end-display accept mychar * IF ADDRESS OF REC-TEST = NULL display 'REC-TEST was not allocated before' ALLOCATE REC-TEST display 'REC-TEST allocated again, filled with ' REC-TEST (1:9) end-display ELSE display 'REC-TEST was allocated before' END-IF accept mychar * FREE ADDRESS OF REC-TEST display 'REC-TEST FREEd' accept mychar * stop run * continue. ex. exit program. _----------------------------------------------------------------_-- End of program MEMALL --------------------------------------  File: ocfaq.info, Node: BEEP, Next: BEFORE, Prev: BASED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.44 BEEP .............. DISPLAY "Beeeeep" LINE 3 COLUMN 1 WITH BEEP END-DISPLAY.  File: ocfaq.info, Node: BEFORE, Next: BELL, Prev: BEEP, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.45 BEFORE ................  File: ocfaq.info, Node: BELL, Next: BINARY, Prev: BEFORE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.46 BELL .............. DISPLAY "Beeeeep" LINE 3 COLUMN 1 WITH BELL END-DISPLAY.  File: ocfaq.info, Node: BINARY, Next: BINARY-C-LONG, Prev: BELL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.47 BINARY ................  File: ocfaq.info, Node: BINARY-C-LONG, Next: BINARY-CHAR, Prev: BINARY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.48 BINARY-C-LONG .......................  File: ocfaq.info, Node: BINARY-CHAR, Next: BINARY-DOUBLE, Prev: BINARY-C-LONG, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.49 BINARY-CHAR .....................  File: ocfaq.info, Node: BINARY-DOUBLE, Next: BINARY-LONG, Prev: BINARY-CHAR, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.50 BINARY-DOUBLE .......................  File: ocfaq.info, Node: BINARY-LONG, Next: BINARY-SHORT, Prev: BINARY-DOUBLE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.51 BINARY-LONG .....................  File: ocfaq.info, Node: BINARY-SHORT, Next: BIT, Prev: BINARY-LONG, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.52 BINARY-SHORT ......................  File: ocfaq.info, Node: BIT, Next: BLANK, Prev: BINARY-SHORT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.53 BIT .............  File: ocfaq.info, Node: BLANK, Next: BLINK, Prev: BIT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.54 BLANK ............... 05 BLANK SCREEN BACKGROUND-COLOR 7 FOREGROUND-COLOR 0.  File: ocfaq.info, Node: BLINK, Next: BLOCK, Prev: BLANK, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.55 BLINK ...............  File: ocfaq.info, Node: BLOCK, Next: BOOLEAN, Prev: BLINK, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.56 BLOCK ...............  File: ocfaq.info, Node: BOOLEAN, Next: BOTTOM, Prev: BLOCK, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.57 BOOLEAN .................  File: ocfaq.info, Node: BOTTOM, Next: BYx, Prev: BOOLEAN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.58 BOTTOM ................  File: ocfaq.info, Node: BYx, Next: BYTE-LENGTH, Prev: BOTTOM, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.59 BYx .............  File: ocfaq.info, Node: BYTE-LENGTH, Next: CALL, Prev: BYx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.60 BYTE-LENGTH .....................  File: ocfaq.info, Node: CALL, Next: CANCEL, Prev: BYTE-LENGTH, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.61 CALL .............. The OpenCOBOL CALL verb accepts literal or identifier stored names when resolving the transfer address. The USING phrase allows argument passing and OpenCOBOL includes internal rules for the data representation of the call stack entities that depend on the COBOL PICTURE_ and USAGE_ clauses. Return values are captured with RETURNING identifier. See `What STOCK CALL LIBRARY does OpenCOBOL offer?`_. For more information see http://www.opencobol.org/modules/bwiki/index.php?cmd=read&page=UserManual%2F2_3#content_1_0 (http://www.opencobol.org/modules/bwiki/index.php?cmd=read&page=UserManual%2F2_3#content_1_0)  File: ocfaq.info, Node: CANCEL, Next: CDx, Prev: CALL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.62 CANCEL ................  File: ocfaq.info, Node: CDx, Next: CENTER, Prev: CANCEL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.63 CDx .............  File: ocfaq.info, Node: CENTER, Next: CFx, Prev: CDx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.64 CENTER ................  File: ocfaq.info, Node: CFx, Next: CHx, Prev: CENTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.65 CFx .............  File: ocfaq.info, Node: CHx, Next: CHAIN, Prev: CFx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.66 CHx .............  File: ocfaq.info, Node: CHAIN, Next: CHAINING, Prev: CHx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.67 CHAIN ...............  File: ocfaq.info, Node: CHAINING, Next: CHARACTER, Prev: CHAIN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.68 CHAINING .................. Passes procedure division data through WORKING-STORAGE and can be used for shell command line arguments as well as in CALL "myprog" USING string. from opencobol.org_ by human_ WORKING-STORAGE SECTION. 01 cmd-argument. 02 some-text pic x(256). procedure division Chaining cmd-argument. display 'You wrote:' '>"' function trim(some-text) '"' 'from shell command line' end-display  File: ocfaq.info, Node: CHARACTER, Next: CHARACTERS, Prev: CHAINING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.69 CHARACTER ...................  File: ocfaq.info, Node: CHARACTERS, Next: CLASS, Prev: CHARACTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.70 CHARACTERS ....................  File: ocfaq.info, Node: CLASS, Next: CLASS-ID, Prev: CHARACTERS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.71 CLASS ...............  File: ocfaq.info, Node: CLASS-ID, Next: CLASSIFICATION, Prev: CLASS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.72 CLASS-ID ..................  File: ocfaq.info, Node: CLASSIFICATION, Next: CLOSE, Prev: CLASS-ID, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.73 CLASSIFICATION ........................  File: ocfaq.info, Node: CLOSE, Next: CODE, Prev: CLASSIFICATION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.74 CLOSE ...............  File: ocfaq.info, Node: CODE, Next: CODE-SET, Prev: CLOSE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.75 CODE ..............  File: ocfaq.info, Node: CODE-SET, Next: COL, Prev: CODE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.76 CODE-SET ..................  File: ocfaq.info, Node: COL, Next: COLLATING, Prev: CODE-SET, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.77 COL .............  File: ocfaq.info, Node: COLLATING, Next: COLS, Prev: COL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.78 COLLATING ...................  File: ocfaq.info, Node: COLS, Next: COLUMN, Prev: COLLATING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.79 COLS ..............  File: ocfaq.info, Node: COLUMN, Next: COLUMNS, Prev: COLS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.80 COLUMN ................  File: ocfaq.info, Node: COLUMNS, Next: COMMA, Prev: COLUMN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.81 COLUMNS .................  File: ocfaq.info, Node: COMMA, Next: COMMAND-LINE, Prev: COLUMNS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.82 COMMA ...............  File: ocfaq.info, Node: COMMAND-LINE, Next: COMMIT, Prev: COMMA, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.83 COMMAND-LINE ......................  File: ocfaq.info, Node: COMMIT, Next: COMMON, Prev: COMMAND-LINE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.84 COMMIT ................  File: ocfaq.info, Node: COMMON, Next: COMMUNICATION, Prev: COMMIT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.85 COMMON ................  File: ocfaq.info, Node: COMMUNICATION, Next: COMP, Prev: COMMON, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.86 COMMUNICATION .......................  File: ocfaq.info, Node: COMP, Next: COMP-1, Prev: COMMUNICATION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.87 COMP ..............  File: ocfaq.info, Node: COMP-1, Next: COMP-2, Prev: COMP, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.88 COMP-1 ................  File: ocfaq.info, Node: COMP-2, Next: COMP-3, Prev: COMP-1, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.89 COMP-2 ................  File: ocfaq.info, Node: COMP-3, Next: COMP-4, Prev: COMP-2, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.90 COMP-3 ................  File: ocfaq.info, Node: COMP-4, Next: COMP-5, Prev: COMP-3, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.91 COMP-4 ................  File: ocfaq.info, Node: COMP-5, Next: COMP-X, Prev: COMP-4, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.92 COMP-5 ................  File: ocfaq.info, Node: COMP-X, Next: COMPUTATIONAL, Prev: COMP-5, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.93 COMP-X ................  File: ocfaq.info, Node: COMPUTATIONAL, Next: COMPUTATIONAL-1, Prev: COMP-X, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.94 COMPUTATIONAL .......................  File: ocfaq.info, Node: COMPUTATIONAL-1, Next: COMPUTATIONAL-2, Prev: COMPUTATIONAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.95 COMPUTATIONAL-1 .........................  File: ocfaq.info, Node: COMPUTATIONAL-2, Next: COMPUTATIONAL-3, Prev: COMPUTATIONAL-1, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.96 COMPUTATIONAL-2 .........................  File: ocfaq.info, Node: COMPUTATIONAL-3, Next: COMPUTATIONAL-4, Prev: COMPUTATIONAL-2, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.97 COMPUTATIONAL-3 .........................  File: ocfaq.info, Node: COMPUTATIONAL-4, Next: COMPUTATIONAL-5, Prev: COMPUTATIONAL-3, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.98 COMPUTATIONAL-4 .........................  File: ocfaq.info, Node: COMPUTATIONAL-5, Next: COMPUTATIONAL-X, Prev: COMPUTATIONAL-4, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.99 COMPUTATIONAL-5 .........................  File: ocfaq.info, Node: COMPUTATIONAL-X, Next: COMPUTE, Prev: COMPUTATIONAL-5, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.100 COMPUTATIONAL-X ..........................  File: ocfaq.info, Node: COMPUTE, Next: CONDITION, Prev: COMPUTATIONAL-X, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.101 COMPUTE ..................  File: ocfaq.info, Node: CONDITION, Next: CONFIGURATION, Prev: COMPUTE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.102 CONDITION ....................  File: ocfaq.info, Node: CONFIGURATION, Next: CONSTANT, Prev: CONDITION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.103 CONFIGURATION ........................  File: ocfaq.info, Node: CONSTANT, Next: CONTAINS, Prev: CONFIGURATION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.104 CONSTANT ...................  File: ocfaq.info, Node: CONTAINS, Next: CONTENT, Prev: CONSTANT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.105 CONTAINS ...................  File: ocfaq.info, Node: CONTENT, Next: CONTINUE, Prev: CONTAINS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.106 CONTENT ..................  File: ocfaq.info, Node: CONTINUE, Next: CONTROL, Prev: CONTENT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.107 CONTINUE ...................  File: ocfaq.info, Node: CONTROL, Next: CONTROLS, Prev: CONTINUE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.108 CONTROL ..................  File: ocfaq.info, Node: CONTROLS, Next: CONVERTING, Prev: CONTROL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.109 CONTROLS ...................  File: ocfaq.info, Node: CONVERTING, Next: COPY, Prev: CONTROLS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.110 CONVERTING .....................  File: ocfaq.info, Node: COPY, Next: CORR, Prev: CONVERTING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.111 COPY ...............  File: ocfaq.info, Node: CORR, Next: CORRESPONDING, Prev: COPY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.112 CORR ...............  File: ocfaq.info, Node: CORRESPONDING, Next: COUNT, Prev: CORR, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.113 CORRESPONDING ........................  File: ocfaq.info, Node: COUNT, Next: CRT, Prev: CORRESPONDING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.114 COUNT ................  File: ocfaq.info, Node: CRT, Next: CURRENCY, Prev: COUNT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.115 CRT ..............  File: ocfaq.info, Node: CURRENCY, Next: CURSOR, Prev: CRT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.116 CURRENCY ...................  File: ocfaq.info, Node: CURSOR, Next: CYCLE, Prev: CURRENCY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.117 CURSOR .................  File: ocfaq.info, Node: CYCLE, Next: DATA, Prev: CURSOR, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.118 CYCLE ................  File: ocfaq.info, Node: DATA, Next: DATA-POINTER, Prev: CYCLE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.119 DATA ...............  File: ocfaq.info, Node: DATA-POINTER, Next: DATE, Prev: DATA, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.120 DATA-POINTER .......................  File: ocfaq.info, Node: DATE, Next: DAY, Prev: DATA-POINTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.121 DATE ...............  File: ocfaq.info, Node: DAY, Next: DAY-OF-WEEK, Prev: DATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.122 DAY ..............  File: ocfaq.info, Node: DAY-OF-WEEK, Next: DEx, Prev: DAY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.123 DAY-OF-WEEK ......................  File: ocfaq.info, Node: DEx, Next: DEBUGGING, Prev: DAY-OF-WEEK, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.124 DEx ..............  File: ocfaq.info, Node: DEBUGGING, Next: DECIMAL-POINT, Prev: DEx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.125 DEBUGGING ....................  File: ocfaq.info, Node: DECIMAL-POINT, Next: DECLARATIVES, Prev: DEBUGGING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.126 DECIMAL-POINT ........................  File: ocfaq.info, Node: DECLARATIVES, Next: DEFAULT, Prev: DECIMAL-POINT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.127 DECLARATIVES .......................  File: ocfaq.info, Node: DEFAULT, Next: DELETE, Prev: DECLARATIVES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.128 DEFAULT ..................  File: ocfaq.info, Node: DELETE, Next: DELIMITED, Prev: DEFAULT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.129 DELETE .................  File: ocfaq.info, Node: DELIMITED, Next: DELIMITER, Prev: DELETE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.130 DELIMITED ....................  File: ocfaq.info, Node: DELIMITER, Next: DEPENDING, Prev: DELIMITED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.131 DELIMITER ....................  File: ocfaq.info, Node: DEPENDING, Next: DESCENDING, Prev: DELIMITER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.132 DEPENDING ....................  File: ocfaq.info, Node: DESCENDING, Next: DESTINATION, Prev: DEPENDING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.133 DESCENDING .....................  File: ocfaq.info, Node: DESTINATION, Next: DETAIL, Prev: DESCENDING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.134 DESTINATION ......................  File: ocfaq.info, Node: DETAIL, Next: DISABLE, Prev: DESTINATION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.135 DETAIL .................  File: ocfaq.info, Node: DISABLE, Next: DISK, Prev: DETAIL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.136 DISABLE ..................  File: ocfaq.info, Node: DISK, Next: DISPLAY, Prev: DISABLE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.137 DISK ...............  File: ocfaq.info, Node: DISPLAY, Next: DIVIDE, Prev: DISK, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.138 DISPLAY ..................  File: ocfaq.info, Node: DIVIDE, Next: DIVISION, Prev: DISPLAY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.139 DIVIDE .................  File: ocfaq.info, Node: DIVISION, Next: DOWN, Prev: DIVIDE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.140 DIVISION ...................  File: ocfaq.info, Node: DOWN, Next: DUPLICATES, Prev: DIVISION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.141 DOWN ...............  File: ocfaq.info, Node: DUPLICATES, Next: DYNAMIC, Prev: DOWN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.142 DUPLICATES .....................  File: ocfaq.info, Node: DYNAMIC, Next: EBCDIC, Prev: DUPLICATES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.143 DYNAMIC ..................  File: ocfaq.info, Node: EBCDIC, Next: ECx, Prev: DYNAMIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.144 EBCDIC ................. Extended Binary Coded Decimal Interchange Code. A character encoding common to mainframe systems, therefore COBOL, therefore OpenCOBOL. Different than ASCII_ and OpenCOBOL supports both through efficient mappings. See http://en.wikipedia.org/wiki/EBCDIC (http://en.wikipedia.org/wiki/EBCDIC) for more info. ASCII to EBCDIC conversion the OpenCOBOL way: SPECIAL-NAMES. ALPHABET ALPHA IS NATIVE. ALPHABET BETA IS EBCDIC. PROCEDURE DIVISION. INSPECT variable CONVERTING ALPHA TO BETA  File: ocfaq.info, Node: ECx, Next: EGI, Prev: EBCDIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.145 ECx ..............  File: ocfaq.info, Node: EGI, Next: ELSE, Prev: ECx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.146 EGI ..............  File: ocfaq.info, Node: ELSE, Next: EMI, Prev: EGI, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.147 ELSE ...............  File: ocfaq.info, Node: EMI, Next: ENABLE, Prev: ELSE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.148 EMI ..............  File: ocfaq.info, Node: ENABLE, Next: END, Prev: EMI, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.149 ENABLE .................  File: ocfaq.info, Node: END, Next: END-ACCEPT, Prev: ENABLE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.150 END ..............  File: ocfaq.info, Node: END-ACCEPT, Next: END-ADD, Prev: END, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.151 END-ACCEPT .....................  File: ocfaq.info, Node: END-ADD, Next: END-CALL, Prev: END-ACCEPT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.152 END-ADD ..................  File: ocfaq.info, Node: END-CALL, Next: END-COMPUTE, Prev: END-ADD, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.153 END-CALL ...................  File: ocfaq.info, Node: END-COMPUTE, Next: END-DELETE, Prev: END-CALL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.154 END-COMPUTE ......................  File: ocfaq.info, Node: END-DELETE, Next: END-DISPLAY, Prev: END-COMPUTE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.155 END-DELETE .....................  File: ocfaq.info, Node: END-DISPLAY, Next: END-DIVIDE, Prev: END-DELETE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.156 END-DISPLAY ......................  File: ocfaq.info, Node: END-DIVIDE, Next: END-EVALUATE, Prev: END-DISPLAY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.157 END-DIVIDE .....................  File: ocfaq.info, Node: END-EVALUATE, Next: END-IF, Prev: END-DIVIDE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.158 END-EVALUATE .......................  File: ocfaq.info, Node: END-IF, Next: END-MULTIPLY, Prev: END-EVALUATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.159 END-IF .................  File: ocfaq.info, Node: END-MULTIPLY, Next: END-OF-PAGE, Prev: END-IF, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.160 END-MULTIPLY .......................  File: ocfaq.info, Node: END-OF-PAGE, Next: END-PERFORM, Prev: END-MULTIPLY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.161 END-OF-PAGE ......................  File: ocfaq.info, Node: END-PERFORM, Next: END-READ, Prev: END-OF-PAGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.162 END-PERFORM ......................  File: ocfaq.info, Node: END-READ, Next: END-RECEIVE, Prev: END-PERFORM, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.163 END-READ ...................  File: ocfaq.info, Node: END-RECEIVE, Next: END-RETURN, Prev: END-READ, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.164 END-RECEIVE ......................  File: ocfaq.info, Node: END-RETURN, Next: END-REWRITE, Prev: END-RECEIVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.165 END-RETURN .....................  File: ocfaq.info, Node: END-REWRITE, Next: END-SEARCH, Prev: END-RETURN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.166 END-REWRITE ......................  File: ocfaq.info, Node: END-SEARCH, Next: END-START, Prev: END-REWRITE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.167 END-SEARCH .....................  File: ocfaq.info, Node: END-START, Next: END-STRING, Prev: END-SEARCH, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.168 END-START ....................  File: ocfaq.info, Node: END-STRING, Next: END-SUBTRACT, Prev: END-START, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.169 END-STRING .....................  File: ocfaq.info, Node: END-SUBTRACT, Next: END-UNSTRING, Prev: END-STRING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.170 END-SUBTRACT .......................  File: ocfaq.info, Node: END-UNSTRING, Next: END-WRITE, Prev: END-SUBTRACT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.171 END-UNSTRING .......................  File: ocfaq.info, Node: END-WRITE, Next: ENTRY, Prev: END-UNSTRING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.172 END-WRITE ....................  File: ocfaq.info, Node: ENTRY, Next: ENTRY-CONVENTION, Prev: END-WRITE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.173 ENTRY ................  File: ocfaq.info, Node: ENTRY-CONVENTION, Next: ENVIRONMENT, Prev: ENTRY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.174 ENTRY-CONVENTION ...........................  File: ocfaq.info, Node: ENVIRONMENT, Next: ENVIRONMENT-NAME, Prev: ENTRY-CONVENTION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.175 ENVIRONMENT ......................  File: ocfaq.info, Node: ENVIRONMENT-NAME, Next: ENVIRONMENT-VALUE, Prev: ENVIRONMENT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.176 ENVIRONMENT-NAME ...........................  File: ocfaq.info, Node: ENVIRONMENT-VALUE, Next: EOx, Prev: ENVIRONMENT-NAME, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.177 ENVIRONMENT-VALUE ............................  File: ocfaq.info, Node: EOx, Next: EOL, Prev: ENVIRONMENT-VALUE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.178 EOx ..............  File: ocfaq.info, Node: EOL, Next: EOP, Prev: EOx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.179 EOL ..............  File: ocfaq.info, Node: EOP, Next: EOS, Prev: EOL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.180 EOP ..............  File: ocfaq.info, Node: EOS, Next: EQUAL, Prev: EOP, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.181 EOS ..............  File: ocfaq.info, Node: EQUAL, Next: EQUALS, Prev: EOS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.182 EQUAL ................  File: ocfaq.info, Node: EQUALS, Next: ERASE, Prev: EQUAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.183 EQUALS .................  File: ocfaq.info, Node: ERASE, Next: ERROR, Prev: EQUALS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.184 ERASE ................  File: ocfaq.info, Node: ERROR, Next: ESCAPE, Prev: ERASE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.185 ERROR ................  File: ocfaq.info, Node: ESCAPE, Next: ESI, Prev: ERROR, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.186 ESCAPE .................  File: ocfaq.info, Node: ESI, Next: EVALUATE, Prev: ESCAPE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.187 ESI ..............  File: ocfaq.info, Node: EVALUATE, Next: EXCEPTION, Prev: ESI, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.188 EVALUATE ...................  File: ocfaq.info, Node: EXCEPTION, Next: EXCEPTION-OBJECT, Prev: EVALUATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.189 EXCEPTION ....................  File: ocfaq.info, Node: EXCEPTION-OBJECT, Next: EXCLUSIVE, Prev: EXCEPTION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.190 EXCEPTION-OBJECT ...........................  File: ocfaq.info, Node: EXCLUSIVE, Next: EXIT, Prev: EXCEPTION-OBJECT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.191 EXCLUSIVE ....................  File: ocfaq.info, Node: EXIT, Next: EXPANDS, Prev: EXCLUSIVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.192 EXIT ...............  File: ocfaq.info, Node: EXPANDS, Next: EXTEND, Prev: EXIT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.193 EXPANDS ..................  File: ocfaq.info, Node: EXTEND, Next: EXTERNAL, Prev: EXPANDS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.194 EXTEND .................  File: ocfaq.info, Node: EXTERNAL, Next: FACTORY, Prev: EXTEND, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.195 EXTERNAL ...................  File: ocfaq.info, Node: FACTORY, Next: FALSE, Prev: EXTERNAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.196 FACTORY ..................  File: ocfaq.info, Node: FALSE, Next: FDx, Prev: FACTORY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.197 FALSE ................  File: ocfaq.info, Node: FDx, Next: FILE, Prev: FALSE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.198 FDx ..............  File: ocfaq.info, Node: FILE, Next: FILE-CONTROL, Prev: FDx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.199 FILE ...............  File: ocfaq.info, Node: FILE-CONTROL, Next: FILE-ID, Prev: FILE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.200 FILE-CONTROL .......................  File: ocfaq.info, Node: FILE-ID, Next: FILLER, Prev: FILE-CONTROL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.201 FILE-ID ..................  File: ocfaq.info, Node: FILLER, Next: FINAL, Prev: FILE-ID, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.202 FILLER .................  File: ocfaq.info, Node: FINAL, Next: FIRST, Prev: FILLER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.203 FINAL ................  File: ocfaq.info, Node: FIRST, Next: FLOAT-EXTENDED, Prev: FINAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.204 FIRST ................  File: ocfaq.info, Node: FLOAT-EXTENDED, Next: FLOAT-LONG, Prev: FIRST, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.205 FLOAT-EXTENDED .........................  File: ocfaq.info, Node: FLOAT-LONG, Next: FLOAT-SHORT, Prev: FLOAT-EXTENDED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.206 FLOAT-LONG .....................  File: ocfaq.info, Node: FLOAT-SHORT, Next: FOOTING, Prev: FLOAT-LONG, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.207 FLOAT-SHORT ......................  File: ocfaq.info, Node: FOOTING, Next: FOR, Prev: FLOAT-SHORT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.208 FOOTING ..................  File: ocfaq.info, Node: FOR, Next: FOREGROUND-COLOR, Prev: FOOTING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.209 FOR ..............  File: ocfaq.info, Node: FOREGROUND-COLOR, Next: FOREVER, Prev: FOR, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.210 FOREGROUND-COLOR ...........................  File: ocfaq.info, Node: FOREVER, Next: FORMAT, Prev: FOREGROUND-COLOR, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.211 FOREVER ..................  File: ocfaq.info, Node: FORMAT, Next: FREE, Prev: FOREVER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.212 FORMAT .................  File: ocfaq.info, Node: FREE, Next: FROM, Prev: FORMAT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.213 FREE ...............  File: ocfaq.info, Node: FROM, Next: FULL, Prev: FREE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.214 FROM ...............  File: ocfaq.info, Node: FULL, Next: FUNCTION, Prev: FROM, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.215 FULL ...............  File: ocfaq.info, Node: FUNCTION, Next: FUNCTION-ID, Prev: FULL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.216 FUNCTION ................... DISPLAY FUNCTION TRIM(" trim off leading spaces" LEADING) END-DISPLAY.  File: ocfaq.info, Node: FUNCTION-ID, Next: GENERATE, Prev: FUNCTION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.217 FUNCTION-ID ......................  File: ocfaq.info, Node: GENERATE, Next: GET, Prev: FUNCTION-ID, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.218 GENERATE ...................  File: ocfaq.info, Node: GET, Next: GIVING, Prev: GENERATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.219 GET ..............  File: ocfaq.info, Node: GIVING, Next: GLOBAL, Prev: GET, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.220 GIVING ................. ADD 1 TO cobol GIVING OpenCOBOL.  File: ocfaq.info, Node: GLOBAL, Next: GOx, Prev: GIVING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.221 GLOBAL .................  File: ocfaq.info, Node: GOx, Next: GOBACK, Prev: GLOBAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.222 GOx ..............  File: ocfaq.info, Node: GOBACK, Next: GREATER, Prev: GOx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.223 GOBACK ................. GOBACK.  File: ocfaq.info, Node: GREATER, Next: GROUP, Prev: GOBACK, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.224 GREATER ..................  File: ocfaq.info, Node: GROUP, Next: GROUP-USAGE, Prev: GREATER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.225 GROUP ................  File: ocfaq.info, Node: GROUP-USAGE, Next: HEADING, Prev: GROUP, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.226 GROUP-USAGE ......................  File: ocfaq.info, Node: HEADING, Next: HIGH-VALUE, Prev: GROUP-USAGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.227 HEADING ..................  File: ocfaq.info, Node: HIGH-VALUE, Next: HIGH-VALUES, Prev: HEADING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.228 HIGH-VALUE .....................  File: ocfaq.info, Node: HIGH-VALUES, Next: HIGHLIGHT, Prev: HIGH-VALUE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.229 HIGH-VALUES ......................  File: ocfaq.info, Node: HIGHLIGHT, Next: I-O, Prev: HIGH-VALUES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.230 HIGHLIGHT ....................  File: ocfaq.info, Node: I-O, Next: I-O-CONTROL, Prev: HIGHLIGHT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.231 I-O ..............  File: ocfaq.info, Node: I-O-CONTROL, Next: IDx, Prev: I-O, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.232 I-O-CONTROL ......................  File: ocfaq.info, Node: IDx, Next: IDENTIFICATION, Prev: I-O-CONTROL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.233 IDx ..............  File: ocfaq.info, Node: IDENTIFICATION, Next: IFx, Prev: IDx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.234 IDENTIFICATION .........................  File: ocfaq.info, Node: IFx, Next: IGNORING, Prev: IDENTIFICATION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.235 IFx ..............  File: ocfaq.info, Node: IGNORING, Next: IMPLEMENTS, Prev: IFx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.236 IGNORING ...................  File: ocfaq.info, Node: IMPLEMENTS, Next: INx, Prev: IGNORING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.237 IMPLEMENTS .....................  File: ocfaq.info, Node: INx, Next: INDEX, Prev: IMPLEMENTS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.238 INx ..............  File: ocfaq.info, Node: INDEX, Next: INDEXED, Prev: INx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.239 INDEX ................  File: ocfaq.info, Node: INDEXED, Next: INDICATE, Prev: INDEX, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.240 INDEXED ..................  File: ocfaq.info, Node: INDICATE, Next: INHERITS, Prev: INDEXED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.241 INDICATE ...................  File: ocfaq.info, Node: INHERITS, Next: INITIAL, Prev: INDICATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.242 INHERITS ...................  File: ocfaq.info, Node: INITIAL, Next: INITIALIZE, Prev: INHERITS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.243 INITIAL ..................  File: ocfaq.info, Node: INITIALIZE, Next: INITIALIZED, Prev: INITIAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.244 INITIALIZE ..................... A sample of the INITIALIZE verb posted `opencobol.org`_ by `human`_ _---------------------------------------------------------------- IDENTIFICATION DIVISION. PROGRAM-ID. 'INITTEST'. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. INPUT-OUTPUT SECTION. DATA DIVISION._ WORKING-STORAGE SECTION. * 77 mychar pic x. 77 mynumeric pic 9. 01 REC-TEST BASED. 03 REC-TEST-PART1 PIC X(10) value all '9'. 03 REC-TEST-PART2 PIC X(10) value all 'A'. 01 fillertest. 03 fillertest-1 PIC 9(10) value 2222222222. 03 filler PIC X value '|'. 03 fillertest-2 PIC X(10) value all 'A'. 03 filler PIC 9(03) value 111. 03 filler PIC X value '.'. _---------------------------------------------------------------- LINKAGE SECTION._---------------------------------------------------------------- PROCEDURE DIVISION. _---------------------------------------------------------------- Main section. 00._ display 'fillertest ' 'on start:' end-display display fillertest end-display accept mychar * initialize fillertest display 'fillertest ' 'after initialize:' end-display display fillertest end-display accept mychar * initialize fillertest replacing numeric by 9 display 'fillertest ' 'after initialize replacing numeric by 9:' end-display display fillertest end-display accept mychar * initialize fillertest replacing alphanumeric by 'X' display 'fillertest ' 'after initialize replacing alphanumeric by "X":' end-display display fillertest end-display accept mychar * initialize fillertest replacing alphanumeric by all 'X' display 'fillertest ' 'after initialize replacing alphanumeric by all "X":' end-display display fillertest end-display accept mychar * initialize fillertest with filler display 'fillertest ' 'after initialize with filler:' end-display display fillertest end-display accept mychar * initialize fillertest all to value display 'fillertest ' 'after initialize all to value:' end-display display fillertest end-display accept mychar * ALLOCATE REC-TEST display 'REC-TEST after allocating:' end-display display REC-TEST end-display accept mychar * initialize REC-TEST all to value display 'REC-TEST after initalize all to value:' end-display display REC-TEST end-display accept mychar * stop run * continue. ex. exit program. _----------------------------------------------------------------_-- End of program INITTEST ------------------------------------ Outputs: fillertest on start: 2222222222|AAAAAAAAAA111. fillertest after initialize: 0000000000| 111. fillertest after initialize replacing numeric by 9: 0000000009| 111. fillertest after initialize replacing alphanumeric by "X": 0000000009|X 111. fillertest after initialize replacing alphanumeric by all "X": 0000000009|XXXXXXXXXX111. fillertest after initialize with filler: 0000000000 000 fillertest after initialize all to value: 2222222222|AAAAAAAAAA111. REC-TEST after allocating: REC-TEST after initalize all to value: 9999999999AAAAAAAAAA  File: ocfaq.info, Node: INITIALIZED, Next: INITIATE, Prev: INITIALIZE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.245 INITIALIZED ......................  File: ocfaq.info, Node: INITIATE, Next: INPUT, Prev: INITIALIZED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.246 INITIATE ...................  File: ocfaq.info, Node: INPUT, Next: INPUT-OUTPUT, Prev: INITIATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.247 INPUT ................  File: ocfaq.info, Node: INPUT-OUTPUT, Next: INSPECT, Prev: INPUT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.248 INPUT-OUTPUT .......................  File: ocfaq.info, Node: INSPECT, Next: INTERFACE, Prev: INPUT-OUTPUT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.249 INSPECT ..................  File: ocfaq.info, Node: INTERFACE, Next: INTERFACE-ID, Prev: INSPECT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.250 INTERFACE ....................  File: ocfaq.info, Node: INTERFACE-ID, Next: INTO, Prev: INTERFACE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.251 INTERFACE-ID .......................  File: ocfaq.info, Node: INTO, Next: INTRINSIC, Prev: INTERFACE-ID, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.252 INTO ...............  File: ocfaq.info, Node: INTRINSIC, Next: INVALID, Prev: INTO, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.253 INTRINSIC ....................  File: ocfaq.info, Node: INVALID, Next: INVOKE, Prev: INTRINSIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.254 INVALID ..................  File: ocfaq.info, Node: INVOKE, Next: ISx, Prev: INVALID, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.255 INVOKE .................  File: ocfaq.info, Node: ISx, Next: JUST, Prev: INVOKE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.256 ISx ..............  File: ocfaq.info, Node: JUST, Next: JUSTIFIED, Prev: ISx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.257 JUST ...............  File: ocfaq.info, Node: JUSTIFIED, Next: KEY, Prev: JUST, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.258 JUSTIFIED ....................  File: ocfaq.info, Node: KEY, Next: KEYBOARD, Prev: JUSTIFIED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.259 KEY ..............  File: ocfaq.info, Node: KEYBOARD, Next: LABEL, Prev: KEY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.260 KEYBOARD ................... A special value for Standard Input file-control. select cgi-in assign to keyboard.  File: ocfaq.info, Node: LABEL, Next: LAST, Prev: KEYBOARD, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.261 LABEL ................  File: ocfaq.info, Node: LAST, Next: LC_ALL, Prev: LABEL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.262 LAST ...............  File: ocfaq.info, Node: LC_ALL, Next: LC_COLLATE, Prev: LAST, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.263 LC_ALL .................  File: ocfaq.info, Node: LC_COLLATE, Next: LC_CTYPE, Prev: LC_ALL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.264 LC_COLLATE .....................  File: ocfaq.info, Node: LC_CTYPE, Next: LC_MESSAGES, Prev: LC_COLLATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.265 LC_CTYPE ...................  File: ocfaq.info, Node: LC_MESSAGES, Next: LC_MONETARY, Prev: LC_CTYPE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.266 LC_MESSAGES ......................  File: ocfaq.info, Node: LC_MONETARY, Next: LC_NUMERIC, Prev: LC_MESSAGES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.267 LC_MONETARY ......................  File: ocfaq.info, Node: LC_NUMERIC, Next: LC_TIME, Prev: LC_MONETARY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.268 LC_NUMERIC .....................  File: ocfaq.info, Node: LC_TIME, Next: LEADING, Prev: LC_NUMERIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.269 LC_TIME ..................  File: ocfaq.info, Node: LEADING, Next: LEFT, Prev: LC_TIME, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.270 LEADING ..................  File: ocfaq.info, Node: LEFT, Next: LENGTH, Prev: LEADING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.271 LEFT ...............  File: ocfaq.info, Node: LENGTH, Next: LESS, Prev: LEFT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.272 LENGTH .................  File: ocfaq.info, Node: LESS, Next: LIMIT, Prev: LENGTH, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.273 LESS ...............  File: ocfaq.info, Node: LIMIT, Next: LIMITS, Prev: LESS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.274 LIMIT ................  File: ocfaq.info, Node: LIMITS, Next: LINAGE, Prev: LIMIT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.275 LIMITS .................  File: ocfaq.info, Node: LINAGE, Next: LINAGE-COUNTER, Prev: LIMITS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.276 LINAGE ................. LINAGE is a _SPECIAL-REGISTER_ supported by OpenCOBOL. A counter is maintained for file WRITE_ and can be used for pageing _and other_ control. COBOL ********************************* * Example of LINAGE File Descriptor * Author: Brian Tiffin * Date: 10-July-2008 * Tectonics: $ cocb -x linage.cob * $ ./linage * $ cat -n mini-report********************************* IDENTIFICATION DIVISION. PROGRAM-ID. linage-demo. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. select optional data-file assign to file-name organization is line sequential file status is data-file-status. select mini-report assign to "mini-report". DATA DIVISION. FILE SECTION. FD data-file. 01 data-record. 88 endofdata value high-values. 02 data-line pic x(80). FD mini-report linage is 16 lines with footing at 15 lines at top 2 lines at bottom 2. 01 report-line pic x(80). WORKING-STORAGE SECTION. 01 command-arguments pic x(1024). 01 file-name pic x(160). 01 data-file-status pic 99. 01 lc pic 99. 01 report-line-blank. 02 filler pic x(18) value all "_". 02 filler pic x(05) value spaces. 02 filler pic x(34) VALUE "THIS PAGE INTENTIONALLY LEFT BLANK". 02 filler pic x(05) value spaces. 02 filler pic x(18) value all "_". 01 report-line-data. 02 body-tag pic 9(6). 02 line-3 pic x(74). 01 report-line-header. 02 filler pic x(6) VALUE "PAGE: ". 02 page-no pic 9999. 02 filler pic x(24). 02 filler pic x(5) VALUE " LC: ". 02 header-tag pic 9(6). 02 filler pic x(23). 02 filler pic x(6) VALUE "DATE: ". 02 page-date pic x(6). 01 page-count pic 9999. PROCEDURE DIVISION. accept command-arguments from command-line end-accept. string command-arguments delimited by space into file-name end-string. if file-name equal spaces move "linage.cob" to file-name end-if. open input data-file. read data-file at end display "File: " function trim(file-name) " open error" end-display perform early-exit end-read. open output mini-report. write report-line from report-line-blank end-write. move 1 to page-count. accept page-date from date end-accept. move page-count to page-no. write report-line from report-line-header after advancing page end-write. perform readwrite-loop until endofdata. display "Normal termination, file name: " function trim(file-name) " ending status: " data-file-status end-display. close mini-report. * Goto considered harmful? Bah! :) early-exit. close data-file. exit program. stop run. ****************_*_*************** readwrite-loop. move data-record to report-line-data move linage-counter to body-tag write report-line from report-line-data end-of-page add 1 to page-count end-add move page-count to page-no move linage-counter to header-tag write report-line from report-line-header after advancing page end-write end-write read data-file at end set endofdata to true end-read . ********************************* * Commentary * LINAGE is set at a 20 line logical page * 16 body lines * 2 top lines * A footer line at 15 (inside the body count) * 2 bottom lines * Build with: * $ cobc -x -Wall -Wtruncate linage.cob * Evaluate with: * $ ./linage * This will read in linage.cob and produce a useless mini-report * $ cat -n mini-report********************************* END PROGRAM linage-demo. Using $ ./linage except.cob Produces a _mini-report_ of: ****************** THIS PAGE INTENTIONALLY LEFT BLANK ****************** PAGE: 0001 LC: 000000 DATE: 090206 000001 IDENTIFICATION DIVISION. 000002 PROGRAM-ID. MINIPROG. 000003 ENVIRONMENT DIVISION. 000004 CONFIGURATION SECTION. 000005 SOURCE-COMPUTER. LINUX. 000006 OBJECT-COMPUTER. LINUX. 000007 SPECIAL-NAMES. 000008 INPUT-OUTPUT SECTION. 000009 FILE-CONTROL. 000010 SELECT PRINTFILE ASSIGN TO "XXRXWXX" 000011 FILE STATUS RXWSTAT. 000012 DATA DIVISION. 000013 FILE SECTION. 000014 FD PRINTFILE. PAGE: 0002 LC: 000015 DATE: 090206 000001 01 PRINTREC PIC X(132). 000002 WORKING-STORAGE SECTION. 000003 01 RXWSTAT PIC XX. 000004 01 str pic x(4). 000005 PROCEDURE DIVISION. 000006 A00-MAIN SECTION. 000007 001-MAIN-PROCEDURE. 000008 OPEN INPUT PRINTFILE. 000009 DISPLAY "File Status: " RXWSTAT. 000010 DISPLAY "EXCEPTION-FILE: " FUNCTION EXCEPTION-FILE. 000011 DISPLAY "Return Length: " 000012 FUNCTION LENGTH (FUNCTION EXCEPTION-FILE). 000013 DISPLAY "EXCEPTION-STATUS: " FUNCTION EXCEPTION-STATUS. 000014 DISPLAY "EXCEPTION-STATEMENT: " FUNCTION EXCEPTION-STATEMENT. PAGE: 0003 LC: 000015 DATE: 090206 000001 STRING "TOOLONG" DELIMITED SIZE INTO RXWSTAT. 000002 DISPLAY "EXCEPTION-STATUS: " FUNCTION EXCEPTION-STATUS. 000003 DISPLAY "EXCEPTION-STATEMENT: " FUNCTION EXCEPTION-STATEMENT. 000004 DISPLAY "EXCEPTION-LOCATION: " FUNCTION EXCEPTION-LOCATION. 000005 STOP RUN. See _except.cob_ under the EXCEPTION-STATUS_ entry.  File: ocfaq.info, Node: LINAGE-COUNTER, Next: LINE, Prev: LINAGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.277 LINAGE-COUNTER ......................... An internal OpenCOBOL noun, or _Special Register_. Value is readonly and is maintained during WRITEs to files that have a LINAGE_ clause. Useful for quick reports and logical page layouts.  File: ocfaq.info, Node: LINE, Next: LINE-COUNTER, Prev: LINAGE-COUNTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.278 LINE ...............  File: ocfaq.info, Node: LINE-COUNTER, Next: LINES, Prev: LINE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.279 LINE-COUNTER .......................  File: ocfaq.info, Node: LINES, Next: LINKAGE, Prev: LINE-COUNTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.280 LINES ................  File: ocfaq.info, Node: LINKAGE, Next: LOCAL-STORAGE, Prev: LINES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.281 LINKAGE ..................  File: ocfaq.info, Node: LOCAL-STORAGE, Next: LOCALE, Prev: LINKAGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.282 LOCAL-STORAGE ........................  File: ocfaq.info, Node: LOCALE, Next: LOCK, Prev: LOCAL-STORAGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.283 LOCALE .................  File: ocfaq.info, Node: LOCK, Next: LOW-VALUE, Prev: LOCALE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.284 LOCK ...............  File: ocfaq.info, Node: LOW-VALUE, Next: LOW-VALUES, Prev: LOCK, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.285 LOW-VALUE .................... A figurative constant for the lowest value of a COBOL field. MOVE LOW-VALUE TO numeric-1. IF alphanumeric-1 EQUALS LOW-VALUE DISPLAY "Failed validation" END-DISPLAY END-IF.  File: ocfaq.info, Node: LOW-VALUES, Next: LOWLIGHT, Prev: LOW-VALUE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.286 LOW-VALUES ..................... A pluralized form of LOW-VALUE_. Equivalent. MOVE LOW-VALUES TO alphanumeric-1.  File: ocfaq.info, Node: LOWLIGHT, Next: MANUAL, Prev: LOW-VALUES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.287 LOWLIGHT ................... A screen attribute for DISPLAY and SCREEN SECTION fields. SCREEN SECTION. 01 example. 05 FILLER LINE 1 COLUMN 10 VALUE IS "Example:" LOWLIGHT. Will display the _Example:_ legend in a dimmed video if supported with the current terminal settings.  File: ocfaq.info, Node: MANUAL, Next: MEMORY, Prev: LOWLIGHT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.288 MANUAL .................  File: ocfaq.info, Node: MEMORY, Next: MERGE, Prev: MANUAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.289 MEMORY .................  File: ocfaq.info, Node: MERGE, Next: MESSAGE, Prev: MEMORY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.290 MERGE ................  File: ocfaq.info, Node: MESSAGE, Next: METHOD, Prev: MERGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.291 MESSAGE ..................  File: ocfaq.info, Node: METHOD, Next: METHOD-ID, Prev: MESSAGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.292 METHOD .................  File: ocfaq.info, Node: METHOD-ID, Next: MINUS, Prev: METHOD, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.293 METHOD-ID ....................  File: ocfaq.info, Node: MINUS, Next: MODE, Prev: METHOD-ID, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.294 MINUS ................  File: ocfaq.info, Node: MODE, Next: MOVE, Prev: MINUS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.295 MODE ...............  File: ocfaq.info, Node: MOVE, Next: MULTIPLE, Prev: MODE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.296 MOVE ............... A workhorse of the COBOL paradigm. MOVE is highly flexible, intelligent, safe and sometimes perplexing data movement verb. 01 alphanum-3 PIC XXX. 01 num2 PIX 99. MOVE "ABCDEFG" TO xvar3 DISPLAY xvar3 END-DISPLAY MOVE 12345 TO num2 DISPLAY num2 END-DISPLAY displays: ABC 45 Note the 45, MOVE uses a right to left rule when moving numerics. Groups can be moved with MOVE CORRESPONDING ident-1 TO ident-2 in which case only the group items of the same name will be transferred from the ident-1 group to the ident-2 fields.  File: ocfaq.info, Node: MULTIPLE, Next: MULTIPLY, Prev: MOVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.297 MULTIPLE ...................  File: ocfaq.info, Node: MULTIPLY, Next: NATIONAL, Prev: MULTIPLE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.298 MULTIPLY ...................  File: ocfaq.info, Node: NATIONAL, Next: NATIONAL-EDITED, Prev: MULTIPLY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.299 NATIONAL ...................  File: ocfaq.info, Node: NATIONAL-EDITED, Next: NATIVE, Prev: NATIONAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.300 NATIONAL-EDITED ..........................  File: ocfaq.info, Node: NATIVE, Next: NEGATIVE, Prev: NATIONAL-EDITED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.301 NATIVE .................  File: ocfaq.info, Node: NEGATIVE, Next: NESTED, Prev: NATIVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.302 NEGATIVE ...................  File: ocfaq.info, Node: NESTED, Next: NEXT, Prev: NEGATIVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.303 NESTED .................  File: ocfaq.info, Node: NEXT, Next: NOx, Prev: NESTED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.304 NEXT ...............  File: ocfaq.info, Node: NOx, Next: NONE, Prev: NEXT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.305 NOx ..............  File: ocfaq.info, Node: NONE, Next: NORMAL, Prev: NOx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.306 NONE ...............  File: ocfaq.info, Node: NORMAL, Next: NOT, Prev: NONE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.307 NORMAL .................  File: ocfaq.info, Node: NOT, Next: NULL, Prev: NORMAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.308 NOT ..............  File: ocfaq.info, Node: NULL, Next: NULLS, Prev: NOT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.309 NULL ...............  File: ocfaq.info, Node: NULLS, Next: NUMBER, Prev: NULL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.310 NULLS ................  File: ocfaq.info, Node: NUMBER, Next: NUMBERS, Prev: NULLS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.311 NUMBER .................  File: ocfaq.info, Node: NUMBERS, Next: NUMERIC, Prev: NUMBER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.312 NUMBERS ..................  File: ocfaq.info, Node: NUMERIC, Next: NUMERIC-EDITED, Prev: NUMBERS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.313 NUMERIC ..................  File: ocfaq.info, Node: NUMERIC-EDITED, Next: OBJECT, Prev: NUMERIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.314 NUMERIC-EDITED .........................  File: ocfaq.info, Node: OBJECT, Next: OBJECT-COMPUTER, Prev: NUMERIC-EDITED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.315 OBJECT .................  File: ocfaq.info, Node: OBJECT-COMPUTER, Next: OBJECT-REFERENCE, Prev: OBJECT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.316 OBJECT-COMPUTER ..........................  File: ocfaq.info, Node: OBJECT-REFERENCE, Next: OCCURS, Prev: OBJECT-COMPUTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.317 OBJECT-REFERENCE ...........................  File: ocfaq.info, Node: OCCURS, Next: OFx, Prev: OBJECT-REFERENCE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.318 OCCURS .................  File: ocfaq.info, Node: OFx, Next: OFF, Prev: OCCURS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.319 OFx ..............  File: ocfaq.info, Node: OFF, Next: OMITTED, Prev: OFx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.320 OFF ..............  File: ocfaq.info, Node: OMITTED, Next: ONx, Prev: OFF, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.321 OMITTED ..................  File: ocfaq.info, Node: ONx, Next: ONLY, Prev: OMITTED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.322 ONx ..............  File: ocfaq.info, Node: ONLY, Next: OPEN, Prev: ONx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.323 ONLY ...............  File: ocfaq.info, Node: OPEN, Next: OPTIONAL, Prev: ONLY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.324 OPEN ...............  File: ocfaq.info, Node: OPTIONAL, Next: OPTIONS, Prev: OPEN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.325 OPTIONAL ...................  File: ocfaq.info, Node: OPTIONS, Next: ORx, Prev: OPTIONAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.326 OPTIONS ..................  File: ocfaq.info, Node: ORx, Next: ORDER, Prev: OPTIONS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.327 ORx ..............  File: ocfaq.info, Node: ORDER, Next: ORGANIZATION, Prev: ORx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.328 ORDER ................  File: ocfaq.info, Node: ORGANIZATION, Next: OTHER, Prev: ORDER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.329 ORGANIZATION .......................  File: ocfaq.info, Node: OTHER, Next: OUTPUT, Prev: ORGANIZATION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.330 OTHER ................  File: ocfaq.info, Node: OUTPUT, Next: OVERFLOW, Prev: OTHER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.331 OUTPUT .................  File: ocfaq.info, Node: OVERFLOW, Next: OVERLINE, Prev: OUTPUT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.332 OVERFLOW ...................  File: ocfaq.info, Node: OVERLINE, Next: OVERRIDE, Prev: OVERFLOW, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.333 OVERLINE ...................  File: ocfaq.info, Node: OVERRIDE, Next: PACKED-DECIMAL, Prev: OVERLINE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.334 OVERRIDE ...................  File: ocfaq.info, Node: PACKED-DECIMAL, Next: PADDING, Prev: OVERRIDE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.335 PACKED-DECIMAL .........................  File: ocfaq.info, Node: PADDING, Next: PAGE, Prev: PACKED-DECIMAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.336 PADDING ..................  File: ocfaq.info, Node: PAGE, Next: PAGE-COUNTER, Prev: PADDING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.337 PAGE ...............  File: ocfaq.info, Node: PAGE-COUNTER, Next: PARAGRAPH, Prev: PAGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.338 PAGE-COUNTER .......................  File: ocfaq.info, Node: PARAGRAPH, Next: PERFORM, Prev: PAGE-COUNTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.339 PARAGRAPH ....................  File: ocfaq.info, Node: PERFORM, Next: PFx, Prev: PARAGRAPH, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.340 PERFORM ..................  File: ocfaq.info, Node: PFx, Next: PHx, Prev: PERFORM, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.341 PFx ..............  File: ocfaq.info, Node: PHx, Next: PIC, Prev: PFx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.342 PHx ..............  File: ocfaq.info, Node: PIC, Next: PICTURE, Prev: PHx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.343 PIC ..............  File: ocfaq.info, Node: PICTURE, Next: PLUS, Prev: PIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.344 PICTURE .................. Full standards support of all alpha, alphanumeric and numeric storage specifiers as well as full support for edit and numeric-edit clauses. An example of some of the PICTURE options _>>source format is free_>*********************************** _> Author: jrls (John Ellis)_> Date: Oct-2008 _> Purpose: formated output examples using pic strings._>*********************************** identification division. program-id. picstring. data division. working-storage section. *> 01 header. 05 filler pic xxx value "ln". 05 filler pic x(11) value " disp1". 05 filler pic x(11) value " disp2". 05 filler pic x(11) value " disp3". 05 filler pic x(11) value " disp4". 05 filler pic x(12) value " disp5". 05 filler pic x(9) value " an1". 05 filler pic x(14) value " phone". 05 filler pic x(10) value " date". _> 01 headerLines pic x(90) value all "-"._> 01 displayformats. 05 linenum pic 99 value 1. 05 disp1 pic zzz,zz9.99 value zero. 05 filler pic x value spaces. 05 disp2 pic $zz,zz9.99 value zero. 05 filler pic x value spaces. 05 disp3 pic --,-9.99 value zero. 05 filler pic x value spaces. 05 disp4 pic $-z,zz9.99 value zero. 05 filler pic x value spaces. 05 disp5 pic -zz,zz9.zz- blank zero value zero. 05 filler pic x value spaces. _><_an1 is actually a string field because of the embedded blanks, thus you put value spaces. 05 an1 pic 99b99b99 value spaces. 05 filler pic x value spaces. 05 phone pic bxxxbxxxbxxxx value spaces. 05 filler pic x value spaces. 05 dispdate pic 99/99/9999 value zero. *> procedure division. 0000-start. _> display headerLines. display header. display headerLines._><**********************_*_**_*_ move 220.22 to disp1, disp2. move -220.22 to disp3, disp4, disp5. inspect disp5 replacing first "-" by "(", first "-" by ")". move 10122008 to dispdate. _><_************************** _><_Please note the results of moving 'abcd' to an1. _><_an1 will show up as 00 00 00 because alpha data was _><_moved into instead of numeric data. _><_ _><_The phone field will display " abc def ghij" because _><_'b' in the pic string. _><_************************** move "abcd" to an1. move "abcdefghij" to phone. display displayformats. add 1 to linenum. move zero to disp4, disp5. _><_************************** _><_Here after moving data to an1 and phone, I use the _><_inspect statement to replace the blanks. _><_************************** move "123456" to an1. move "5555551234" to phone. inspect an1 replacing all " " by "-". inspect phone replacing first " " by "(", first " " by ")", first " " by "-". display displayformats. inspect phone converting "23456789" to "adgjmptw". display phone. perform 0010-endProgram. _> 0010-endProgram. stop run._> Outputs: ------------------------------------------------------------------------------------------ ln disp1 disp2 disp3 disp4 disp5 an1 phone date ------------------------------------------------------------------------------------------ 01 220.22 $220.22 -220.22 $-220.22 (220.22) 00 00 00 abc def ghij 10/12/2008 02 220.22 $220.22 -220.22 $ 0.00 12-34-56 (555)555-1234 10/12/2008 (jjj)jjj-1adg  File: ocfaq.info, Node: PLUS, Next: POINTER, Prev: PICTURE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.345 PLUS ...............  File: ocfaq.info, Node: POINTER, Next: POSITION, Prev: PLUS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.346 POINTER .................. 01 C-HANDLE USAGE IS POINTER. CALL "open-lib" USING C-HANDLE  File: ocfaq.info, Node: POSITION, Next: POSITIVE, Prev: POINTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.347 POSITION ...................  File: ocfaq.info, Node: POSITIVE, Next: PRESENT, Prev: POSITION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.348 POSITIVE ...................  File: ocfaq.info, Node: PRESENT, Next: PREVIOUS, Prev: POSITIVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.349 PRESENT ..................  File: ocfaq.info, Node: PREVIOUS, Next: PRINTER, Prev: PRESENT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.350 PREVIOUS ...................  File: ocfaq.info, Node: PRINTER, Next: PRINTING, Prev: PREVIOUS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.351 PRINTER ..................  File: ocfaq.info, Node: PRINTING, Next: PROCEDURE, Prev: PRINTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.352 PRINTING ...................  File: ocfaq.info, Node: PROCEDURE, Next: PROCEDURE-POINTER, Prev: PRINTING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.353 PROCEDURE ....................  File: ocfaq.info, Node: PROCEDURE-POINTER, Next: PROCEDURES, Prev: PROCEDURE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.354 PROCEDURE-POINTER ............................  File: ocfaq.info, Node: PROCEDURES, Next: PROCEED, Prev: PROCEDURE-POINTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.355 PROCEDURES .....................  File: ocfaq.info, Node: PROCEED, Next: PROGRAM, Prev: PROCEDURES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.356 PROCEED ..................  File: ocfaq.info, Node: PROGRAM, Next: PROGRAM-ID, Prev: PROCEED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.357 PROGRAM ..................  File: ocfaq.info, Node: PROGRAM-ID, Next: PROGRAM-POINTER, Prev: PROGRAM, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.358 PROGRAM-ID .....................  File: ocfaq.info, Node: PROGRAM-POINTER, Next: PROMPT, Prev: PROGRAM-ID, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.359 PROGRAM-POINTER ..........................  File: ocfaq.info, Node: PROMPT, Next: PROPERTY, Prev: PROGRAM-POINTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.360 PROMPT .................  File: ocfaq.info, Node: PROPERTY, Next: PROTOTYPE, Prev: PROMPT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.361 PROPERTY ...................  File: ocfaq.info, Node: PROTOTYPE, Next: PURGE, Prev: PROPERTY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.362 PROTOTYPE ....................  File: ocfaq.info, Node: PURGE, Next: QUEUE, Prev: PROTOTYPE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.363 PURGE ................  File: ocfaq.info, Node: QUEUE, Next: QUOTE, Prev: PURGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.364 QUEUE ................  File: ocfaq.info, Node: QUOTE, Next: QUOTES, Prev: QUEUE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.365 QUOTE ................  File: ocfaq.info, Node: QUOTES, Next: RAISE, Prev: QUOTE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.366 QUOTES .................  File: ocfaq.info, Node: RAISE, Next: RAISING, Prev: QUOTES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.367 RAISE ................  File: ocfaq.info, Node: RAISING, Next: RANDOM, Prev: RAISE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.368 RAISING ..................  File: ocfaq.info, Node: RANDOM, Next: RDx, Prev: RAISING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.369 RANDOM .................  File: ocfaq.info, Node: RDx, Next: READ, Prev: RANDOM, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.370 RDx ..............  File: ocfaq.info, Node: READ, Next: RECEIVE, Prev: RDx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.371 READ ...............  File: ocfaq.info, Node: RECEIVE, Next: RECORD, Prev: READ, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.372 RECEIVE ..................  File: ocfaq.info, Node: RECORD, Next: RECORDING, Prev: RECEIVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.373 RECORD .................  File: ocfaq.info, Node: RECORDING, Next: RECORDS, Prev: RECORD, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.374 RECORDING ....................  File: ocfaq.info, Node: RECORDS, Next: RECURSIVE, Prev: RECORDING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.375 RECORDS ..................  File: ocfaq.info, Node: RECURSIVE, Next: REDEFINES, Prev: RECORDS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.376 RECURSIVE ....................  File: ocfaq.info, Node: REDEFINES, Next: REEL, Prev: RECURSIVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.377 REDEFINES ....................  File: ocfaq.info, Node: REEL, Next: REFERENCE, Prev: REDEFINES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.378 REEL ...............  File: ocfaq.info, Node: REFERENCE, Next: RELATION, Prev: REEL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.379 REFERENCE ....................  File: ocfaq.info, Node: RELATION, Next: RELATIVE, Prev: REFERENCE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.380 RELATION ...................  File: ocfaq.info, Node: RELATIVE, Next: RELEASE, Prev: RELATION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.381 RELATIVE ...................  File: ocfaq.info, Node: RELEASE, Next: REMAINDER, Prev: RELATIVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.382 RELEASE ..................  File: ocfaq.info, Node: REMAINDER, Next: REMOVAL, Prev: RELEASE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.383 REMAINDER ....................  File: ocfaq.info, Node: REMOVAL, Next: RENAMES, Prev: REMAINDER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.384 REMOVAL ..................  File: ocfaq.info, Node: RENAMES, Next: REPLACE, Prev: REMOVAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.385 RENAMES ..................  File: ocfaq.info, Node: REPLACE, Next: REPLACING, Prev: RENAMES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.386 REPLACE ..................  File: ocfaq.info, Node: REPLACING, Next: REPORT, Prev: REPLACE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.387 REPLACING ....................  File: ocfaq.info, Node: REPORT, Next: REPORTING, Prev: REPLACING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.388 REPORT .................  File: ocfaq.info, Node: REPORTING, Next: REPORTS, Prev: REPORT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.389 REPORTING ....................  File: ocfaq.info, Node: REPORTS, Next: REPOSITORY, Prev: REPORTING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.390 REPORTS ..................  File: ocfaq.info, Node: REPOSITORY, Next: REQUIRED, Prev: REPORTS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.391 REPOSITORY .....................  File: ocfaq.info, Node: REQUIRED, Next: RESERVE, Prev: REPOSITORY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.392 REQUIRED ...................  File: ocfaq.info, Node: RESERVE, Next: RESET, Prev: REQUIRED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.393 RESERVE ..................  File: ocfaq.info, Node: RESET, Next: RESUME, Prev: RESERVE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.394 RESET ................  File: ocfaq.info, Node: RESUME, Next: RETRY, Prev: RESET, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.395 RESUME .................  File: ocfaq.info, Node: RETRY, Next: RETURN, Prev: RESUME, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.396 RETRY ................  File: ocfaq.info, Node: RETURN, Next: RETURNING, Prev: RETRY, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.397 RETURN .................  File: ocfaq.info, Node: RETURNING, Next: REVERSE-VIDEO, Prev: RETURN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.398 RETURNING ....................  File: ocfaq.info, Node: REVERSE-VIDEO, Next: REWIND, Prev: RETURNING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.399 REVERSE-VIDEO ........................  File: ocfaq.info, Node: REWIND, Next: REWRITE, Prev: REVERSE-VIDEO, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.400 REWIND .................  File: ocfaq.info, Node: REWRITE, Next: RFx, Prev: REWIND, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.401 REWRITE ..................  File: ocfaq.info, Node: RFx, Next: RHx, Prev: REWRITE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.402 RFx ..............  File: ocfaq.info, Node: RHx, Next: RIGHT, Prev: RFx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.403 RHx ..............  File: ocfaq.info, Node: RIGHT, Next: ROLLBACK, Prev: RHx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.404 RIGHT ................  File: ocfaq.info, Node: ROLLBACK, Next: ROUNDED, Prev: RIGHT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.405 ROLLBACK ...................  File: ocfaq.info, Node: ROUNDED, Next: RUN, Prev: ROLLBACK, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.406 ROUNDED ..................  File: ocfaq.info, Node: RUN, Next: SAME, Prev: ROUNDED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.407 RUN ..............  File: ocfaq.info, Node: SAME, Next: SCREEN, Prev: RUN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.408 SAME ...............  File: ocfaq.info, Node: SCREEN, Next: SDx, Prev: SAME, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.409 SCREEN .................  File: ocfaq.info, Node: SDx, Next: SEARCH, Prev: SCREEN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.410 SDx ..............  File: ocfaq.info, Node: SEARCH, Next: SECONDS, Prev: SDx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.411 SEARCH .................  File: ocfaq.info, Node: SECONDS, Next: SECTION, Prev: SEARCH, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.412 SECONDS ..................  File: ocfaq.info, Node: SECTION, Next: SECURE, Prev: SECONDS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.413 SECTION ..................  File: ocfaq.info, Node: SECURE, Next: SEGMENT, Prev: SECTION, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.414 SECURE .................  File: ocfaq.info, Node: SEGMENT, Next: SELECT, Prev: SECURE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.415 SEGMENT ..................  File: ocfaq.info, Node: SELECT, Next: SELF, Prev: SEGMENT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.416 SELECT .................  File: ocfaq.info, Node: SELF, Next: SEND, Prev: SELECT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.417 SELF ...............  File: ocfaq.info, Node: SEND, Next: SENTENCE, Prev: SELF, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.418 SEND ...............  File: ocfaq.info, Node: SENTENCE, Next: SEPARATE, Prev: SEND, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.419 SENTENCE ...................  File: ocfaq.info, Node: SEPARATE, Next: SEQUENCE, Prev: SENTENCE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.420 SEPARATE ...................  File: ocfaq.info, Node: SEQUENCE, Next: SEQUENTIAL, Prev: SEPARATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.421 SEQUENCE ...................  File: ocfaq.info, Node: SEQUENTIAL, Next: SET, Prev: SEQUENCE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.422 SEQUENTIAL .....................  File: ocfaq.info, Node: SET, Next: SHARING, Prev: SEQUENTIAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.423 SET ..............  File: ocfaq.info, Node: SHARING, Next: SIGN, Prev: SET, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.424 SHARING ..................  File: ocfaq.info, Node: SIGN, Next: SIGNED, Prev: SHARING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.425 SIGN ...............  File: ocfaq.info, Node: SIGNED, Next: SIGNED-INT, Prev: SIGN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.426 SIGNED .................  File: ocfaq.info, Node: SIGNED-INT, Next: SIGNED-LONG, Prev: SIGNED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.427 SIGNED-INT .....................  File: ocfaq.info, Node: SIGNED-LONG, Next: SIGNED-SHORT, Prev: SIGNED-INT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.428 SIGNED-LONG ......................  File: ocfaq.info, Node: SIGNED-SHORT, Next: SIZE, Prev: SIGNED-LONG, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.429 SIGNED-SHORT .......................  File: ocfaq.info, Node: SIZE, Next: SORT, Prev: SIGNED-SHORT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.430 SIZE ...............  File: ocfaq.info, Node: SORT, Next: SORT-MERGE, Prev: SIZE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.431 SORT ............... * OpenCOBOL SORT verb example using standard in and standard out identification division. program-id. sorting. environment division. input-output section. file-control. select sort-in assign keyboard organization line sequential. select sort-out assign display organization line sequential. select sort-work assign "sortwork". data division. file section. fd sort-in. 01 in-rec pic x(255). fd sort-out. 01 out-rec pic x(255). sd sort-work. 01 work-rec pic x(255). procedure division. sort sort-work ascending key work-rec using sort-in giving sort-out. goback. exit program. end program sorting. Here is a snippet describing TABLE sorts by [jrls_swla]_ table define 01 nbr-of-columns pic 9(4) value zero. 01 tcindex2 usage is index. 01 dbtables. 03 tables-columns occurs 1 to 1000 times depending on nbr-of-columns ascending key tcTable, tcColumn indexed by tcindex. 05 tcTable pic x(64) value spaces. 05 tcColumn pic x(64) value spaces. 05 tcAlias pic x(10) value spaces. 05 tcOrder pic 9(4) value zero. 05 tcType pic x(10) value spaces. 05 tcMaxLen pic 9(4) value zero. *> 01 aliasName. 05 pic x value "t". 05 anVal pic 9(3) value zero. 01 showdata. 05 sdTable pic x(17) value spaces. 05 sdColumn pic x(17) value spaces. 05 sdType pic x(10) value spaces. 05 sdOrder pic zzzzz-. 05 sdMaxLen pic zzzzz. table load perform varying rows from 1 by 1 until rows > dbNumRows call "dbNextRow" using by value dbResult, by reference ColumnBuff, by reference CbuffDesc returning dbResult add 1 to nbr-of-columns set tcindex up by 1 move cbTable to tcTable(tcindex) move cbColumn to tcColumn(tcindex) move cbType to tcType(tcindex) move cbOrder to tcOrder(tcindex) move cbMaxLen to tcMaxLen(tcindex) if nbr-of-columns = 1 add 1 to anVal else set tcindex2 to tcindex set tcindex2 down by 1 if cbTable <> tcTable(tcindex2) add 1 to anVal end-if end-if move aliasName to tcAlias(tcindex) end-perform. table sort sort tables-columns ascending key tcTable, tcColumn. display table perform varying tcindex from 1 by 1 until tcindex > nbr-of-columns move tcTable(tcindex) to sdTable move tcColumn(tcindex) to sdColumn move tcOrder(tcindex) to sdOrder move tcType(tcindex) to sdType move tcMaxLen(tcindex) to sdMaxLen display showdata end-perform.  File: ocfaq.info, Node: SORT-MERGE, Next: SORT-RETURN, Prev: SORT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.432 SORT-MERGE ..................... Used in an I-O-CONTROL paragraph with the SAME clause: SAME SORT-MERGE AREA FOR filename-1. The SORT-MERGE keyword and SORT keyword are equivalent in this case.  File: ocfaq.info, Node: SORT-RETURN, Next: SOURCE, Prev: SORT-MERGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.433 SORT-RETURN ...................... A _SPECIAL-REGISTER_ used by the OpenCOBOL SORT routines. * +000000000 for success * +000000016 for failure A programmer may set SORT-RETURN in an INPUT PROCEDURE.  File: ocfaq.info, Node: SOURCE, Next: SOURCE-COMPUTER, Prev: SORT-RETURN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.434 SOURCE .................  File: ocfaq.info, Node: SOURCE-COMPUTER, Next: SOURCES, Prev: SOURCE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.435 SOURCE-COMPUTER ..........................  File: ocfaq.info, Node: SOURCES, Next: SPACE, Prev: SOURCE-COMPUTER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.436 SOURCES ..................  File: ocfaq.info, Node: SPACE, Next: SPACES, Prev: SOURCES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.437 SPACE ................  File: ocfaq.info, Node: SPACES, Next: SPECIAL-NAMES, Prev: SPACE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.438 SPACES .................  File: ocfaq.info, Node: SPECIAL-NAMES, Next: STANDARD, Prev: SPACES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.439 SPECIAL-NAMES ........................ OpenCOBOL supports a fair complete set of the SPECIAL-NAMES in common use.  File: ocfaq.info, Node: STANDARD, Next: STANDARD-1, Prev: SPECIAL-NAMES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.440 STANDARD ...................  File: ocfaq.info, Node: STANDARD-1, Next: STANDARD-2, Prev: STANDARD, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.441 STANDARD-1 .....................  File: ocfaq.info, Node: STANDARD-2, Next: START, Prev: STANDARD-1, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.442 STANDARD-2 .....................  File: ocfaq.info, Node: START, Next: STATEMENT, Prev: STANDARD-2, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.443 START ................  File: ocfaq.info, Node: STATEMENT, Next: STATUS, Prev: START, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.444 STATEMENT ....................  File: ocfaq.info, Node: STATUS, Next: STEP, Prev: STATEMENT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.445 STATUS .................  File: ocfaq.info, Node: STEP, Next: STOP, Prev: STATUS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.446 STEP ...............  File: ocfaq.info, Node: STOP, Next: STRING, Prev: STEP, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.447 STOP ...............  File: ocfaq.info, Node: STRING, Next: STRONG, Prev: STOP, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.448 STRING .................  File: ocfaq.info, Node: STRONG, Next: SUB-QUEUE-1, Prev: STRING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.449 STRONG .................  File: ocfaq.info, Node: SUB-QUEUE-1, Next: SUB-QUEUE-2, Prev: STRONG, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.450 SUB-QUEUE-1 ......................  File: ocfaq.info, Node: SUB-QUEUE-2, Next: SUB-QUEUE-3, Prev: SUB-QUEUE-1, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.451 SUB-QUEUE-2 ......................  File: ocfaq.info, Node: SUB-QUEUE-3, Next: SUBTRACT, Prev: SUB-QUEUE-2, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.452 SUB-QUEUE-3 ......................  File: ocfaq.info, Node: SUBTRACT, Next: SUM, Prev: SUB-QUEUE-3, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.453 SUBTRACT ...................  File: ocfaq.info, Node: SUM, Next: SUPER, Prev: SUBTRACT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.454 SUM ..............  File: ocfaq.info, Node: SUPER, Next: SUPPRESS, Prev: SUM, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.455 SUPER ................  File: ocfaq.info, Node: SUPPRESS, Next: SYMBOL, Prev: SUPER, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.456 SUPPRESS ...................  File: ocfaq.info, Node: SYMBOL, Next: SYMBOLIC, Prev: SUPPRESS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.457 SYMBOL .................  File: ocfaq.info, Node: SYMBOLIC, Next: SYNC, Prev: SYMBOL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.458 SYMBOLIC ...................  File: ocfaq.info, Node: SYNC, Next: SYNCHRONIZED, Prev: SYMBOLIC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.459 SYNC ...............  File: ocfaq.info, Node: SYNCHRONIZED, Next: SYSTEM-DEFAULT, Prev: SYNC, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.460 SYNCHRONIZED .......................  File: ocfaq.info, Node: SYSTEM-DEFAULT, Next: TABLE, Prev: SYNCHRONIZED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.461 SYSTEM-DEFAULT .........................  File: ocfaq.info, Node: TABLE, Next: TALLYING, Prev: SYSTEM-DEFAULT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.462 TABLE ................  File: ocfaq.info, Node: TALLYING, Next: TAPE, Prev: TABLE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.463 TALLYING ...................  File: ocfaq.info, Node: TAPE, Next: TERMINAL, Prev: TALLYING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.464 TAPE ...............  File: ocfaq.info, Node: TERMINAL, Next: TERMINATE, Prev: TAPE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.465 TERMINAL ...................  File: ocfaq.info, Node: TERMINATE, Next: TEST, Prev: TERMINAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.466 TERMINATE ....................  File: ocfaq.info, Node: TEST, Next: TEXT, Prev: TERMINATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.467 TEST ...............  File: ocfaq.info, Node: TEXT, Next: THAN, Prev: TEST, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.468 TEXT ...............  File: ocfaq.info, Node: THAN, Next: THEN, Prev: TEXT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.469 THAN ...............  File: ocfaq.info, Node: THEN, Next: THROUGH, Prev: THAN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.470 THEN ...............  File: ocfaq.info, Node: THROUGH, Next: THRU, Prev: THEN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.471 THROUGH ..................  File: ocfaq.info, Node: THRU, Next: TIME, Prev: THROUGH, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.472 THRU ...............  File: ocfaq.info, Node: TIME, Next: TIMES, Prev: THRU, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.473 TIME ...............  File: ocfaq.info, Node: TIMES, Next: TOx, Prev: TIME, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.474 TIMES ................  File: ocfaq.info, Node: TOx, Next: TOPx, Prev: TIMES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.475 TOx ..............  File: ocfaq.info, Node: TOPx, Next: TRAILING, Prev: TOx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.476 TOPx ...............  File: ocfaq.info, Node: TRAILING, Next: TRUE, Prev: TOPx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.477 TRAILING ...................  File: ocfaq.info, Node: TRUE, Next: TYPE, Prev: TRAILING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.478 TRUE ...............  File: ocfaq.info, Node: TYPE, Next: TYPEDEF, Prev: TRUE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.479 TYPE ...............  File: ocfaq.info, Node: TYPEDEF, Next: UCS-4, Prev: TYPE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.480 TYPEDEF ..................  File: ocfaq.info, Node: UCS-4, Next: UNDERLINE, Prev: TYPEDEF, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.481 UCS-4 ................  File: ocfaq.info, Node: UNDERLINE, Next: UNIT, Prev: UCS-4, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.482 UNDERLINE ....................  File: ocfaq.info, Node: UNIT, Next: UNIVERSAL, Prev: UNDERLINE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.483 UNIT ...............  File: ocfaq.info, Node: UNIVERSAL, Next: UNLOCK, Prev: UNIT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.484 UNIVERSAL ....................  File: ocfaq.info, Node: UNLOCK, Next: UNSIGNED, Prev: UNIVERSAL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.485 UNLOCK .................  File: ocfaq.info, Node: UNSIGNED, Next: UNSIGNED-INT, Prev: UNLOCK, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.486 UNSIGNED ...................  File: ocfaq.info, Node: UNSIGNED-INT, Next: UNSIGNED-LONG, Prev: UNSIGNED, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.487 UNSIGNED-INT .......................  File: ocfaq.info, Node: UNSIGNED-LONG, Next: UNSIGNED-SHORT, Prev: UNSIGNED-INT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.488 UNSIGNED-LONG ........................  File: ocfaq.info, Node: UNSIGNED-SHORT, Next: UNSTRING, Prev: UNSIGNED-LONG, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.489 UNSIGNED-SHORT .........................  File: ocfaq.info, Node: UNSTRING, Next: UNTIL, Prev: UNSIGNED-SHORT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.490 UNSTRING ...................  File: ocfaq.info, Node: UNTIL, Next: UPx, Prev: UNSTRING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.491 UNTIL ................  File: ocfaq.info, Node: UPx, Next: UPDATE, Prev: UNTIL, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.492 UPx ..............  File: ocfaq.info, Node: UPDATE, Next: UPON, Prev: UPx, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.493 UPDATE .................  File: ocfaq.info, Node: UPON, Next: USAGE, Prev: UPDATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.494 UPON ...............  File: ocfaq.info, Node: USAGE, Next: USE, Prev: UPON, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.495 USAGE ................ OpenCOBOL uses standard big-endian_ internal storage by default. USAGE clauses influence the data representation. The INTEL architecture uses little-endian_ form and OpenCOBOL programmers developing for this common chipset may need to pay heed to this for performance purposes. As per the standards, OpenCOBOL supports COMPUTATIONAL-5 native usage. OpenCOBOL enables use of one to eight byte binary representations in both big and little endian forms. Along with full support of all common COBOL_ PICTURE_ clauses both storage and display, OpenCOBOL supports USAGE clauses of: * BINARY * COMPUTATIONAL, COMP * COMP-1 * COMP-2 * COMP-3 * COMP-4 * COMP-5 * COMP-X * DISPLAY * INDEX * PACKED-DECIMAL * POINTER * PROGRAM-POINTER * SIGNED-SHORT * SIGNED-INT * SIGNED-LONG * UNSIGNED-SHORT * UNSIGNED-INT * UNSIGNED-LONG * BINARY-CHAR SIGNED * BINARY-CHAR UNSIGNED * BINARY-CHAR * BINARY-SHORT SIGNED * BINARY-SHORT UNSIGNED * BINARY-SHORT * BINARY-LONG SIGNED * BINARY-LONG UNSIGNED * BINARY-LONG * BINARY-DOUBLE SIGNED * BINARY-DOUBLE UNSIGNED * BINARY-DOUBLE * BINARY-C-LONG SIGNED * BINARY-C-LONG UNSIGNED * BINARY-C-LONG  File: ocfaq.info, Node: USE, Next: USER-DEFAULT, Prev: USAGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.496 USE ..............  File: ocfaq.info, Node: USER-DEFAULT, Next: USING, Prev: USE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.497 USER-DEFAULT .......................  File: ocfaq.info, Node: USING, Next: UTF-16, Prev: USER-DEFAULT, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.498 USING ................  File: ocfaq.info, Node: UTF-16, Next: UTF-8, Prev: USING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.499 UTF-16 .................  File: ocfaq.info, Node: UTF-8, Next: VAL-STATUS, Prev: UTF-16, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.500 UTF-8 ................  File: ocfaq.info, Node: VAL-STATUS, Next: VALID, Prev: UTF-8, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.501 VAL-STATUS .....................  File: ocfaq.info, Node: VALID, Next: VALIDATE, Prev: VAL-STATUS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.502 VALID ................  File: ocfaq.info, Node: VALIDATE, Next: VALIDATE-STATUS, Prev: VALID, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.503 VALIDATE ...................  File: ocfaq.info, Node: VALIDATE-STATUS, Next: VALUE, Prev: VALIDATE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.504 VALIDATE-STATUS ..........................  File: ocfaq.info, Node: VALUE, Next: VALUES, Prev: VALIDATE-STATUS, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.505 VALUE ................  File: ocfaq.info, Node: VALUES, Next: VARYING, Prev: VALUE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.506 VALUES .................  File: ocfaq.info, Node: VARYING, Next: WHEN, Prev: VALUES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.507 VARYING ..................  File: ocfaq.info, Node: WHEN, Next: WITH, Prev: VARYING, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.508 WHEN ...............  File: ocfaq.info, Node: WITH, Next: WORKING-STORAGE, Prev: WHEN, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.509 WITH ...............  File: ocfaq.info, Node: WORKING-STORAGE, Next: WRITE, Prev: WITH, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.510 WORKING-STORAGE ..........................  File: ocfaq.info, Node: WRITE, Next: YYYYDDD, Prev: WORKING-STORAGE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.511 WRITE ................  File: ocfaq.info, Node: YYYYDDD, Next: YYYYMMDD, Prev: WRITE, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.512 YYYYDDD ..................  File: ocfaq.info, Node: YYYYMMDD, Next: ZERO, Prev: YYYYDDD, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.513 YYYYMMDD ...................  File: ocfaq.info, Node: ZERO, Next: ZEROES, Prev: YYYYMMDD, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.514 ZERO ...............  File: ocfaq.info, Node: ZEROES, Next: ZEROS, Prev: ZERO, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.515 ZEROES .................  File: ocfaq.info, Node: ZEROS, Prev: ZEROES, Up: What are the OpenCOBOL RESERVED WORDS? 1.3.14.516 ZEROS ................  File: ocfaq.info, Node: Does OpenCOBOL support modules?, Next: What is COB_PRE_LOAD?, Prev: What are the OpenCOBOL RESERVED WORDS?, Up: Using OpenCOBOL 1.3.15 Does OpenCOBOL support modules? -------------------------------------- Yes. Quite nicely in fact. Dynamically! COBOL_ modules, and object files of many other languages are linkable. As OpenCOBOL uses intermediate C, linkage to other languages is well supported across many platforms. The OpenCOBOL CALL_ instruction maps COBOL USAGE_ to many common C stack frame data representations. Multipart, complex system development is well integrated in the OpenCOBOL model. $ cobc -b hello.cob goodbye.cob Combines both source files into a single dynamically loadable module. Example produces *hello.so*. Using the *-l* link library option, OpenCOBOL has access to most shared libraries supported on it's platforms. $ cobc -x -lcurl showcurl.cob Will link the /usr/lib/libcurl.so (_from the cURL project_) to showcurl. The OpenCOBOL CALL_ verb will use this linked library to resolve calls at runtime. Large scale systems are at the heart of COBOL development and OpenCOBOL is no exception. For more information, see `What is COB_PRE_LOAD?`_.  File: ocfaq.info, Node: What is COB_PRE_LOAD?, Next: What is the OpenCOBOL LINKAGE SECTION for?, Prev: Does OpenCOBOL support modules?, Up: Using OpenCOBOL 1.3.16 What is COB_PRE_LOAD? ---------------------------- COB_PRE_LOAD is an environment variable that controls what dynamic link modules are included in a run. For example: $ cobc occurl.c $ cobc occgi.c $ cobc -x myprog.cob $ export COB_PRE_LOAD=occurl:occgi $ ./myprog That will allow the OpenCOBOL runtime link resolver to find the entry point for CALL "CBL_OC_CURL_INIT" in the occurl.so module. _Note:_ the modules listed in the COB_PRE_LOAD environment variable DO NOT have extensions. OpenCOBOL will do the right thing on the various platforms. If the DSO_ files are not in the current working directory along with the executable, the COB_LIBRARY_PATH can be set to find them.  File: ocfaq.info, Node: What is the OpenCOBOL LINKAGE SECTION for?, Next: What does the -fstatic-linkage OpenCOBOL compiler option do?, Prev: What is COB_PRE_LOAD?, Up: Using OpenCOBOL 1.3.17 What is the OpenCOBOL LINKAGE SECTION for? ------------------------------------------------- Argument passing in COBOL is normally accomplished through the *LINKAGE SECTION*. This section does not allocate or initialize memory as would definitions in the WORKING-STORAGE SECTION. Care must be taken to inform COBOL of the actual source address of these variables before use. Influences CHAINING and USING phrases. See CALL_ for more details.  File: ocfaq.info, Node: What does the -fstatic-linkage OpenCOBOL compiler option do?, Next: Can OpenCOBOL interface with Ada?, Prev: What is the OpenCOBOL LINKAGE SECTION for?, Up: Using OpenCOBOL 1.3.18 What does the -fstatic-linkage OpenCOBOL compiler option do? ------------------------------------------------------------------- Under normal conditions, the _LINKAGE SECTION_ is unallocated and uninitialized. When a LINKAGE SECTION variable, that is not part of the _USING_ phrase (not a named calling argument), any memory that has been addressed becomes unaddressable across calls. _-fstatic-linkage_ creates static addressing to the LINKAGE SECTION. From [Roger]_: This relates to LINKAGE items that are NOT referred to in the USING phrase of the PROCEDURE DIVISION. It also only has relevance when the program is CALL'ed from another prog. This means that the addressability of these items must be programmed (usually with SET ADDRESS) before reference. Per default, the item loses it's addressability on exit from the program. This option causes the module to retain the item's address between CALL invocations of the program. With some rumours that this may become the default in future releases of OpenCOBOL, and the _-fstatic-linkage_ option may be deprecated.  File: ocfaq.info, Node: Can OpenCOBOL interface with Ada?, Next: Does OpenCOBOL support SCREEN SECTION?, Prev: What does the -fstatic-linkage OpenCOBOL compiler option do?, Up: Using OpenCOBOL 1.3.19 Can OpenCOBOL interface with Ada? ---------------------------------------- Yes. The freely available *gnat* system can be used and will create object files that can be included in an OpenCOBOL project. This example compiles an gnat package that includes _hello_ and _ingress_ PROCEDURE and a _echo_ FUNCTION. These will be called from an OpenCOBOL *adacaller.cob* program. The gnat specification file with Interfaces.C; use Interfaces.C; package HelloAda is procedure hello; procedure ingress(value : in INTEGER); function echo(message : in char_array) return integer; pragma export(C, hello); pragma export(C, ingress); pragma export(C, echo); end HelloAda; The gnat implementation body: with Ada.Text_IO, Ada.Integer_Text_IO, Interfaces.C; use Ada.Text_IO, Ada.Integer_Text_IO, Interfaces.C; package body HelloAda is procedure hello is begin Put_Line("Hello from Ada and OpenCOBOL"); New_Line; end hello; procedure ingress(value : in integer) is begin Put_Line("Passing integer to Ada from OpenCOBOL"); Put("OpenCOBOL passed: "); Put(value); New_Line; New_Line; end ingress; function echo(message : in char_array) return integer is begin Put(To_Ada(message, true)); return To_Ada(message, true)'length; end echo; end HelloAda; The adacaller.cob source file ********** adacaller.cob***************_* >>SOURCE FORMAT IS FIXED_********************************* * Author: Brian Tiffin * Date: 08-Sep-2008 * Purpose: Demonstrate using Ada sub-programs * Tectonics: gnatgcc -c helloada.adb * gnatbind -n helloada * gnatgcc -c b~helloada.abd * cobc -x -lgnat caller.cob helloada.o b~helloada.o********************************** identification division. program-id. caller. data division. working-storage section. 01 ada-message pic x(10) value "Ada echo" & x'0a' & x'00'. 01 result pic s9(9) value high-value. _*_******************************** procedure division. begin. call "adainit" end-call call "hello" end-call call "ingress" using by value 42 end-call call "echo" using by reference ada-message returning result end-call display "Ada return: " result end-display call "adafinal" end-call goback . end program caller. And the tectonics; Debian GNU/Linux _build.sh_ gnatgcc -c helloada.adb gnatbind -n helloada gnatgcc -c b~helloada.adb cobc -x -lgnat adacaller.cob helloada.o b~helloada.o An important step is the creation of the object file from the _gnatbind_ output _with -n_ that is used in the final OpenCOBOL executable. Sample run using ./adacaller: Hello from Ada and OpenCOBOL Passing integer to Ada from OpenCOBOL OpenCOBOL passed: 42 Ada echo Ada return: +000000009  File: ocfaq.info, Node: Does OpenCOBOL support SCREEN SECTION?, Next: What are the OpenCOBOL SCREEN SECTION colour values?, Prev: Can OpenCOBOL interface with Ada?, Up: Using OpenCOBOL 1.3.20 Does OpenCOBOL support SCREEN SECTION? --------------------------------------------- Yes. The OpenCOBOL 1.1 pre-release now includes support for SCREEN SECTION. Experimental release for this support occurred in early July, 2008. The compiler recognizes most (if not all) of the _Screen description entry_ of the COBOL 2008 Draft standard. External variables that influence screen handling include COB_SCREEN_EXCEPTIONS=Y To enable exceptions during ACCEPT. COB_SCREEN_ESCAPE=Y To enable handling of the escape key. See `Does OpenCOBOL support CRT STATUS?`_ for more information on key codes and exception handling. According to the standard a SCREEN SECTION ACCEPT does not need to be proceeded by a DISPLAY. The extra DISPLAY won't hurt, but is not necessary.  File: ocfaq.info, Node: What are the OpenCOBOL SCREEN SECTION colour values?, Next: Does OpenCOBOL support CRT STATUS?, Prev: Does OpenCOBOL support SCREEN SECTION?, Up: Using OpenCOBOL 1.3.21 What are the OpenCOBOL SCREEN SECTION colour values? ----------------------------------------------------------- The FOREGROUND-COLOR and BACKGROUND-COLOR clauses will accept 78 black value 0. 78 blue value 1. 78 green value 2. 78 cyan value 3. 78 red value 4. 78 magenta value 5. 78 brown value 6. 78 white value 7. The display of these colours are also influenced by HIGHLIGHT, LOWLIGHT and REVERSE-VIDEO options. For instance, brown will display as yellow when HIGHLIGHT is used.  File: ocfaq.info, Node: Does OpenCOBOL support CRT STATUS?, Next: What is CobCurses?, Prev: What are the OpenCOBOL SCREEN SECTION colour values?, Up: Using OpenCOBOL 1.3.22 Does OpenCOBOL support CRT STATUS? ----------------------------------------- Yes. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. CRT STATUS IS screen-status. DATA DIVISION. WORKING-STORAGE SECTION. COPY screenio. 01 screen-status pic 9(4). PROCEDURE DIVISION. ACCEPT screen-sample. IF screen-status = COB-SCR-F1 ... There is also a special OpenCOBOL variable, *COB-CRT-STATUS* which can be used instead of the CRT STATUS special name. There is also a COPY text that ships with OpenCOBOL, copy/screenio.cpy that can be included in the DATA DIVISION and provides 78 level constants for supported key status codes. Some values include: * COB-SCR-F1 thru * COB-SCR-F64 * COB-SCR-ESC examine the file to see the other values.  File: ocfaq.info, Node: What is CobCurses?, Next: What is CobXRef?, Prev: Does OpenCOBOL support CRT STATUS?, Up: Using OpenCOBOL 1.3.23 What is CobCurses? ------------------------- CobCurses is an optional package designed to work with OpenCOBOL 1.0, before OpenCOBOL 1.1 SCREEN SECTION support was initiated. It has many features beyond simple SCREEN SECTION handling. See http://sourceforge.net/projects/cobcurses (http://sourceforge.net/projects/cobcurses) for full details. This is a major piece of work by Warren Gay, ve3wwg. From an opencobol.org_ posting by Warren announcing release 0.95: CobCurses is a package designed to allow Open-Cobol programmers to create screens on open system platforms, or those (like Windows) that can use PDCurses. Since handcrafting screens is tedious work, this package includes a "Screen Designer" utility. All User Guides and Programmer Guide documentation can be found on the source forge (see link at bottom). ==== RELEASE NOTES ==== A large number of internal changes were implemented in this release, but first let's cover the user visible improvements: 1. MENUS! Popup menus are now supported, and are available in sdesign with every Action field. In fact, any sdesign field that is marked with a diamond graphic, has the ability to popup a menu with F1 (or ^O). 2. To support menus, FUNCTION keys are now available in Action mode (though CONTROL-O is an alternate way of opening a menu). This included a new event callback NC-FKEY-EVENT. 3. GRAPHIC characters in the screen background. It is now possible using sdesign to draw alternate-charset graphics in your screen background. See the notes in the opening help screen for the "Paint" function. 4. TRACE facilities. CobCurses now includes an environment variable that can enable capturing of trace information to a file for debugging. A routine named NC_TRACE_MSG can also be used to add custom messages to the trace file. INTERNAL CHANGES: The main two major internal changes were: 1. The terminal support has been virtualized, so that the CobCurses routines deal with a "terminal" object (not curses routines). This will eventually lead to other possible windowing interfaces like perhaps graphic X Window or native Windows support. The other motivation for this was to allow CobCurses to have one consistent set of constants for colours, attributes and character sets. Previously, these values were different depending upon the platform and implementation of curses used. 2. Menu support has been provided independently of curses. This is important for portability since PDCurses and some platforms do not provide a curses menu library. This also guarantees that CobCurses menus will behave consistently on all platforms (and overcome menu paging bugs in ncurses). PLANNED FOR THE NEXT RELEASE: Please avoid writing much code that works with colour pairs. In the next release, it is planned to hide the colour pair value altogether by using a TDC (Terminal Drawing Context). This TDC will tie together attributes and colours, and perhaps other "drawing contexts" so that you won't have to manage colour pairs (this will be transparent). This will also pave the way for graphical interfaces where a selected font and line styles etc. may also be supported. NOTES: HPUX users will need to link with ncurses, instead of the native HPUX curses libraries. I didn't have time to fully investigate this, but the native include files define things like MENU and ITEM types that conflict with the CobCurses defined ones. ==== The release is available for download here: http://sourceforge.net/projects/cobcurses  File: ocfaq.info, Node: What is CobXRef?, Next: Does OpenCOBOL implement Report Writer?, Prev: What is CobCurses?, Up: Using OpenCOBOL 1.3.24 What is CobXRef? ----------------------- CobXRef is a COBOL cross-referencing utility written by Vincent Coen and ported to OpenCOBOL 1.1. Current source code is available at http://svn.wp0.org/add1/tools/cobxref (http://svn.wp0.org/add1/tools/cobxref) or http://sourceforge.net/projects/cobxref/ (http://sourceforge.net/projects/cobxref/) and is |currently| in active development. The system ships with full documentation and information for building from source is included in the _readme_ file. Fetching the utility $ svn checkout http://svn.wp0.org/add1/tools/cobxref (http://svn.wp0.org/add1/tools/cobxref) Example *truncated* to 72 and using the ocdoc.cob OpenCOBOL program for source code: $ cobc -save-temps ocdoc.cob $ cobxref ocdoc.i -L $ cut -c1-72 ocdoc.lst ACS Cobol Cross Reference Xref v0.95.27 (04/01/2009@11:27) Dictionary Fi Symbols of Module: ocdoc (ocdoc) -------------------------------- Data Section (FILE) Defn Locations ---------------------------------+-------------------------------------- doc-output 000124F 000252 000499 doc-record 000125F 000269 000381 000387 000390 00 000478 000482 000485 source-input 000122F 000251 000287 000458 000500 source-record 000123F 000285 000288 000300 000316 00 000324 000355 000456 000459 standard-input 000117F 000256 000282 000453 000497 standard-output 000119F 000257 000496 stdin-record 000118F 000283 000285 000454 000456 stdout-record 000120F 000387 000388 000475 000476 ACS Cobol Cross Reference Xref v0.95.27 (04/01/2009@11:27) Dictionary Fi Symbols of Module: ocdoc (ocdoc) -------------------------------- Data Section (WORKING-STORAGE) Defn Locations ---------------------------------+-------------------------------------- arguments 000128W 000219 000221 000244 000245 autoappend 000187W 000380 autodoc 000186W 000385 buffer-empty 000178W 000267 000380 000398 000472 buffer-flag 000177W buffer-offset 000176W 000268 000382 000399 000433 00 buffered-output 000179W 000385 000441 000471 counter 000181W 000369 000410 000412 000416 data-field1 000193W data-field2 000194W data-field3 000197W data-record 000192W data-subfield1 000195W data-subfield2 000196W 000218 doc-buffer 000175W 000417 000419 000430 doc-name 000130W 000246 000505 000522 000532 filter-flag 000138W filtering 000139W 000254 000281 000386 000452 00 first-part 000184W 000368 helping 000137W 000222 here-data 000169W 000355 here-record 000167W 000356 heredoc 000156W 000315 000337 000354 hereend 000153W 000340 000353 hereflag 000155W herenone 000157W 000341 herestart 000152W 000336 000353 len-of-comment 000182W 000411 000415 000416 line-count 000141W 000270 000301 000435 line-display 000142W 000435 000438 result 000190W 000548 000551 000552 result-name 000131W 000247 000518 000524 000534 rst-command 000189W 000517 000525 000535 000542 00 seq-data 000173W 000317 seq-record 000171W 000318 skipseqnum 000135W 000314 source-name 000129W 000246 000504 special 000185W 000379 style-name 000132W 000247 000519 000530 trimmed 000151W 000316 000321 000324 000356 00 usagehelp 000136W 000221 verbose 000134W 000392 000480 000503 000539 verbosity 000133W 000248 ACS Cobol Cross Reference Xref v0.95.27 (04/01/2009@11:27) Dictionary Fi Variable Tested [S] Symbol (88-Conditions) -------------------------------------------------------------- buffer-flag buffer-empty buffer-flag buffered-output filter-flag filtering first-part special first-part autodoc first-part autoappend hereflag heredoc hereflag herenone trimmed herestart trimmed hereend usagehelp helping verbosity verbose verbosity skipseqnum ACS Cobol Cross Reference Xref v0.95.27 (04/01/2009@11:27) Dictionary Fi Variable Tested Symbol (88-Conditions) [S] -------------------------------------------------------------- first-part autoappend first-part autodoc buffer-flag buffer-empty buffer-flag buffered-output filter-flag filtering usagehelp helping hereflag heredoc trimmed hereend hereflag herenone trimmed herestart verbosity skipseqnum first-part special verbosity verbose ACS Cobol Cross Reference Xref v0.95.27 (04/01/2009@11:27) Dictionary Fi Procedure Defn Locations ---------------------------------+-------------------------------------- trim 000324P 000394 000430 000482 000504 00 ACS Cobol Cross Reference Xref v0.95.27 (04/01/2009@11:27) Dictionary Fi Unreferenced Working Storage Symbols buffer-flag 000177W data-field1 000193W data-field2 000194W data-field3 000197W data-record 000192W data-subfield1 000195W filter-flag 000138W hereflag 000155W ACS Cobol Cross Reference Xref v0.95.27 (04/01/2009@11:27) Dictionary Fi Unreferenced Procedures None _CobXRef produces 132 column output by default and the commands used here limit the width to 72 characters in order to fit the FAQ file._  File: ocfaq.info, Node: Does OpenCOBOL implement Report Writer?, Next: Does OpenCOBOL implement LINAGE?, Prev: What is CobXRef?, Up: Using OpenCOBOL 1.3.25 Does OpenCOBOL implement Report Writer? ---------------------------------------------- Not at this time. _July, 2008_ But it does support LINAGE. See `Does OpenCOBOL implement LINAGE?`_  File: ocfaq.info, Node: Does OpenCOBOL implement LINAGE?, Next: Does OpenCOBOL implement any Intrinsic FUNCTIONs?, Prev: Does OpenCOBOL implement Report Writer?, Up: Using OpenCOBOL 1.3.26 Does OpenCOBOL implement LINAGE? --------------------------------------- Yes. LINAGE sets up logical pages inside file descriptors enhancing the WRITE operations and enabling the END-OF-PAGE clause. FILE SECTION. FD A-REPORT LINAGE IS 13 LINES TOP 2 FOOTING 2 BOTTOM 3. LINAGE clauses can set: TOP LINES FOOTING BOTTOM The LINAGE-COUNTER_ noun is maintained during writes to LINAGE output files. See LINAGE_ for a sample program.  File: ocfaq.info, Node: Does OpenCOBOL implement any Intrinsic FUNCTIONs?, Next: Can you clarify the use of FUNCTION in OpenCOBOL?, Prev: Does OpenCOBOL implement LINAGE?, Up: Using OpenCOBOL 1.3.27 Does OpenCOBOL implement any Intrinsic FUNCTIONs? -------------------------------------------------------- Yes, many. As of the July 2008 1.1 pre-release ABS, ACOS, ANNUITY, ASIN, ATAN, BYTE-LENGTH, CHAR, CONCATENATE, COS, CURRENT-DATE, DATE-OF-INTEGER, DATE-TO-YYYYMMDD, DAY-OF-INTEGER, DAY-TO-YYYYDDD, E, EXCEPTION-FILE, EXCEPTION-LOCATION, EXCEPTION-STATEMENT, EXCEPTION-STATUS, EXP, EXP10, FACTORIAL, FRACTION-PART, INTEGER, INTEGER-OF-DATE, INTEGER-OF-DAY, INTEGER-PART, LENGTH, LOCALE-DATE, LOCALE-TIME, LOG, LOG10, LOWER-CASE, MAX, MEAN, MEDIAN, MIDRANGE, MIN, MOD, NUMVAL, NUMVAL-C, ORD, ORD-MAX, ORD-MIN, PI, PRESENT-VALUE, RANDOM, RANGE, REM, REVERSE, SECONDS-FROM-FORMATTED-TIME, SECONDS-PAST-MIDNIGHT, SIGN, SIN, SQRT, STANDARD-DEVIATION, STORED-CHAR-LENGTH, SUBSTITUTE, SUM, TAN, TEST-DATE-YYYYMMDD, TEST-DAY-YYYYMMDD, TRIM, UPPER-CASE, VARIANCE, WHEN-COMPILED, YEAR-TO-YYYY * Menu: * ABS:: * ACOS:: * ANNUITY:: * ASIN:: * ATAN:: * FUNCTION BYTE-LENGTH:: * CHAR:: * CONCATENATE:: * COS:: * CURRENT-DATE:: * DATE-OF-INTEGER:: * DATE-TO-YYYYMMDD:: * DAY-OF-INTEGER:: * DAY-TO-YYYYDDD:: * E:: * EXCEPTION-FILE:: * EXCEPTION-LOCATION:: * EXCEPTION-STATEMENT:: * EXCEPTION-STATUS:: * EXP:: * EXP10:: * FACTORIAL:: * FRACTION-PART:: * INTEGER:: * INTEGER-OF-DATE:: * INTEGER-OF-DAY:: * INTEGER-PART:: * FUNCTION LENGTH:: * FUNCTION LOCALE-DATE:: * LOCALE-TIME:: * LOG:: * LOG10:: * LOWER-CASE:: * MAX:: * MEAN:: * MEDIAN:: * MIDRANGE:: * MIN:: * MOD:: * NUMVAL:: * NUMVAL-C:: * ORD:: * ORD-MAX:: * ORD-MIN:: * PIx:: * PRESENT-VALUE:: * FUNCTION RANDOM:: * FUNCTION RANGE:: * REM:: * REVERSE:: * SECONDS-FROM-FORMATTED-TIME:: * SECONDS-PAST-MIDNIGHT:: * FUNCTION SIGN:: * SIN:: * SQRT:: * STANDARD-DEVIATION:: * STORED-CHAR-LENGTH:: * SUBSTITUTE:: * SUBSTITUTE-CASE:: * FUNCTION SUM:: * TAN:: * TEST-DATE-YYYYMMDD:: * TEST-DAY-YYYYMMDD:: * TRIM:: * UPPER-CASE:: * VARIANCE:: * WHEN-COMPILED:: * YEAR-TO-YYYY::  File: ocfaq.info, Node: ABS, Next: ACOS, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.1 ABS ............ Absolute value of numeric argument DISPLAY FUNCTION ABS(DIFFERENCE).  File: ocfaq.info, Node: ACOS, Next: ANNUITY, Prev: ABS, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.2 ACOS ............. The ACOS function returns a numeric value (in radians) that approximates the arccosine of the argument. The domain of the arccosine function is -1 to +1. Domain errors return a result of 0. The inverse cosine function returns a range of 0 thru |PISYM| DISPLAY FUNCTION ACOS(-1).  File: ocfaq.info, Node: ANNUITY, Next: ASIN, Prev: ACOS, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.3 ANNUITY ................ Compute the ratio of an annuity paid based on arguments of interest and number of periods. WORKING-STORAGE SECTION. 77 INTEREST PIC S9V9999 VALUE 0.08. 77 MONTHLY PIC S9V9999 VALUE ZERO. 77 PERIODS PIC 99 VALUE 36. 77 ANNUITY-VALUE PIC S9V9999 VALUE ZERO. PROCEDURE DIVISION. COMPUTE MONTHLY ROUNDED = INTEREST / 12 COMPUTE ANNUITY-VALUE ROUNDED = FUNCTION ANNUITY (MONTHLY PERIODS) DISPLAY "Monthly rate: " MONTHLY " Periods: " PERIODS " Annuity ratio: " ANNUITY-VALUE END-DISPLAY. Outputs: Monthly rate: +0.0067 Periods: 36 Annuity ratio: +0.0314  File: ocfaq.info, Node: ASIN, Next: ATAN, Prev: ANNUITY, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.4 ASIN ............. The ASIN function returns a numeric value (in radians) that approximates the arcsine of the argument. The domain of the arcsine function is -1 to +1. Domain errors return a result of 0. The inverse sine function returns a range of -|PISYM|/2 thru |PISYM|/2 DISPLAY FUNCTION ASIN(-1).  File: ocfaq.info, Node: ATAN, Next: FUNCTION BYTE-LENGTH, Prev: ASIN, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.5 ATAN ............. The ATAN function returns a numeric value (in radians) that approximates the arctangent of the argument. The domain of the arctangent function is all real numbers. The inverse tangent function returns a range of -|PISYM|/2 thru |PISYM|/2 DISPLAY FUNCTION ATAN(1).  File: ocfaq.info, Node: FUNCTION BYTE-LENGTH, Next: CHAR, Prev: ATAN, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.6 FUNCTION BYTE-LENGTH ............................. The BYTE-LENGTH function returns an integer that is the internal storage length of the given argument. >>SOURCE FORMAT IS FIXED * Purpose: demonstrate intrinsic FUNCTION BYTE-LENGTH identification division. program-id. bytelength. data division. working-storage section. 01 char-var usage binary-char. 01 short-var usage binary-short. 01 long-var usage binary-long. 01 double-var usage binary-double. 01 num1-var pic 9. 01 num4-var pic 99v99. 01 num9-var pic s9(9). 01 num18-var pic s9(18). 01 num18c-var pic s9(18) usage comp. 01 num18p-var pic s9(18) usage comp-3. 01 edit-var pic $zzzz9.99. 01 string-var pic x(10) value "abc". 01 newline pic x value x'0a'. procedure division. display "num1-var len = " function byte-length(num1-var) newline "num4-var len = " function byte-length(num4-var) newline "num9-var len = " function byte-length(num9-var) newline "num18-var len = " function byte-length(num18-var) newline "num18c-var len = " function byte-length(num18c-var) newline "num18p-var len = " function byte-length(num18p-var) newline "edit-var len = " function byte-length(edit-var) newline "12 len = " function byte-length(12) newline "12.12 len = " function byte-length(12.12) newline "1234567890.123 = " function byte-length(1234567890.123) newline "string-var len = " function byte-length(string-var) newline "trim string = " function byte-length(function trim(string-var)) newline "char-var len = " function byte-length(char-var) newline "short-var len = " function byte-length(short-var) newline "long-var len = " function byte-length(long-var) newline "double-var len = " function byte-length(double-var) end-display goback. exit program. Outputs: num1-var len = 1 num4-var len = 4 num9-var len = 9 num18-var len = 18 num18c-var len = 8 num18p-var len = 10 edit-var len = 9 12 len = 2 12.12 len = 4 1234567890.123 = 13 string-var len = 10 trim string = 00000003 char-var len = 1 short-var len = 2 long-var len = 4 double-var len = 8  File: ocfaq.info, Node: CHAR, Next: CONCATENATE, Prev: FUNCTION BYTE-LENGTH, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.7 CHAR ............. The CHAR function returns a ONE character alphanumeric field whose value is the character in the current collating sequence having the ordinal position equal to the value of the integer argument. The argument must be greater than 0 and less than or equal to the number of positions in the collating sequence. Errors in the argument range return 0 (the LOW-VALUE by default). See ASCII_ or EBCDIC_ and details of the ALPHABET_ clause. DISPLAY FUNCTION CHAR(66). Would output *A* in the ASCII character set. Note this may be different than what some expect. OpenCOBOL CHAR is 1 thru 128 not 0 thru 127 as a C programmer may be used to. _And to add a little confusion, most personal computers use an extended character set, usually erroneously called ASCII with a range of 0 to 255. A more appropriate name may be ISO-8859-1 Latin 1._ See ASCII_ for more accurate details. This author is often guilty of this misnomer of the use of the term ASCII.  File: ocfaq.info, Node: CONCATENATE, Next: COS, Prev: CHAR, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.8 CONCATENATE .................... Concatenate the given fields.  File: ocfaq.info, Node: COS, Next: CURRENT-DATE, Prev: CONCATENATE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.9 COS ............ The COS function returns a numeric value that approximates the cosine of the argument (in radians). The domain of the cosine function is all real numbers, with a nominal domain of 0 thru |PISYM| with a zero returned at |PISYM|/2. The cosine function returns a range of -1 thru +1. DISPLAY FUNCTION COS(1.5707963267949).  File: ocfaq.info, Node: CURRENT-DATE, Next: DATE-OF-INTEGER, Prev: COS, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.10 CURRENT-DATE ...................... Returns an alphanumeric field of length 21 with the current date, time and timezone information in the form YYYYMMDDhhmmsscc |plusminus| tznn DISPLAY FUNCTION CURRENT-DATE. Example Output: 2008080921243796-0400  File: ocfaq.info, Node: DATE-OF-INTEGER, Next: DATE-TO-YYYYMMDD, Prev: CURRENT-DATE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.11 DATE-OF-INTEGER ......................... Converts an integer date, days on the Gregorian since December 31 1600 to YYYYMMDD form DISPLAY DATE-OF-INTEGER(1) DISPLAY DATE-OF-INTEGER(50000) Outputs: 16010101 17371123 50,000 days after December 31, 1600 being November 23rd, 1737.  File: ocfaq.info, Node: DATE-TO-YYYYMMDD, Next: DAY-OF-INTEGER, Prev: DATE-OF-INTEGER, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.12 DATE-TO-YYYYMMDD .......................... Converts a two digit year date format to four digit year form using a sliding window pivot of the optional second argument. The pivot defaults to 50. The OpenCOBOL implementation of DATE-TO-YYYYMMDD also accepts an optional third argument, replacing the default century value of 1900 and is treated as the years added to the given year portion of the first argument and modified by the sliding 100 window pivot. Domain errors occur for year values less than 1600 and greater than 999,999. There is no validation of the input date. Because of the sliding window, this function is dependent on the date of evaluation DISPLAY FUNCTION DATE-TO-YYYYMMDD(000101) DISPLAY FUNCTION DATE-TO-YYYYMMDD(500101) DISPLAY FUNCTION DATE-TO-YYYYMMDD(610101) DISPLAY FUNCTION DATE-TO-YYYYMMDD(990101) DISPLAY FUNCTION DATE-TO-YYYYMMDD(990101, 50, 1900) DISPLAY FUNCTION DATE-TO-YYYYMMDD(990101, -10, 1900) DISPLAY FUNCTION DATE-TO-YYYYMMDD(990101, 50, 2000) DISPLAY FUNCTION DATE-TO-YYYYMMDD(990101, 50, 2100) When run in August, 2008 produces: 20000101 20500101 19610101 19990101 18990101 17990101 19990101 20990101  File: ocfaq.info, Node: DAY-OF-INTEGER, Next: DAY-TO-YYYYDDD, Prev: DATE-TO-YYYYMMDD, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.13 DAY-OF-INTEGER ........................ Converts a Gregorian integer date form to Julian date form (YYYDDD) based on days since December 31, 1600. Errors return 0 DISPLAY FUNCTION DAY-OF-INTEGER(97336). 1867182 97,336 days after 16001231 being the 182nd day of the year 1867. Canada's date of Confederation and recognized birthday.  File: ocfaq.info, Node: DAY-TO-YYYYDDD, Next: E, Prev: DAY-OF-INTEGER, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.14 DAY-TO-YYYYDDD ........................ Converts a Julian 2 digit year and three digit dat integer to a four digit year form. See DATE-TO-YYYYMMDD_ for some of the details of the calculations involved.  File: ocfaq.info, Node: E, Next: EXCEPTION-FILE, Prev: DAY-TO-YYYYDDD, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.15 E ...........  File: ocfaq.info, Node: EXCEPTION-FILE, Next: EXCEPTION-LOCATION, Prev: E, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.16 EXCEPTION-FILE ........................ This special-register holds the error number and name of the source file that caused an input output exception. See EXCEPTION-STATUS_ for an example.  File: ocfaq.info, Node: EXCEPTION-LOCATION, Next: EXCEPTION-STATEMENT, Prev: EXCEPTION-FILE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.17 EXCEPTION-LOCATION ............................ This special-register can be queried for the location of the last exception. See FUNCTION EXCEPTION-STATUS_ for example source code. Note: This feature requires compilation with _-fsource-location_ compiler switch. This option is also turned on with _-g_ debugging info compiles. Information includes PROGRAM-ID, section and source line.  File: ocfaq.info, Node: EXCEPTION-STATEMENT, Next: EXCEPTION-STATUS, Prev: EXCEPTION-LOCATION, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.18 EXCEPTION-STATEMENT ............................. This special-register holds the statement that was executing when the latest exception was raised. See FUNCTION EXCEPTION-STATUS_ for an example. Note: This feature requires compilation with _-fsource-location_ compiler switch. This option is also turned on with _-g_ debugging info compiles.  File: ocfaq.info, Node: EXCEPTION-STATUS, Next: EXP, Prev: EXCEPTION-STATEMENT, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.19 EXCEPTION-STATUS .......................... This FUNCTION returns the current exception status. The example below is courtesy of Roger While, from a post he made announcing the _FUNCTION EXCEPTION-_ features. Source format is free, compile with _cobc -x -g -free except.cob_ IDENTIFICATION DIVISION. PROGRAM-ID. MINIPROG. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. LINUX. OBJECT-COMPUTER. LINUX. SPECIAL-NAMES. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT PRINTFILE ASSIGN TO "XXRXWXX" FILE STATUS RXWSTAT. DATA DIVISION. FILE SECTION. FD PRINTFILE. 01 PRINTREC PIC X(132). WORKING-STORAGE SECTION. 01 RXWSTAT PIC XX. PROCEDURE DIVISION. A00-MAIN SECTION. 001-MAIN-PROCEDURE. OPEN INPUT PRINTFILE. DISPLAY "File Status: " RXWSTAT. DISPLAY "EXCEPTION-FILE: " FUNCTION EXCEPTION-FILE. DISPLAY "Return Length: " FUNCTION LENGTH (FUNCTION EXCEPTION-FILE). DISPLAY "EXCEPTION-STATUS: " FUNCTION EXCEPTION-STATUS. DISPLAY "EXCEPTION-STATEMENT: " FUNCTION EXCEPTION-STATEMENT. STRING "TOOLONG" DELIMITED SIZE INTO RXWSTAT. DISPLAY "EXCEPTION-STATUS: " FUNCTION EXCEPTION-STATUS. DISPLAY "EXCEPTION-STATEMENT: " FUNCTION EXCEPTION-STATEMENT. DISPLAY "EXCEPTION-LOCATION: " FUNCTION EXCEPTION-LOCATION. STOP RUN. Example output: File Status: 35 EXCEPTION-FILE: 35PRINTFILE Return Length: 00000011 EXCEPTION-STATUS: EC-I-O-PERMANENT-ERROR EXCEPTION-STATEMENT: OPEN EXCEPTION-STATUS: EC-OVERFLOW-STRING EXCEPTION-STATEMENT: STRING EXCEPTION-LOCATION: MINIPROG; 001-MAIN-PROCEDURE OF A00-MAIN; 29 .. TIP:: See the source file libcob/exception.def for a list of the plethora of run-time exceptions supported by OpenCOBOL.  File: ocfaq.info, Node: EXP, Next: EXP10, Prev: EXCEPTION-STATUS, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.20 EXP .............  File: ocfaq.info, Node: EXP10, Next: FACTORIAL, Prev: EXP, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.21 EXP10 ...............  File: ocfaq.info, Node: FACTORIAL, Next: FRACTION-PART, Prev: EXP10, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.22 FACTORIAL ...................  File: ocfaq.info, Node: FRACTION-PART, Next: INTEGER, Prev: FACTORIAL, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.23 FRACTION-PART .......................  File: ocfaq.info, Node: INTEGER, Next: INTEGER-OF-DATE, Prev: FRACTION-PART, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.24 INTEGER .................  File: ocfaq.info, Node: INTEGER-OF-DATE, Next: INTEGER-OF-DAY, Prev: INTEGER, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.25 INTEGER-OF-DATE .........................  File: ocfaq.info, Node: INTEGER-OF-DAY, Next: INTEGER-PART, Prev: INTEGER-OF-DATE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.26 INTEGER-OF-DAY ........................  File: ocfaq.info, Node: INTEGER-PART, Next: FUNCTION LENGTH, Prev: INTEGER-OF-DAY, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.27 INTEGER-PART ......................  File: ocfaq.info, Node: FUNCTION LENGTH, Next: FUNCTION LOCALE-DATE, Prev: INTEGER-PART, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.28 FUNCTION LENGTH .........................  File: ocfaq.info, Node: FUNCTION LOCALE-DATE, Next: LOCALE-TIME, Prev: FUNCTION LENGTH, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.29 FUNCTION LOCALE-DATE ..............................  File: ocfaq.info, Node: LOCALE-TIME, Next: LOG, Prev: FUNCTION LOCALE-DATE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.30 LOCALE-TIME .....................  File: ocfaq.info, Node: LOG, Next: LOG10, Prev: LOCALE-TIME, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.31 LOG .............  File: ocfaq.info, Node: LOG10, Next: LOWER-CASE, Prev: LOG, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.32 LOG10 ...............  File: ocfaq.info, Node: LOWER-CASE, Next: MAX, Prev: LOG10, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.33 LOWER-CASE ....................  File: ocfaq.info, Node: MAX, Next: MEAN, Prev: LOWER-CASE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.34 MAX .............  File: ocfaq.info, Node: MEAN, Next: MEDIAN, Prev: MAX, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.35 MEAN ..............  File: ocfaq.info, Node: MEDIAN, Next: MIDRANGE, Prev: MEAN, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.36 MEDIAN ................  File: ocfaq.info, Node: MIDRANGE, Next: MIN, Prev: MEDIAN, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.37 MIDRANGE ..................  File: ocfaq.info, Node: MIN, Next: MOD, Prev: MIDRANGE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.38 MIN .............  File: ocfaq.info, Node: MOD, Next: NUMVAL, Prev: MIN, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.39 MOD .............  File: ocfaq.info, Node: NUMVAL, Next: NUMVAL-C, Prev: MOD, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.40 NUMVAL ................  File: ocfaq.info, Node: NUMVAL-C, Next: ORD, Prev: NUMVAL, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.41 NUMVAL-C ..................  File: ocfaq.info, Node: ORD, Next: ORD-MAX, Prev: NUMVAL-C, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.42 ORD .............  File: ocfaq.info, Node: ORD-MAX, Next: ORD-MIN, Prev: ORD, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.43 ORD-MAX .................  File: ocfaq.info, Node: ORD-MIN, Next: PIx, Prev: ORD-MAX, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.44 ORD-MIN .................  File: ocfaq.info, Node: PIx, Next: PRESENT-VALUE, Prev: ORD-MIN, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.45 PIx .............  File: ocfaq.info, Node: PRESENT-VALUE, Next: FUNCTION RANDOM, Prev: PIx, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.46 PRESENT-VALUE .......................  File: ocfaq.info, Node: FUNCTION RANDOM, Next: FUNCTION RANGE, Prev: PRESENT-VALUE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.47 FUNCTION RANDOM .........................  File: ocfaq.info, Node: FUNCTION RANGE, Next: REM, Prev: FUNCTION RANDOM, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.48 FUNCTION RANGE ........................  File: ocfaq.info, Node: REM, Next: REVERSE, Prev: FUNCTION RANGE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.49 REM .............  File: ocfaq.info, Node: REVERSE, Next: SECONDS-FROM-FORMATTED-TIME, Prev: REM, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.50 REVERSE .................  File: ocfaq.info, Node: SECONDS-FROM-FORMATTED-TIME, Next: SECONDS-PAST-MIDNIGHT, Prev: REVERSE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.51 SECONDS-FROM-FORMATTED-TIME .....................................  File: ocfaq.info, Node: SECONDS-PAST-MIDNIGHT, Next: FUNCTION SIGN, Prev: SECONDS-FROM-FORMATTED-TIME, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.52 SECONDS-PAST-MIDNIGHT ...............................  File: ocfaq.info, Node: FUNCTION SIGN, Next: SIN, Prev: SECONDS-PAST-MIDNIGHT, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.53 FUNCTION SIGN .......................  File: ocfaq.info, Node: SIN, Next: SQRT, Prev: FUNCTION SIGN, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.54 SIN .............  File: ocfaq.info, Node: SQRT, Next: STANDARD-DEVIATION, Prev: SIN, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.55 SQRT ..............  File: ocfaq.info, Node: STANDARD-DEVIATION, Next: STORED-CHAR-LENGTH, Prev: SQRT, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.56 STANDARD-DEVIATION ............................  File: ocfaq.info, Node: STORED-CHAR-LENGTH, Next: SUBSTITUTE, Prev: STANDARD-DEVIATION, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.57 STORED-CHAR-LENGTH ............................  File: ocfaq.info, Node: SUBSTITUTE, Next: SUBSTITUTE-CASE, Prev: STORED-CHAR-LENGTH, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.58 SUBSTITUTE .................... FUNCTION SUBSTITUTE is an OpenCOBOL extension to the suite of intrinsic functions. DISPLAY FUNCTION SUBSTITUTE("this is a test", "this", "that", "is a", "was", "test", "very cool!") END-DISPLAY Will display: that was very cool! having changed _this_ for _that_, _is a_ for _was_ and _test_ with *very cool!* The new intrinsic accepts: SUBSTITUTE(subject, lit-pat-1, repl-1 [, litl-pat-2, repl-2, ...]) _where lit-pat just means the scan is for literals, not that you have to use literal constants._ WORKING-STORAGE identifiers are fine for any of the subject, the search patterns or the replacements. As with all intrinsics, you receive a new field and the subject is untouched. .. Attention:: The resulting field can be shorter, the same length or longer than the subject string. This is literal character *global* find and replace, and there are no wildcards or other pattern expressions. Unlike INSPECT, this function *does not require same length* patterns and replacements. Each pattern replacement pair uses the original subject, not any intermediate in progress result. As this is an alphanumeric operation, a reference modification is also allowed MOVE FUNCTION SUBSTITUTE(subject, pat, repl)(2:4) TO xvar4 to result in 4 characters starting at the second position after the substitution.  File: ocfaq.info, Node: SUBSTITUTE-CASE, Next: FUNCTION SUM, Prev: SUBSTITUTE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.59 SUBSTITUTE-CASE ......................... Similar to SUBSTITUTE, but ignores upper and lower case of subject when matching patterns.  File: ocfaq.info, Node: FUNCTION SUM, Next: TAN, Prev: SUBSTITUTE-CASE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.60 FUNCTION SUM ......................  File: ocfaq.info, Node: TAN, Next: TEST-DATE-YYYYMMDD, Prev: FUNCTION SUM, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.61 TAN .............  File: ocfaq.info, Node: TEST-DATE-YYYYMMDD, Next: TEST-DAY-YYYYMMDD, Prev: TAN, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.62 TEST-DATE-YYYYMMDD ............................  File: ocfaq.info, Node: TEST-DAY-YYYYMMDD, Next: TRIM, Prev: TEST-DATE-YYYYMMDD, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.63 TEST-DAY-YYYYMMDD ...........................  File: ocfaq.info, Node: TRIM, Next: UPPER-CASE, Prev: TEST-DAY-YYYYMMDD, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.64 TRIM ..............  File: ocfaq.info, Node: UPPER-CASE, Next: VARIANCE, Prev: TRIM, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.65 UPPER-CASE .................... Returns a copy of the alphanumeric argument with any lower case letters replaced by upper case letters.  File: ocfaq.info, Node: VARIANCE, Next: WHEN-COMPILED, Prev: UPPER-CASE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.66 VARIANCE .................. Returns the variance of a series of numbers. The variance is defined as the square of the `STANDARD-DEVIATION`_ DISPLAY FUNCTION VARIANCE(1 2 3 4 5 6 7 8 9 100) END-DISPLAY. +818.250000000000000  File: ocfaq.info, Node: WHEN-COMPILED, Next: YEAR-TO-YYYY, Prev: VARIANCE, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.67 WHEN-COMPILED ....................... Returns a 21 character alphanumeric field of the form YYYYMMDDhhmmsscc |plusminus| zzzz e.g. 2008070505152000-0400 representing when a module or executable is compiled. The WHEN-COMPILED special register reflects when an object module was compiled program-id. whenpart1. procedure division. display "First part :" FUNCTION WHEN-COMPILED end-display. program-id. whenpart2. procedure division. display "Second part:" FUNCTION WHEN-COMPILED end-display. program-id. whenshow. procedure division. call "whenpart1" end-call. call "whenpart2" end-call. display "Main part :" FUNCTION WHEN-COMPILED end-display. $ cobc -c whenpart1.cob && sleep 15 && cobc -c whenpart2.cob && > sleep 15 && cobc -x whenshow.cob whenpart1.o whenpart2.o $ ./whenshow First part :2008082721391500-0400 Second part:2008082721393000-0400 Main part :2008082721394500-0400  File: ocfaq.info, Node: YEAR-TO-YYYY, Prev: WHEN-COMPILED, Up: Does OpenCOBOL implement any Intrinsic FUNCTIONs? 1.3.27.68 YEAR-TO-YYYY ...................... Converts a two digit year to a sliding window four digit year. The optional second argument (default 50) is added to the date at execution time to determine the ending year of a 100 year interval.  File: ocfaq.info, Node: Can you clarify the use of FUNCTION in OpenCOBOL?, Next: What is the difference between the LENGTH verb and FUNCTION LENGTH?, Prev: Does OpenCOBOL implement any Intrinsic FUNCTIONs?, Up: Using OpenCOBOL 1.3.28 Can you clarify the use of FUNCTION in OpenCOBOL? -------------------------------------------------------- Yes. This information is from [Roger]_, posted to the opencobol_ forums. Just to clarify the use of FUNCTION. (Applies to 0.33) FUNCTION (generally speaking, there are exceptions) can be used anywhere where a source item is valid. It always results in a new temporary field. This will have the desired characteristics dependant on the parameters. eg. FUNCTION MIN (x, y, z) with x PIC 99 y PIC 9(8) COMP z PIC 9(6)V99 will result in returning a field that has at least 8 positions before the (implied) decimal point and 2 after. It does NOT ever change the contents of parameters to the function. FUNCTION's are nestable. eg. DISPLAY FUNCTION REVERSE (FUNCTION UPPER-CASE (myfield)). One clarification to the above quote was pointed out by Roger. The line: be used anywhere where a source item is valid. should be: be used anywhere where a sending field is valid.  File: ocfaq.info, Node: What is the difference between the LENGTH verb and FUNCTION LENGTH?, Next: What STOCK CALL LIBRARY does OpenCOBOL offer?, Prev: Can you clarify the use of FUNCTION in OpenCOBOL?, Up: Using OpenCOBOL 1.3.29 What is the difference between the LENGTH verb and FUNCTION LENGTH? -------------------------------------------------------------------------- From [Roger]_: The standard only defines FUNCTION LENGTH. The LENGTH OF phrase is an extension (from MF)