Home

kobol manual

image

Contents

1. ISO 0 diaAll I O CONTROL 0 diaAll 7 IDENTIFICATION 0 diaAll r TEE 1 diaAll MN 0 diaAll INDEX 0 diaAll P INDEXED 0 diaAll y INDICATE 0 diaAll F INHERITS 0 diaCobol2000 TNITIAL 0 diaAll A INITIALIZE 1 diaAll A INITIATE 1 diaAll 7 INPUT 0 diaAll f INPUT OUTPUT 0 diaAll INSPECT 1 diaAll 7 INTEGER 0 diaCobol2000 INTERFACE 0 diaCobol2000 TNTERFACE ID 0 diaCobol2000 INTO 0 diaAll INTRINSIC 0 diaCobol3000 INVALID 0 diaAll INVOKE 0 diaCobol2000 LES 0 diaAll JUST 0 diaAll JUSTIFIED 0 diaAll F EELT 0 diaAll LABEL 0 diaCobol85 diaCobol3000 LAST 0 diaAll LEADING 0 diaAll M pupu 0 diaAll LENGTH 0 diaAll j LESS 0 diaAll LIMIT 0 diaAll j LIMITS 0 diaAll i LINAGE 0 diaAll n LINAGE COUNTER 0 diaAll y LINE 0 diaAll LINE COUNTER 0 diaAll LINES 0 diaAll y LINKAGE 0 diaAll F LOCAL STORAGE 0 diaCobol2000 LOCK 1 diaAll LOW VALUE 0 diaAll P LOW VALUES 0 diaAll MERGE 1 diaAll MESSAGE 0 diaAll METHOD 0 diaCobol2000 METHOD ID 0 diaCobol2000 MODE 0 diaAll MORE LABELS 0 diaCobol3000 MOVE 1 diaAll MULTIPLY 1 diaAll y NATIONAL 0 diaCobol2000 NATIONAL EDITED
2. 0 diaCobo12000 j NATIVE 0 diaAll 7 NEGATIVE 0 diaAll A NESTED 0 diaCobol2000 NEXT 1 diaAll NO 0 diaAll NOLIST 0 diaCobol3000 NOT 0 diaAll A NULL 0 diaCobol2000 NUMBER 0 diaAll 7 NUMERIC NUMERIC EDITI OBJECT OBJECT COMPUTI OCCURS OF A OFF OMITTED ON A OPEN OPTIONAL OPTIONS OR ORDER ORGANIZATION OTHER OUTPUT OVERFLOW OVERRIDE PACKED DECIMAL PADDING PAGE PAGE COUNTER PERFORM PF PH HPI PICTURE PLUS POINTER POSITION POSITIVE PRESENT PRINTING PROCEDURE PROCEDURES PROCESSING PROGRAM PROGRAM 1D PROGRAM POINT PROPERTY PROTOTYPE PURGE QUEUE 3 QUOTE y QUOTES 7 RAISE RAISING RANDOM RD READ RECEIVE RECORD RECORDING RECORDS REDEFINES a R R R R R EEL A EFERENCE EF ERENCES ELATIVE ELEASE EMAINDER EMOVAL X S S S S S S S S X X S lt gt X lt X gt Y x x
3. button the cursor jumps to the first non space symbol in the line and then with the second pressing the cursor jumps to the beginning of the line Wrap cursor If you have a long line the text will automatically go to the next line Replace tabs Sometimes it is better to uses an actual space instead of a tab to indent code this option will go through and replace the tabs with a specified number of spaces Remove Trailing Spacers This will eliminate embedded spaces at the end of the document Margins Indicator Margin Not currently used but a future release will be used to indicate code folding bookmarks and more Selection Margin Allows you to select a range or area more flexibly than would otherwise be possible Word completion can be a big time saver when working on extensive document It is very simple to use while typing just press Ctrl Space and you receive a popup menu that contains all word that you already have entered in the text that match the symbols currently entered Just select what you want and press Enter General Tips Try to use Select Assign Using to avoid hard coding file names in your program This allows you to specify input and output file names on the command line at execution time The Accept From command line contains system data in addition to what is passed make sure you parse it correctly Be sure to check your file status after opening a file to see if it exists If it does not your progr
4. diaAll COPY 0 diaAll CORR 0 diaAll CORRESPONDING 0 diaAll COUNT 0 diaAll TERT 0 diaCobol CURRENCY 0 diaAll CURRENT DATE 0 diaCobol CURSOR 0 diaCobol DATA 0 diaAll DATE 0 diaAll DAY 0 diaAll DAY OF WEEK 0 diaAll DE 0 diaAll DEBUGGING 0 diaAll DECIMAL POINT 0 diaAll DECLARATIVES 0 diaAll DEFAULT 0 diaCobol DELETE 1 diaAll DELIMITED 0 diaAll DELIMITER 0 diaAll DEPENDING 0 diaAll DESCENDING 0 diaAll DESTINATION 0 diaAll DETAIL 0 diaAll DISABLE 1 diaAll DISPLAY 1 diaAll DIVIDE 1 diaAll DIVISION 0 diaAll DOWN O diaAll DUPLICATES 0 diaAll DYNAMIC 0 diaAll EGI 0 diaAll ELSE 0 diaAll EMI 0 diaAll ENABLE 1 diaAll END 0 diaAll END ACCEPT 0 diaAll END ADD 0 diaAll END CALL 0 diaAll END COMPUTE 0 diaAll END DELETE 0 diaAll END DISPLAY 0 diaAll END DIVIDE 0 diaAll r END EVALUATE 0 diaAll y END IF 0 diaAll END MULTIPLY 0 diaAll P END OF PAGE 0 diaAll y END PERFORM 0 diaAll fi END READ 0 diaAll E END RECEIVE 0 diaAll 7 END RETURN 0 diaAll END REWRITE 0 diaAll p END SEARCH 0 di
5. display Unix 08 font 9x15bold You can also add the name of file to open in Kobol kobol myfile cob Then kobol will start up and load the file into the editor immediately You can use open with kobol in windows by right clicking on Cobol files Kobol uses various external programs to provide specific features rapidly Specifically we use cobmake and cob2gcc for compiling Cobmake creates a Makefile from your project file created in the Kobol IDE Cob2gcc is the code translator that will generate C sources from your COBOL code The final step will use the make command to build your application Kobol comes with both cobmake and cob2gcc integrated with the IDE so you don t really need to worry about them 3 Getting Started Kobol has a standard and intuitive style interface with toolbars menus and tabbed windows for accessing various sub functions quickly On the left side of the main window you will see a tabbar that has various elements such as Project Files Docs The tab bar allows you quick navigation within the work space The main window is occupied by the editor W Kobol c program files kobol example src main cob CEB File Edit Search View Project Build Options Help Bo HG ERA x G E 3 Y P o P BAD Workspace Libs Example F main cob myLib display cob myDLL display cob 0 IDENTIFICATION DIVISION PROGRAM ID MAIN AUTHOR Oleksandr Yakovlyev INSTALLATION Basic ka display cob DATE WRITTEN Novem
6. popular with our customers 1 Build the project and workspace 2 Build the directory structure 3 Copying the source files into the folder via Explorer 4 Add the files to the folder via Add files to folder option 5 Save and close the workspace 6 Delete the bookmark on the project page 7 Open the kob file directly s O bs E O ymyDLL display cc display h hedisplay o Ll SymyLib display cc display h L display o e O sre i main cc P L debugger i eyample cob libmyDLL dl libs i ie mpDLL S E myLib i ibmyLib a i main exe Select All 5 Additional Features Kobol also has very basic CVS support which will continued to be enhanced in the future Now you can update or commit changes of the entire project directory by selecting Project gt Update Commit Project This feature will save changes in your files and run the cvs command The command will output all messages in the Message window and there you can see which files were modified or which files are updated from other developers You can also update commit for one file by selecting Project gt Update Commit or use Project Panel by right mouse clicking Note that using cvs commands for a folder will updates all files and directories recursively inside the folder As previously mentioned basic CVS support has been added to Kobol Soon we will be adding features such as log browsing merging and resolving confl
7. ASCII data No record delimiters are added at all The file simply consists of a set of records all with the same length and this length is defined by the program that accesses the file ORGANIZATION LINE SEQUENTIAL is also supported and uses new line characters as record separators 14 FILE STATUS Codes A program compiled using the Kobol compiler can get the following FILE STATUS codes 00 Succesfull completion 05 Optional file not present An OPEN statement is successfully executed but the file is described as optional and the physical file is not present at the time the OPEN statement is executed If the open mode is I O or extend the physical file has been created 10 Atend A sequential read is attempted and no record is available NEXT was specified or implied and the end of the file has been reached or a sequential READ statement is attempted for the first time on a file described as OPTIONAL and the file is not present 22 Duplicate key A WRITE or REWRITE is attempted that would create a duplicate key where no such duplicate is allowed 23 Invalid key A START or READ statement attempts to access a record identified by a key and the record is not present 24 Boundary violation An attempt is made to write beyond the externally defined boundaries of a physical relative or indexed file 34 Boundary violation An attempt is made to write beyond the externally defined boundaries of a physical sequential file
8. File Name Workspace Directory Tree 4 C Documents and Settings Administrator i Cy blackadder java amp Ddethera l CodeByDesign Desktop Sy Favorites EM y Documents CpPsiData H E Start Menu WINDOWS In line edit Project File Name you must enter the file name of a project file The file name must have the extension kob For example my project kob Once you ve done this click on OK and your project will then be opened in the Project Panel where you can start adding files The terms Project and Workspace are currently used interchangeably At some future point a Workspace can be thought of as a meta Project in other words a Workspace will contain multiple projects To add files to a project you can right click on the projects folder in the Project Panel and select Add files to folders This will open up a dialog that allows you to select what files you want to add If you select a different directory for the files to include then they will be copied into your work directory You can create a new folder inside a project by selecting the New Folder option Simply enter the folder name and click on Ok This will create the directory on your disk at the same time The next feature is available from the menu Project gt Add new files note that the option Project gt Add existing file 1s the same as the right click in the project tree When you add a new file Kobol
9. gt DOH DD DD DD DOO ft ft OD DD DOD OH DD DD OO DO O DD DD O O DD DOO H DO OD OD ODO ODO OO OD DOO FH RD ODO OO DO DO O o diaAll diaAll diaCobol diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaAll diaAll diaCobol diaAll diaAll diaCobol diaCobol diaCobol diaAll diaAll diaAll diaAll diaCobol diaCobol diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll ENAMES EPLACE EPLACING EPORT EPORTING EPORTS EPOSITORY ESERVE ESE Tavs UME Wa TRY TURN TURNING WIND WRITE 3 E zJ ki Ej Ej Fi 3 J J rJ rJ rJ rJ J J J J J tJ rJ IHO m V n SPACES SPECIAL NAMES STANDARD STANDARD 1 STANDARD 2 STANDARD 3 START STATUS STOP STRING SUB QUEUE 1 SUB QUEUE 2 SUB QUEUE 3 S
10. to do is retrieve the contents of the system variable QUERY STRING that will contain the name data pairs that get submitted from the web page form The URL will look something like http gonzo ukrweb net cgi bin test cgi namel valuel amp name2 value2 Where the relevant part that gets posted to QUERY_STRING is namel valuel name2 value2 name is the name of the variable and value is the actual contents of the variable Here is a short example that will get the contents of QUERY STRING and then parse the results into a table WORKING STORAGE SECTION 01 M1 PIC s9 4 COMP VALUE 0 01 M2 PIC S9 4 COMP VALUE 0 01 INPUT BUFFER PIC X 80 VALUE SPACES 01 INPUT TABLE 03 IPT PIC X 30 OCCURS 10 01 NAME TABLE 03 NT ENTRY PIC X 10 OCCURS 20 01 VALUE TABLE 03 VT ENTRY PIC X 10 OCCURS 20 PROCEDURE DIVISION indicate what environment variable you want to access display QUERY STRING upon environment name get the value for the indicated environment variable accept INPUT BUFFER from environment value MOVE SPACES TO NAME TABLE VALUE TABLE INPUT TABLE assume INPUT BUFFER looks like x namel valuel amp name2 value2 amp name3 value3 amp name4 value4 INSPECT INPUT BUFFER TALLYING Ml FOR ALL amp ADD 1 TO MI UNSTRING INPUT BUFFER DELIMITED BY amp INTO IPT 1 IPT 2 I
11. to provide for MPE HP3000 support What the latter one does is provide support for the HP extensions to the COBOL language such as macros pseudo intrinsics and system intrinsics Please note for the system intrinsics we do not provide an intrinsic emulation library just the stubs so it can work with a 3 party library When you install a plug in 1t will either add the functionality to the IDE if appropriate or open up the feature to the compiler so that it can be used The installation goes very quickly and will seem as though almost nothing happened In some cases with the HP3000 plug in you might have to force the plug in directory which can be done using the p switch to cob2c and giving the specific path where the plug in got installed 16 Support In general we will do our best to support you free of charge should your needs go beyond our freely available services then send to support thekompany com Bugs take priority over features and we will address them as quickly as possible We have a mail list for Kobol customers set up If you purchased from our web site you would have received Information on it already if you purchased from another source then you will need to register your product so that you can join the mail list The mail list is called kobol thekompany com Our web site has product information available as well if this document doesn t answer your questions Please see www thekompany com products kobol You can also
12. y AREAS 0 diaAll as O diaCobol2000 ASCENDING 0 diaAll rp ASSIGN 0 diaAll AT 0 diaAll B AND 0 diaCobol2000 B NOT 0 diaCobol2000 B OR 0 diaCobol2000 B XOR 0 diaCobol2000 BEFORE 0 diaAll BEGINNING 0 diaCobo13000 f BINARY 0 diaAll r BINARY CHAR 0 diaCobol2000 f BINARY DOUBLE 0 diaCobol2000 f BINARY LONG 0 diaCobol2000 a BINARY SHORT 0 diaCobol2000 i BLE 0 diaCobol2000 BLANK 0 diaAll i BLOCK 0 diaAll j BOOLEAN O diaCobol2000 BOTTOM 0 diaAll f MBSA 0 diaAll CALL 1 diaAll CALL CONVENTION 0 diaCobol2000 CANCEL 1 diaAll CD 0 diaAll CR 0 diaAll GH 0 diaAll CHARACTER 0 diaAll E CHARACTERS 0 diaAll n CLASS 0 diaAll CLASS ID 0 diaCobol CLOSE 1 diaAll CODE 0 diaAll CODE SET 0 diaAll CO 0 diaCobol COLLATING 0 diaAll COES 0 diaCobol COLUMN 0 diaAll COLUMNS 0 diaCobol COMMA 0 diaAll COMMON 0 diaAll COMMUNICATION 0 diaAll COMP 0 diaAll COMPUTATIONAL 0 diaAll COMPUTE 1 diaAll CONFIGURATION 0 diaAll CONSTANT 0 diaCobol CONTAINS 0 diaAll CONTENT 0 diaAll CONTINUE 1 diaAll CONTROL 1 diaAll CONTROLS 0 diaAll CONVERTING 0
13. 35 File not found An OPEN statement with the INPUT I O or EXTEND phrase is attempted on a file that is not described as optional and the physical file is not present 37 Invalid open mode An OPEN statement is attempted on a file and that file will not support the open mode specified in the OPEN statement 41 File already open An OPEN statement is attempted for a file that is already open 42 File not open A CLOSE statement is attempted for a file that is not opened 43 No valid record A DELETE or REWRITE statement on a file in sequential access mode was not preceded by a successful READ statement 46 No valid record A sequential READ statement is attempted on a file open in INPUT or I O mode and no valid next record has been established because the preceding START or READ statement referencing that file was unsuccessful 47 File not open for input The execution of a READ or START statement is attempted on a file that is not open in INPUT or I O mode 48 File not open for output The execution of a WRITE statement is attempted on a file that is not open in I O EXTEND or OUTPUT mode 49 File not open for I O The execution of a DELETE or REWRITE statement is attempted on a file that is not open in I O mode 15 Plug Ins Over time we will release additional functionality to Kobol via optional plug ins Currently we have two of these they are the debugger that provides for a source debugger interface the second is
14. Kobol 1 4 0 User Manual Copyright 2002 2006 theKompany com Table of Contents 1 Introduction 2 Requirements and Installation 3 Getting Started 4 Your First Program 5 Additional Features 6 Copylibs and SINCLUDE files 7 Accessing Command Line Arguments 8 Binary Integer Data Types 9 Distributing Binaries 10 Working Without The IDE 11 Writing CGI Applications 12 Calling non COBOL sub programs 13 SELECT ASSIGN 14 FILE STATUS Codes 15 Plug Ins 16 Support 17 Credits Appendix A 21 24 25 27 28 29 30 1 Introduction Kobol is unique in the world of COBOL development systems Kobol will generate a true executable with no run time requirements other than its support libraries Kobol has a sophisticated IDE that contains extensive project management capability with integrated CVS support for revision management syntax highlighting an optional debugger and integrated syntax reference manual The application is very straight forward to use with a low learning curve This manual is arranged in a fashion to make it as quick and easy as possible to get started with Kobol When you purchased Kobol you received versions for both Windows and Linux This chapter will explain how to install Kobol and its various subsystems If you re reading this document you should already have Kobol but if you don t you can download a demo or purchase a copy at http www thekom
15. PT 3 IPT 4 PERFORM VARYING M2 FROM 1 BY UNSTRING IPT M2 1 UNTIL M2 gt M1 DELIMITED BY INTO END PERFORM NT ENTRY M2 DISPLAY Name Token DISPLAY Value Token VT ENTRY M2 NT ENTRY M2 VT ENTRY M2 12 Calling non COBOL sub programs Calling non cobol sub programs The CALL statement is used to call a sub program whether it is written in COBOL or not By default the Kobol compiler will assume that a called sub program is written in COBOL and generate code according to this assumption When calling a non cobol sub program the calling sequence may not be compatible with what Kobol assumes The programmer must inform the compiler about the correct calling sequence The calling sequence for a sub program is expressed as a prototype The prototype has the following format name parameter_type parameter_type The name is the external function name with appropriate capitalization Each parameter type is a C style parameter type declaration This type declaration shall not contain any parentheses or commas itself The type declaration shall not contain a parameter name this implies that arrays should be expressed as pointers and that pointers to functions are not supported The Kobol compiler will not verify the parameter types for correctness Some examples of prototypes for well know functions int system const char void memcpy void const vo
16. UBTRACT SUM SUPER SUPPRESS SYMBOLIC SYNC X S S S X X X X gt gt gt gt gt x gt DOH DD HO DOH H O FH DD DD DD DD DD OH DD OH DD DO HOOD DD DO HD DO HO DD OH DO OH OD OH DD OD DD O o diaAll diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaCobol diaCobol diaCobol diaAll diaCobol diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaAll diaAll diaCobol diaAll diaAll diaCobol diaAll diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaAll diaCobol diaAll diaAll diaAll L2000 L2000 L2000 L2000 L2000 SYNCHRONIZED 0 diaAll SYSTEM DEFAULT 0 diaCobol TABLE 0 diaCobol TALLY 0 diaCobol TALLYING 0 diaAll TERMINAL 0 diaAll TERMINATE 1 diaAll TEST y 0 diaAll TEXT 0 diaAll THAN 0 diaAll THEN 0 diaAll THROUGH 0 diaAll PERU 0 diaAll TIME 0 diaAll TIME OF DAY 0 diaCobol TIMES 0 diaAll muro 0 diaAll TOP 0 diaAll TRAILING 0 diaAll TRUE 0 diaAll TYPE 0 diaAll TYPEDEF 0 diaCobol UN EXCLUSIVE 0 diaCobol UNIT 0 diaAll UNIVERSAL 0 di
17. aAll f END START 0 diaAll i END STRING 0 diaAll y END SUBTRACT 0 diaAll F END UNSTRING 0 diaAll END WRITE 0 diaAll P ENDING O diaCobol3000 ENTRY 1 diaCobol3000 ENVIRONMENT 0 diaAll F EOP 0 diaAll EQUAL 0 diaAll ERROR 0 diaAll 7 ESI 0 diaAll fi EVALUATE 1 diaAll EXCEPTION 0 diaAll fi EXCEPTION OBJECT 0 diaCobol2000 EXCLUSIVE 0 diaCobol3000 EXIT 1 diaAll EXTEND 0 diaAll y EXTERNAL 0 diaAll 7 FACTORY 0 diaAll j FALSE 0 diaAll i WED 0 diaAll FILE 0 diaAll FILE CONTROL 0 diaAll z FILE LIMIT 0 diaCobol3000 FILE LIMITS 0 diaCobol3000 ELDER 0 diaAll P FINAL 0 diaAll 7 FIRST 0 diaAll i FLOAT EXTENDED 0 diaCobo12000 7 FLOAT LONG O diaCobol2000 FLOAT SHORT 0 diaCobol2000 Pi FOOTING 0 diaAll j FOR 0 diaAll y FORMAT 0 diaAll 7 FREE 1 diaCobo13000 diaCobol2000 FROM 0 diaAll f FUNCTION 0 diaAll A FUNCTION ID 0 diaCobol2000 7 GENERATE 1 diaAll GET 0 diaCobol2000 GIVING 0 diaAll 7 GLOBAL 0 diaAll Go 1 diaAll GOBACK 1 diaAll GREATER 0 diaAll Z GROUP 0 diaAll HEADING 0 diaAll f HIGH VALUE 0 diaAll i HIGH VALUES 0 diaAll y
18. aCobol UNLOCK 1 diaCobol UNSTRING 1 diaAll UNTIL 0 diaAll UPANG 0 diaAll UPON 0 diaAll USAGE 0 diaAll USB 1 diaAll USER DEFAULT 0 diaCobol USING 0 diaAll VALID 0 diaCobol VALIDATE 0 diaCobol VALUE 0 diaAll VALUES 0 diaAll VARYING 0 diaAll WHEN 0 diaAll WHEN COMPILED 0 diaCobol WITH 0 diaAll WORKING STORAGE 0 diaAll WRITE 1 diaAll ZERO 0 diaAll ZEROES 0 diaAll ZEROS 0 diaAll
19. am runs on an empty dataset and never hits eof The concept of Nested source is not supported in Kobol This isn t used often and is typically misunderstood Essentially you have multiple programs in one source file and they can share variables you see multiple DIVISIONS for each sub program If you try to use this concept it will appear to compile but not make but it actually isn t compiling 6 Copylib and SINCLUDE Files COPY members are Included from separate files This means that a copylib that contains multiple members must be split into one file per member These files can be placed in a directory that has the same name as the library Members from the default copylib must be placed directly in one of the include directories Example Assume that have a copy library named MYLIB with members A B and C You can create a directory named MYLIB and within that directory you can create files A B and C The COBOL statement COPY A IN MYLIB will then read the file MYLIB A cob2c allows to indicate include directories via the I option just like gcc The copy libraries can be in any of these directories or in the current working directory which is always searched first SINCLUDE files are included from the same directories Since COBOL names are not case sensitive cob2c will look for file names both in uppercase and in lowercase 7 Accessing Command Line Arguments Here is a small example on how to access command l
20. ave to make sure that you don t alter these file names in any way or you will not be successful If you are having any trouble because of paths not finding critical files then the following list is the critical files they should all be in the cygwin directory that was installed you can either move them to a directory and set your PATH or set your PATH to the directory where they are located Important Files DOS Windows LIBCOM 1 libcompsupp a COB2C EXE cob2c exe G 1 EXE g exe COBOL2 1 H cobol2gcc h QT MT311 DLL OT MT311 DLL GCC EXE gcc exe CYGICO 1 DL cygiconv 2 dll CYGFORM5 DL cygform5 dll CYGMENUS DL cygmenu5 dll CYGNCU 2 DL cygncurses 5 d11 CYGNCU 3 DL cygncurses5 d11 CYGPAN 1 DL cygpanel5 dll CYGFORM6 DL cygform6 dll CYGMENU6 DL cygmenu6 dll CYGNCU 4 DL cygncurses 6 d11 CYGNCU 5 DL cygncurses6 dll CYGPAN 2 DLL cygpanel6 dll CYGWIN1 DLL cygwinl dll LIBCOM 2 DL libcompsupp dll Alternatively you can simply C Program Files Kobol cygwin bin dll to cAWindows Assuming that you ve installed the cygwin files to that directory 10 Working Without the IDE Sometimes you have an editor or IDE that you are already happy with and don t want to use the one included with Kobol The software is partioned so that you can access the compiler directly if you so choose Remember what Kobol does is use a highly sophisticated tran
21. ber 17 2002 DATE COMPILED Project Files Docs P main cob 7 ENVIRONMENT DIVISION 8 CONFIGURATION SECTION si SOURCE COMPUTER Linux x86 OBJECT COMPUTER Linux x86 2 DATA DIVISION WORKING STORAGE SECTION PROCEDURE DIVISION 5 A000 SECTION 7 A000 DISPLAY Hello from main module CALL TESTLIB CALL TESTDLL STOP RUN 123456789 INS Line 5 Col 25 On the top of the editor you can see a tab with the names of all opened files this allows you to easily cut copy paste parts of code between these windows We understand how it is to be working hard and not want to take your hands off the keyboard to this end you can use the Alt Left and Alt Right key combinations to navigate between editor windows Pop up the ToolTips are active pretty much everywhere in the application that they are needed and these icons are no different Finally under the editor window and mouse buttons is the Message Panel which we will explain later You can use Ctrl M to enable disable the panel if you want to get some more screen real estate or if you need it open because you are debugging Kobol makes heavy use of Dock Windows this allows you to essentially tear off any visible toolbar or panel and position it wherever you want on the screen either internal or external to the program docked or free floating This allows you to customize your work environment so it is comfortable and natural for the way you work Kobol has t
22. equired development libraries currently that would be Lindows and Xandros They are geared for a home desktop user and as such they don t by default include developer tools like the gcc compiler To install Kobol on a Windows system you need to run the exe installation file Now just follow the prompts as you would with any other Windows installer If you select a typical installation then not all features will be installed If you select a full installation you can disable features later if you like with Control Panel gt Removing and Add Programs It is also necessary for you to install the CygWin application this contains the compiler and various other pieces needed on Windows The installation script on Linux copies the Kobol binary file to usr bin So to run Kobol you Just need to type kobol on the command line If usr bin is not in your PATH environment variable you will need to type the full path filename usr bin kobol Please remember that to start Kobol you don t need any other systems except XServer running on your Linux system such as KDE or any other desktop manager You can use any window manager that you wish If you are using Windows then you need only open Start menu gt Programs gt theKompany gt Kobol and click on the shortcut for the application If you run Kobol from a command line then you can add command line attributes The X11 version of Kobol knows about display font attributes For example kobol
23. h next Ctrl R Replace Ctrl J Goto Line 4 Your First Program Project support in Kobol allows you to organize your COBOL development in a logical structure you can easily work with Kobol works with your projects based on the file extension you need to use kob for the project name The files in a project are organized in a tree like structure that mirror the directories and file structure on your disk You can perform operations against the entire project such as scanning files and directories CVS operations and such Kobol is Project oriented you must have a project whether it is for one file or 100 or however many There are some integrated example projects as well as a zip file containing a large selection of example files that you can also look at Creating new project is quite simple By selecting the menu item Project gt New Workspace you will see a dialog for setting the Project directory Project Filename and Project Name which contains some information for you So enter in the Project Name a short description or name of your project In Project Directory you must select the directory where the files for your project will be If the directory does not exist you can write the full directory filename in the lineedit then the directory will be created Also you can use the Create New Folder button in Open dialog which you can run by clicking on the button W New Workspace Workspace Name Workspace
24. icts among other features You must have CVS installed on your Linux system to use it on Windows you need to select CVS support in the installation wizard To work with CVS in Kobol on a project you need to have the project uploaded by using the cvs checkout command from a console After that you will have a project with directories CVS inside folders Once you have done this then CVS operations will be available in Kobol CVS documentation will be added to the Kobol help system to keep 1t consistent with the other integrated sub systems The Editor that is used in Kobol is another product developed at theKompany by Max Judin and is used in a variety of our products The editor has standard features for editing powerful highlighting system which allow you easily navigate in your code on the fly checking for and repairing errors Word completion has also been implemented for speeding up your work even more By selecting the menu item Options gt Fonts you can modify the font used in the editor window Monospace font is really more useful for editing but you can select any font available in the font dialog By selecting the menu item Options gt Editor you can choose your own settings to control the behavior of the editor Other options available are Auto indent Allows you to save the indentation used in the previous line Backspace Indent Remove indent by pressing backspace Smart Home With this feature when you press the Home
25. id size t Specifying a prototype that is not compatible with the actual parameters of the called sub program will result in undefined behaviour In the best case an error will be issued during the compilation of the generated intermediate code declaration of C function foo conflicts with previous declaration The prototype for a called subprogram can be specified in the AS clause of a CALL statement This requires that every call statement must specify the prototype This is a good solution when one or two CALL statements must be modified A better way to specify prototypes is in a prototype file This file contains prototypes for external functions Each line of the file contains exactly one prototype The name of the prototype file must be provided using the c option when invoking the compiler see Compiler options The format for a prototype declaration in the prototype file is internal_name prototype The internal name is the name as it is specified in a CALL statement Every CALL statement that references the given sub program will behave as if the prototype had been mentioned in an AS clause for that statement Important notes Unlike in C or C COBOL does not put a terminating zero in any variable Therefore the programmer must provide this terminating zero when the called sub program expects 1t The STRING statement in the following examples does just that One of the examples demonstrates a call to memcpy The
26. ine arguments and environment variables from Kobol This method can be extended to create CGI programs to access variables from a web page identification division program id test123 environment division configuration section data division working storage section 01 cmd pic x 80 01 arg 0 pic x 80 01 arg 1 pic x 80 01 arg 3 pic x 80 01 path pic x 256 01 my var pic x 80 procedure division A000 section AO get the full command line accept cmd from command line display cmd get argument 0 from the command line i e the program name display 0 upon argument number accept arg 0 from argument value display arg 0 get the next argument from the command line accept arg 1 from argument value display arg 1 get argument 3 from the command line display 3 upon argument number accept arg 3 from argument value display arg 3 read the environment variable with name PATH display PATH upon environment name accept path from environment value display path write and read an environment variable display MYVAR upon environment name display my value upon environment value accept my var from environment value display my var 8 Binary Integer Data Types A number of compiler vendors have implemented different versions of the COMPUTATIONAL type notably there is COMP 1 through COMP 6 and COMP X In the new ANSI standard for COBOL these have all mostly been lumped together i
27. nto BINARY and the compiler needs to know weather to use big or little endian Intel chips are little endian for example We currently have support for COMP BINARY COMP 3 PACKED DECIMAL and COMP 5 At this moment COMP BINARY and COMP S are all the same native format This means that they are little endian on Intel systems Many other compilers define COMP and BINARY as big endian COMP 3 and PACKED DECIMAL are the same which is to say they are 4 bits per digit Our PACKED DECIMAL format always has a sign nibble which is in the samebyte as the low order digit All PACKED DECIMAL values are byte aligned We also support numeric DISPLAY format aka zoned decimal this is for both signed and unsigned as well as with a leading or trailing separate sign 9 Distributing Binaries One of the many great things about Kobol is that you can distribute royalty free binaries of your application This is very straight forward on Linux just use the IDE to generate your executable and then hand it around On Windows it can be slightly more confusing because of the use of Cygwin and some support files are required It will be up to you to properly package your application but this will tell you what files are important These 2 dll s along with your executable are all you need to distribute a Kobol application DOS Windows CYGWIN1 cygwinl dll CYGNCU 5 cygncurses6 dll We ve listed how the file name will look under DOS and under Windows you h
28. pany com products kobol When you purchase Kobol you are entitled to free electronic updates for the life of the product for all supported platforms this does not include add on modules that are available separately 2 Requirements and Installation You will need to be running a 300Mhz or better processor with at least 64MB of RAM and either a Linux or MS Windows operating system Koobl for Linux has been statically linked with all the libraries required so you don t need to worry about installing anything else for Kobol just run it If you are using a Linux system then you need to unpack the Kobol installation package into whatever directory you like we recommend usr local by using the tar command tar zxvf Kobol 1 0 0 tar gz or tar xvf Kobol 1 0 0 tar bz2 Please note that the version number will change with each release so the file name may not match the example The command creates the directory Kobol 1 0 0 and puts all the files there Now go into the directory with the following command cd Kobol 1 0 0 Now just run installation script as root install sh If you have tried to install as a user other than root then you will receive a warning message The installation script will tell you where the files are installed so if you want to remove Kobol from your Linux system you will only need to remove usr local kobol directory and the binary file usr bin kobol Keep in mind that certain Linux distributions do not come with the r
29. same effect will result from a simple MOVE statement When there is such a COBOL alternative for calling a sub program then usually the COBOL statement should be preferred Examples An example using the AS clause IDENTIFICATION DIVISION PROGRAM ID SYS ENVIRONMENT DIVISION DATA DIVISION WORKING STORAGE SECTION 01 COMMAND PIC X 80 PROCEDURE DIVISION BEGIN STRING bin ls x 0 INTO COMMAND CALL system AS int system const char USING COMMAND STOP RUN An example using a prototype file The prototype file is system int system const char memcpy void memcpy void const void size t The program is IDENTIFICATION DIVISION PROGRAM ID SYS ENVIRONMENT DIVISION DATA DIVISION WORKING STORAGE SECTION 01 COMMAND PIC X 80 01 COMMAND PIC X 80 PROCEDURE DIVISION BEGIN STRING bin Is x 0 INTO COMMAND CALL system USING COMMAND CALL memcpy USING COMMAND1 COMMAND BY VALUE LENGTH OF COMMAND the CALL memcpy is equivalent to MOVE COMMAND TO COMMAND the MOVE statement is usualy preferable CALL system USING COMMANDI STOP RUN 13 SELECT ASSIGN Indexed files are actually kept as a pair of files one with the data extension and one with the index extension The name given in the ASSIGN TO clause must be the name without these extensions ORGANIZATION SEQUENTIAL files are byte streams that have no embedded structure Such a file can contain binary or
30. send an email to info thekompany com Kobol is available from many online and brick and mortar retailers but it can also be purchased directly from our website at www thekompany com products kobol 17 Credits Kobol IDE Alexander Yakovlev cob2gcc Jacques V Damme cobmake Alexander Yakovlev amp Dmitry Poplavsky tkEditor used in Kobol by Max Judin Icons graphics splash screen and packaging by Bogdan Munteanu amp John Grantham Appendix A Reserved Words Note that the second column contains a 1 if the corresponding reserved word can start a new sentence The third column says in what dialect the word is reserved ABSENT 0 diaCobol2000 ACCEPTI 1 diaAll ACCESS 0 diaAll ACTIVE CLASS 0 diaCobol2000 ACTUAL 0 diaCobol3000 ADD 1 diaAll ADDRESS O diaCobol2000 ADVANCING 0 diaAll J AFTER 0 diaAll j ALL 0 diaAll ALLOCATE 0 diaCobol2000 ALLOW 1 diaCobol2000 ALPHABET 0 diaAll E ALPHABETIC 0 diaAll i ALPHABETIC LOWER 0 diaAll r ALPHABETIC UPPER 0 diaAll r ALPHANUMERIC 0 diaAll y ALPHANUMERIC EDITED 0 diaAll F ALSO 0 diaAll ALTER 1 diaAll ALTERNATE 0 diaAll P AND 0 diaAll 7 ANY 0 diaAll ARE 0 diaAll fi AREA 0 diaAll
31. slator to create C code out of your COBOL code and then use GCC GNU Compiler Collection to compile it This is what provides us such a great degree of flexibility in porting to other platforms and supporting Object Oriented features You can use Kobol to generate intermediate C code on a Windows machine and then port it over to a Sun box and compile it there for example So there are some basic steps to follow first generate the C code using our cob2c cob2c M i myprog cob D Typing cob2c with no parameters will provide a list of options for the application You should probably use a script or batch file and pass myprog cob as a parameter for maximum flexbility Here are some example steps 1 Compile prog1 cob2c progl cob D g c o progl o progl cc 2 Compile prog2 cob2c prog2 cob D g c o prog2 0 prog2 cc 3 Create a dll containing both programs g shared o mydll dll prog1 0 prog2 o L lcompsupp 4 Compile and link calling program cob2c M i caller cob D g c o caller o caller cc g o caller caller o L lcompsupp Incurses A good reference book for the GNU system is GCC The Complete Reference by Arthur Griffith 11 Writing CGI Applications CGI is the common abbreviation for applications that run in web servers to feed data back to a web page they can also accept data from the web page using the GET or POST method we are going to describe the GET method here What we have
32. will prompt you with a save file dialog so it knows where to put the new file and what to call it A powerful companion feature is the menu item Project gt Scan for new files When you select this you will get a checkable tree like file directory structure which is not included in the current project From here you can easily select missing files In the dialog on top you can select the project s folder which you want to check for existing new files Below you can enter a mask for files that you want to exclude In the tree you can select files for addition by clicking once on files that you are interesting in When you click on the checkbox you will have all files and subdirectories with files selected for addition When you clear the checkbox on the folder you will clear all selections inside So this feature allows you to very quickly navigate a project directory for new files and select them for addition In all cases a project needs a main source file this is the outer block When you are creating a new source file in a new project for the first time Kobol will try to set this one as main A main file is indicated by a star on it s icon in the project list view sometimes this doesn t show up until you close and re open Kobol if the setting has been done automatically this is currently a bug To specifically set a file as main right click on its name in the file list and select the menu option for 1t Here is a sequence of events that 1s
33. wo File views They are located on the panel named Files The first is a list style interface you can open a directory or select a file by single clicking on it Here is an example By right clicking you can switch to Tree Mode which is the second interface to do copy paste delete insert a file or directory in the current project and reload the current dir if there are new elements Our next file style is Tree Mode this is where you can expand or collapse directory structures by clicking on the icon next to the name or double clicking on the name While this is useful for certain types of operations 1t can create a cluttered view as well You can switch back to list mode by just right clicking and selecting it from the pop up menu The Project Panel is for managing your project and the files within it If no project exists then the root folder name will say No project If you double click on that name you will get the Project Open Dialog This is a nice shortcut to using the menu bar Right clicking in the Project panel will allow you to add delete create and open files as well as perform various CVS operations The Documentation Panel provides you ready access to various documents to help you in with your COBOL programming Kobol has a very friendly integrated help system however it is currently un populated as we research and implement an HTML version of the COBOL standard The help works when you set the cursor on the word
34. you are interested in and press F1 on your keyboard The documentation window will now appear with help information regarding the selected word For example entering the word MOVE and pressing the F1 button will open a manual page about the attributes of the verb and its description The Message Panel is a basic output window where the various programs and functions of Kobol will output their messages If the line in the message panel contains a line number then you can highlight the line you are interested in click on it and the appropriate window will come up with the appropriate text Currently Kobol only supports output from cobmake make cob2gcc which makes it very handy for debugging your COBOL code When you see an error messages like Error at 20 12 this means that the error was at line 20 column 12 Kobol provides keyboard shortcuts for almost all the available actions in the application Fl popup help for the word tag that the cursor is on F3 find next action Ctrl M Show Message window File operations Ctrl N New file Ctrl O Open file Ctrl W Close file Ctrl S Save file Ctrl O Quit from Kobol Editor operations Ctrl Z Undo Ctrl Shift Z Redo Ctrl X Cut Ctrl C Copy Ctrl V Paste Ctrl A Select All Ctrl I Indent Ctrl U Unindent Ctrl Space Complete word Alt Left Alt Right switch to prev next editor window Search operations Ctrl F Search F3 Searc

Download Pdf Manuals

image

Related Search

Related Contents

10ページ  W687E - Verixx  Mother-32 Manual  Spotlight  Skil 7312 AA  USER MANUAL Reference Tracking System for a Mobile Skid Steer  Manuel d`utilisation de PATCH LOTAS SSR DPA 2014 Version 1.0.0.0  Momentum Sales & Marketing MO8 User's Manual  SA68B MANUAL OK.CDR    

Copyright © All rights reserved.
Failed to retrieve file