project:cobol:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
project:cobol [2016/11/24 21:33] – [OPENCOBOL] maxfx | project:cobol:start [2018/05/04 08:02] – ruza | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== COBOL ====== | ====== COBOL ====== | ||
- | {{template> | + | {{template> |
- | name=Cobol|image=cobol_report_apr60.jpg? | + | name=Cobol|image=cobol_report_apr60.jpg? |
+ | ~~META: | ||
+ | status = active | ||
+ | & | ||
+ | ~~ | ||
On May 28 and 29 of 1959 (exactly one year after the Zürich ALGOL 58 meeting), a meeting was held at the Pentagon to discuss the creation of a common programming language for business. It was attended by 41 people and was chaired by Phillips.The Department of Defense was concerned about whether it could run the same data processing programs on different computers. FORTRAN, the only mainstream language at the time, lacked the features needed to write such programs. | On May 28 and 29 of 1959 (exactly one year after the Zürich ALGOL 58 meeting), a meeting was held at the Pentagon to discuss the creation of a common programming language for business. It was attended by 41 people and was chaired by Phillips.The Department of Defense was concerned about whether it could run the same data processing programs on different computers. FORTRAN, the only mainstream language at the time, lacked the features needed to write such programs. | ||
Line 16: | Line 20: | ||
====== IBM COBOL, ILE COBOL ====== | ====== IBM COBOL, ILE COBOL ====== | ||
IBM Cobol is for AS400 machine and for ZOS mainframe. | IBM Cobol is for AS400 machine and for ZOS mainframe. | ||
- | This is example code with call AS400 API for dump memmory | + | |
- | < | + | |
+ | Example in ILE COBOL and call FUNCTION API which return the current date. | ||
+ | <code cobol> | ||
+ | 01 WS-CURRENT-DATE-DATA. | ||
+ | 05 WS-CURRENT-DATE. | ||
+ | 10 WS-CURRENT-YEAR | ||
+ | 10 WS-CURRENT-MONTH | ||
+ | 10 WS-CURRENT-DAY | ||
+ | 05 WS-CURRENT-TIME. | ||
+ | 10 WS-CURRENT-HOURS | ||
+ | 10 WS-CURRENT-MINUTE | ||
+ | 10 WS-CURRENT-SECOND | ||
+ | 10 WS-CURRENT-MILLISECONDS PIC 9(02). | ||
+ | |||
+ | | ||
+ | | ||
+ | MOVE FUNCTION CURRENT-DATE to WS-CURRENT-DATE-DATA | ||
+ | | ||
+ | </ | ||
+ | |||
+ | This is example code with call AS400 API for dump memory | ||
+ | < | ||
| | ||
| | ||
Line 37: | Line 62: | ||
DUMP-TYPE, ERROR-CODE | DUMP-TYPE, ERROR-CODE | ||
</ | </ | ||
+ | |||
+ | |||
+ | ====== IBM CL, ILE CL ===== | ||
+ | Programming control language CL is like script language on AS400. Programs in language CL call for processing programs in COBOL on AS400. | ||
+ | |||
+ | <code cl> | ||
+ | PGM /* Begin program */ | ||
+ | | ||
+ | /* Set flag to true */ | ||
+ | DCL &True *lgl (' | ||
+ | | ||
+ | /* Declaration variables */ | ||
+ | /* Loop control ( index loop ) with lenght 1 */ | ||
+ | DCL & | ||
+ | DCL & | ||
+ | DCL & | ||
+ | DCL & | ||
+ | | ||
+ | /* If value True will 0, loop will end */ | ||
+ | DoWhile Cond(& | ||
+ | SndPgmMsg Msg(' | ||
+ | Chgvar &True (' | ||
+ | EndDo | ||
+ | | ||
+ | DoFor Var(& | ||
+ | | ||
+ | | ||
+ | EndDo | ||
+ | | ||
+ | | ||
+ | Top: DoWhile cond(& | ||
+ | SndMsg Msg(' | ||
+ | | ||
+ | Middle: DoUntil Cond(*Not & | ||
+ | | ||
+ | | ||
+ | | ||
+ | Leave cmdlbl(Top) | ||
+ | | ||
+ | EndDo /* End loop , Inner */ | ||
+ | EndDo /* End loop, Middle */ | ||
+ | EndDo /* End loop, Top */ | ||
+ | | ||
+ | | ||
+ | | ||
+ | ENDPGM /* End program */ | ||
+ | </ | ||
+ | |||
+ | More information on : | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | |||
====== OpenCOBOL (GNUCOBOL) ====== | ====== OpenCOBOL (GNUCOBOL) ====== | ||
Open source variant and crossplatform cobol for PC. | Open source variant and crossplatform cobol for PC. | ||
- | This is example in OpenCOBOL on PC. Program shows date and time. | + | This is an example in OpenCOBOL on PC. Program shows date and time. |
- | < | + | < |
****************************************************************** | ****************************************************************** | ||
* Author: Maxfx | * Author: Maxfx | ||
Line 81: | Line 161: | ||
END PROGRAM DATE-AND-TIME. | END PROGRAM DATE-AND-TIME. | ||
</ | </ | ||
+ | |||
+ | ====== IDE OpenCOBOL (GNUCOBOL) ====== | ||
+ | [[https:// | ||
+ | |||
+ | |||
+ | ====== More Examples ====== | ||
+ | More code examples for [[https:// | ||
+ | |||
+ | Slides from our actions [[https:// |