{"id":6517,"date":"2015-12-29T20:01:22","date_gmt":"2015-12-29T19:01:22","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=6517"},"modified":"2021-11-22T17:14:21","modified_gmt":"2021-11-22T16:14:21","slug":"raspberry-pi-cobol-in-5-minuten-installieren-oder-back-to-the-future","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=6517","title":{"rendered":"Raspberry Pi: COBOL in 5 Minuten installieren oder &#8222;Back to the Future&#8220;"},"content":{"rendered":"<p>Mal was anderes als Java. Die Programmiersprache <a href=\"https:\/\/de.wikipedia.org\/wiki\/COBOL\" target=\"_blank\" rel=\"noopener\">COBOL<\/a> l\u00e4uft auch auf dem Raspberry Pi. Es gibt eine kostenlose Version, <a href=\"https:\/\/en.wikipedia.org\/wiki\/GnuCOBOL\" target=\"_blank\" rel=\"noopener\">GnuCobol<\/a> das in 5 Minuten installiert werden kann. <\/p>\n<pre class=\"lang:default decode:true \" >\r\nsudo apt-get update\r\nsudo apt-get upgrade\r\nsudo apt-get install open-cobol<\/pre>\n<p>Es wird die Version 1.1.0 von GnuCobol (<a href=\"http:\/\/kleinhirn.eu\/2016\/01\/03\/opencobol\/\" target=\"_blank\" rel=\"noopener\">OpenCobol<\/a>) installiert. Dass kann man leicht auf der Konsole testen mit:<\/p>\n<pre class=\"lang:default decode:true \" >cobc -V<\/pre>\n<p>So, nun wollen wir wie \u00fcblich erst einmal ein erstes COBOL Programm compilieren. Dazu erstellen wir die <strong>hello.cob<\/strong> Datei mit diesem Inhalt:<\/p>\n<pre class=\"lang:default decode:true \" >000100* hallo.cob GnuCobol Beispiel\r\n000200 IDENTIFICATION DIVISION.\r\n000300 PROGRAM-ID. hallo.\r\n000400 PROCEDURE DIVISION.\r\n000500     DISPLAY \"Hallo Welt\".\r\n000600     STOP RUN.<\/pre>\n<p> <!--more--><\/p>\n<p>Dies COBOL Datei compilieren wir mit diesem Aufruf:<\/p>\n<pre class=\"lang:default decode:true \" >cobc -x hallo.cob<\/pre>\n<p>Nach ein paar Sekunden ist die Datei compiliert. Die <strong>hallo<\/strong> Datei liegt nun im gleichen Verzeichnis und kann nun wie folgt ausgef\u00fchrt werden:<\/p>\n<pre class=\"lang:default decode:true \" >.\/hallo<\/pre>\n<p>Wir erhalten das programmierte Ergebnis:<\/p>\n<pre class=\"lang:default decode:true \" >Hallo Welt<\/pre>\n<p>Weitere Optionen des Cobol-Compilers gibt es mit <strong>cobc -h<\/strong><\/p>\n<pre class=\"lang:default decode:true \" >\r\n\r\nUsage: cobc [options] file...\r\n\r\nOptions:\r\n  --help                Display this message\r\n  --version, -V         Display compiler version\r\n  -v                    Display the programs invoked by the compiler\r\n  -x                    Build an executable program\r\n  -m                    Build a dynamically loadable module (default)\r\n  -std=&lt;dialect&gt;        Compile for a specific dialect :\r\n                          cobol2002   Cobol 2002\r\n                          cobol85     Cobol 85\r\n                          ibm         IBM Compatible\r\n                          mvs         MVS Compatible\r\n                          bs2000      BS2000 Compatible\r\n                          mf          Micro Focus Compatible\r\n                          default     When not specified\r\n                        See config\/default.conf and config\/*.conf\r\n  -free                 Use free source format\r\n  -fixed                Use fixed source format (default)\r\n  -O, -O2, -Os          Enable optimization\r\n  -g                    Produce debugging information in the output\r\n  -debug                Enable all run-time error checking\r\n  -o &lt;file&gt;             Place the output into &lt;file&gt;\r\n  -b                    Combine all input files into a single\r\n                        dynamically loadable module\r\n  -E                    Preprocess only; do not compile, assemble or link\r\n  -C                    Translation only; convert COBOL to C\r\n  -S                    Compile only; output assembly file\r\n  -c                    Compile and assemble, but do not link\r\n  -t &lt;file&gt;             Generate and place a program listing into &lt;file&gt;\r\n  -I &lt;directory&gt;        Add &lt;directory&gt; to copy\/include search path\r\n  -L &lt;directory&gt;        Add &lt;directory&gt; to library search path\r\n  -l &lt;lib&gt;              Link the library &lt;lib&gt;\r\n  -D &lt;define&gt;           Pass &lt;define&gt; to the C compiler\r\n  -conf=&lt;file&gt;          User defined dialect configuration - See -std=\r\n  --list-reserved       Display reserved words\r\n  --list-intrinsics     Display intrinsic functions\r\n  --list-mnemonics      Display mnemonic names\r\n  -save-temps(=&lt;dir&gt;)   Save intermediate files (default current directory)\r\n  -MT &lt;target&gt;          Set target file used in dependency list\r\n  -MF &lt;file&gt;            Place dependency list into &lt;file&gt;\r\n  -ext &lt;extension&gt;      Add default file extension\r\n\r\n  -W                    Enable ALL warnings\r\n  -Wall                 Enable all warnings except as noted below\r\n  -Wobsolete            Warn if obsolete features are used\r\n  -Warchaic             Warn if archaic features are used\r\n  -Wredefinition        Warn incompatible redefinition of data items\r\n  -Wconstant            Warn inconsistent constant\r\n  -Wparentheses         Warn lack of parentheses around AND within OR\r\n  -Wstrict-typing       Warn type mismatch strictly\r\n  -Wimplicit-define     Warn implicitly defined data items\r\n  -Wcall-params         Warn non 01\/77 items for CALL params (NOT set with -Wall)\r\n  -Wcolumn-overflow     Warn text after column 72, FIXED format (NOT set with -Wall)\r\n  -Wterminator          Warn lack of scope terminator END-XXX (NOT set with -Wall)\r\n  -Wtruncate            Warn possible field truncation (NOT set with -Wall)\r\n  -Wlinkage             Warn dangling LINKAGE items (NOT set with -Wall)\r\n  -Wunreachable         Warn unreachable statements (NOT set with -Wall)\r\n\r\n  -ftrace               Generate trace code (Executed SECTION\/PARAGRAPH)\r\n  -ftraceall            Generate trace code (Executed SECTION\/PARAGRAPH\/STATEMENTS)\r\n  -fsyntax-only         Syntax error checking only; don't emit any output\r\n  -fdebugging-line      Enable debugging lines ('D' in indicator column)\r\n  -fsource-location     Generate source location code (Turned on by -debug or -g)\r\n  -fimplicit-init       Do automatic initialization of the Cobol runtime system\r\n  -fsign-ascii          Numeric display sign ASCII (Default on ASCII machines)\r\n  -fsign-ebcdic         Numeric display sign EBCDIC (Default on EBCDIC machines)\r\n  -fstack-check         PERFORM stack checking (Turned on by -debug or -g)\r\n  -ffold-copy-lower     Fold COPY subject to lower case (Default no transformation)\r\n  -ffold-copy-upper     Fold COPY subject to upper case (Default no transformation)\r\n  -fnotrunc             Do not truncate binary fields according to PICTURE\r\n  -ffunctions-all       Allow use of intrinsic functions without FUNCTION keyword\r\n  -fmfcomment           '*' or '\/' in column 1 treated as comment (FIXED only)\r\n  -fnull-param          Pass extra NULL terminating pointers on CALL statements<\/pre>\n<p>Eine kleine Mindmap zu COBOL gibt es <a href=\"http:\/\/kleinhirn.eu\/2015\/12\/29\/cobol\/\" target=\"_blank\" rel=\"noopener\">hier<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mal was anderes als Java. Die Programmiersprache COBOL l\u00e4uft auch auf dem Raspberry Pi. Es gibt eine kostenlose Version, GnuCobol das in 5 Minuten installiert werden kann. sudo apt-get update sudo apt-get upgrade sudo apt-get install open-cobol Es wird die Version 1.1.0 von GnuCobol (OpenCobol) installiert. Dass kann man leicht auf der Konsole testen mit: &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=6517\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eRaspberry Pi: COBOL in 5 Minuten installieren oder &#8222;Back to the Future&#8220;\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[220,79,1023],"tags":[2369,2368,2370,2372,2371],"class_list":["post-6517","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-programmierung","category-raspberry-pi","tag-back-to-the-future","tag-cobol","tag-compiler","tag-gnucobol","tag-open-cobol"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/6517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6517"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/6517\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6517"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}