User Tools

Site Tools


project:cobol:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
project:cobol:start [2016/11/25 07:36] – ↷ Page moved and renamed from project:cobol to project:cobol:start ruzaproject:cobol:start [2018/10/06 17:08] (current) – removed maxfx
Line 1: Line 1:
-====== COBOL ====== 
  
-{{template>infobox| 
-name=Cobol|image=cobol_report_apr60.jpg?200|sw=-|hw=-|founder=[[user:maxfx]]\\ [[user:malanius]] |interested=[[user:sachy]]\\ [[user:ruza]]|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. 
-COmmon Business Oriented Language (COBOL) is a programming language that resembles English. As its name suggests, COBOL is especially efficient for 
-processing business problems. It emphasizes describing and handling data items and input/output records; thus, COBOL is well adapted for managing large files of data. 
- 
- 
-====== COBOL Nowadays ===== 
-Cobol is said to be dead.  
- 
- 
-====== IBM COBOL, ILE COBOL ====== 
-IBM Cobol is for AS400 machine and for ZOS mainframe. 
-This is example code with call AS400 API for dump memmory in ILE COBOL. 
- 
-<code cobol> 
-       PROCESS OPTIONS NOMONOPRC NOSTDTRUNC.                                     
-       CONFIGURATION SECTION.                                                    
-       WORKING-STORAGE SECTION.                                                  
-           COPY DUMP_FULL.                                                       
-       77 BOOL-1 PIC 1 INDICATOR 61 VALUE B"0" USAGE IS DISPLAY.                 
-       01 BOOL-ARRAY.                                                            
-         08 BOOL-2 OCCURS 10 PIC 1 VALUE B"1"                                  
-                                                                                 
-       PROCEDURE DIVISION.                                                       
-       PAR.                                                                      
-                                                                                 
-           MOVE B"1" TO BOOL-1                                                   
-           MOVE B"0" TO BOOL-2(2)                                                
-                                                                                 
-           CALL LINKAGE IS PROCEDURE "QlnDumpCobol" USING                        
-                                      OMITTED, OMITTED,                          
-                                      OMITTED, PROGRAM-TYPE,                     
-                                      DUMP-TYPE, ERROR-CODE                      
-</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 ('1'                                                            
-                                                                                 
-/* Declaration variables */                                                      
-/* Loop control ( index loop ) with lenght 1 */                                  
-DCL &LoopCtl *int  len(4)                                                        
-DCL &LoopLml *int  len(4) value(5)                                               
-DCL &LoopNo  *char len(1)                                                        
-DCL &List    *lgl  value('1'                                                   
-                                                                                 
-/* If value True will 0, loop will end */                                        
-DoWhile Cond(&True)                                                              
-    SndPgmMsg Msg('Value is true' ) TopGmq(*PRV)                                 
-    Chgvar &True ('0'                                                          
-EndDo                                                                            
-                                                                                 
-DoFor Var(&LoopCtl) From(1) To(&LoopLml) By(1)                                   
-   Chgvar &LoopNo &LoopCtl                                                       
-   SndPgmMsg Msg('Loop = ' *BCAT &LoopNo) TopGmq(*PRV)                           
-EndDo                                                                            
-                                                                                 
-                                                                                 
-Top: DoWhile cond(&List)                                                         
-        SndMsg Msg('Hello World1') ToUsr(*REQUESTER)                             
-                                                                                 
-        Middle: DoUntil Cond(*Not &List)                                         
-                   SndMsg Msg('Hello World2') ToUsr(*REQUESTER)                  
-                                                                                 
-                   Inner: DoWhile Cond(&List)                                    
-                             Leave cmdlbl(Top)                                   
-                                                                                 
-                          EndDo /* End loop , Inner */                           
-                EndDo /* End loop, Middle */                                     
-     EndDo /* End loop, Top */                                                   
-                                                                                 
-                                                                                 
-                                                                                 
-ENDPGM /* End program */      
-</code> 
- 
-More information on : 
- 
-[[https://en.wikipedia.org/wiki/IBM_i_Control_Language]] 
- 
-[[https://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c415721506.htm]] 
- 
- 
- 
-====== OpenCOBOL (GNUCOBOL) ====== 
-Open source variant and crossplatform cobol for PC. 
-This is example in OpenCOBOL on PC. Program shows date and time. 
-<code cobol> 
-      ****************************************************************** 
-      * Author: Maxfx 
-      * Date: 13/10/2016 
-      ****************************************************************** 
-       IDENTIFICATION DIVISION. 
-       PROGRAM-ID. DATE-AND-TIME. 
-       DATA DIVISION. 
-       FILE SECTION. 
-       WORKING-STORAGE SECTION. 
-           01 W-T PIC S9(8). 
-           01 W-D PIC S9(8). 
-           01 W-BATCH-COMPLET PIC X(16). 
-           01 W-BATCH-TEST PIC X(16). 
-           01 W-BATCH. 
-              03 W-DATE PIC X(8). 
-              03 W-TIME PIC X(8). 
- 
- 
-       PROCEDURE DIVISION. 
-       MAIN-PROCEDURE. 
-            ACCEPT W-TIME OF W-BATCH FROM TIME. 
-            ACCEPT W-DATE OF W-BATCH FROM DATE YYYYMMDD. 
-            DISPLAY W-TIME OF W-BATCH. 
-            DISPLAY W-DATE OF W-BATCH. 
-            DISPLAY "STRUCT : " W-BATCH. 
- 
-            STRING W-DATE OF W-BATCH DELIMITED BY SPACE 
-            W-TIME OF W-BATCH DELIMITED BY SPACE 
-              INTO W-BATCH-COMPLET 
-            END-STRING. 
- 
-            MOVE W-BATCH TO W-BATCH-TEST. 
- 
-            DISPLAY "COMPLET : " W-BATCH-COMPLET. 
-            DISPLAY "TEST : " W-BATCH-TEST 
- 
-            STOP RUN. 
-       END PROGRAM DATE-AND-TIME. 
-</code> 
- 
-====== IDE OpenCOBOL (GNUCOBOL) ====== 
-[[https://opencobolide.readthedocs.io/en/latest/download.html]] 
- 
- 
-====== More Examples ====== 
-More code examples for [[https://github.com/Martinfx/Cobol]] 
project/cobol/start.1480059360.txt.gz · Last modified: 2016/11/25 07:36 by ruza