CoModi The Cogito Software Development Methodology INDEX 1: Overview 2: Naming Conventions 3: Cogito Programming Standards 4: Cogito File List 5: Control File - use and structure 6: CoDE - The Cogito Development Environment 7: Programming tips and techniques. ================================================================ 1: Overview ================================================ Cogito software is mostly written in COBOL, but the methodology is applied in whatever other languages are used (PHP, C++, Basic etc.) ================================================================ 2: Cogito Naming Conventions: ================================================ The name of the game is NOMENCLATURE. The "system" consists of a number of "modules", each of which has its own "programs", some with "versions". The database consists of pre-defined "files" (tables), all of which are "indexed", some with multiple indices. ------------------------------------------------ The Modules: BM Bill of Materials CB CashBook CR Creditors DT Debtors DV Development (software) EX Expense Analysis FQ Foam Quoting (custom) FR Financial Reporting IN Invoicing PL General Ledger SB Sales Bill SC Stock Control SI System Integration SM Sales and Marketing SO Supplier Orders ST Stock Take SY System ------------------------------------------------ COGITO Program names: (Executables) Standard format: RMMTPPVV.XXX 8INQ01C2.CBX Where R Release No. 8 MM Module Code IN T Program Type Q PP Program Number 01 VV Version C2 .XXX Extension .CBX Release: "Major" release no. Module code - as above. Program Types L "Live" Transaction Processing / Maintenance P Print / Reports Q Queries / Lookups X Fixes / Toolkits Program Extension: .INT MicroFocus .CBX AcuCOBOL See below for "Source file extension codes" ------------------------------------------------ Cogito Data Files: (database tables) Standard Format: CCMMTSSS.XXX COINWP2 Where CC Company Code CO MM Module Code IN T File Type W SSS sub-name P2 .XXX Extension .VIX -------------------------------- CC - Company Code Each "installation" has a 2-character "company code" e.g. our own code is "CO" (Cogito) ALL our files start with "CO". -------------------------------- MM - Module code - as above. -------------------------------- T - File Types: TYPE e.g. DESCRIPTION A ccscA Activity log e.g. all items bought since file last cleared C ccsyC Scheduler File. ccscCxxx Count - temp count file e.g. stock take F ccplF Format - Report Writer Format File (DT, ST, CR, SO) H ccplHnn History files I cccrI Invoice Processed but not updated Creditor Invoices K coscK Report file - usually for re-coding M ccdtM Master File (SYM - Systems Control File) P cccrP Creditors Postings - updated transactions (T - in other modules, but CRT is a reserved word) P ccdtP Debtors Special Prices & Discounts file P ccscP Stock Purchases R ccinR Report - temp files in DT & SC while report building S ccdtS Send - file to update remote Branch or Head Office T ccdtT Transactions U ccsyU Utility Logon page (Terminal I.D./Password and Co. Code) V ccinV1a work file payments W ccdtWttt Work file + log on id X ccscX Branch Stock File Workfiles: ccmmWttt A workfile is a temporary storage file created when an operator begins any "transaction" processing, e.g. when invoicing at terminal "P2", the workfile "COINWP2" is created then emptied when processed. ccDTWttt - Debtors Payments/Journals Workfile ccINWttt - Invoice Workfile ccSCWttt - Stock purchasing and adjustments ccCRWttt - Creditors ccPLWttt - General Ledger -------------------------------- SSS - Sub-name: Some files have a "sub-name" to distinguish them from similarly named files: ttt Terminal Code - e.g. all "work" files. nn History No. -------------------------------- XXX - File Extension (.IDX) Each data file is in 2 parts: The "data" portion has no extension - e.g. CODTM (Debtors Master) The "index" portion - e.g. CODTM.VIX (rel 9, AcuCOBOL) CODTM.IDX (Rel 8, old MicroFocus) ================================================================ 3: Cogito Programming Standards ================================================ Source/Object File naming: All source and "object" files are named according to our naming conventions: Object programs: (run under the appropriate "run-time): RMMTPPVV.XXX 8INP01C2.INT (Rel 8, old MicroFocus) 8INP01C2.CBX (Rel 9, new AcuCOBOL) Source files: Standard format: As per "executables", except for the extension: RMMTPPVV.XXX 8INQ01C2.SS Source Program Extensions: .CBL The actual COBOL source file - e.g. 8INQ01.CBL "Copy" (include) code - per version: .DEV Development notes (text file) .FS File Selections .FD File Definitions .WS Working-storage .SS Screen Section .LS Linkage Section .PD Procedure division ================================================ Data naming: All data names start with a "code" indicating where they belong: Working-storage: ws- for all "common" work fields w1- to w9- for "local" variables (per program) ws- to w9- for "local" variables (per program) Linkage section ls- for all "common" linkage fields l1- to L9- for "local" linkage fields. Screen section s1- to s9- sc- "system-wide" screens (common to all progs) ================================================ Procedure division All paragraph names start with a single character followed by a dash (e.g. A-0000-GO or A-a-go) but reserving W- to Z- for I-O, Utilities etc. Sample: A-a-go Perform S-a-startup. Perform C-a-mainline until ws-end. Perform T-a-closedown e.g. A- = Control section C- = Mainline section E- = Editing routines P- = Printing routines S- = Startup section T- = Terminate section To convert "old" programs: 0000- becomes A- 1...- becomes B-...- etc. ================================================================ 4: Cogito File List: ================================================ Bill of Materials BMM - Bill of Materials Master File Cash Book CBM - Cash Book Master File CBT - Cash Book Transaction File CReditors: CRI - Creditor Invoice File (01 etc. history) CRE - Creditors Extension File (e-mail) - obsolete CRM - Creditors Master File CRP - Creditors Transactions CRQ - Creditors cheque register DebTors: DTM - Debtors Masterfile DTT - Monthly Debtors Transactions (01 etc. history) DTP - Special Prices and Discounts File Electronic Commerce ECM - Individual Address File ECT - Transmission File ECS - Files to be sent INvoicing INHxx - Invoice History INS - Branch invoices (to be updated) INT - Invoice Transactions Private Ledger: PLF - Format file (budgets/report writer) PLM - General Ledger Masterfile (01 etc. history) PLT - General Ledger Transaction File Sales Bill SBM - Sales Kit Master File Stock Control: SCC - Stock Count File SCM - Stock (Product) Master File SCP - Stock Purchases SCS - Stock Costings SCT - Stock Transaction File (01 etc. history) SCX - Branch Stock File 8SCL12C1 & text & supplier prod - optional extras to the SCT Sales and Marketing: SMB - Sales Budgets SMM - Sales & Marketing Supplier Orders: SOT - Supplier Order Transactions System SYC - Scheduler File SYF - Report Writer Format File SYJ - Help records SYM - Systems Control File SYS - DDP HO send back file additions/changes to update Branch SYU - Logon page (Terminal I.D./Password and Company Code) ------------------------------------------------ Source File Extensions: .CBL Cobol - main source files / programs .FD Optional Files and Print Layouts .FD1 .FS File Selections .PD0 POS routines (if any) .PD Print routines Procedure division .PD1 R-... Version dependant processing .PDS Sort Invoice Lines .PD2 T-x... optional files - Startup / Closedown .PD3 X-xx Optional files - handlers .SS All input screens Screen section .SS1 .SS2 .WS Ribbon lines, Page size, screen positions etc. .WS1 .WS2 ================================================================ 5: Control File - use and structure ================================================ System parameters ccSYM The "Control File" (ccSYM) is the repository of all system variables and user-defined tables. It also holds all the "site" and "user" settings configured for each Cogito installation. Record Structure The file is indexed by a single 12-char key. Each record consists of: 12 "text" fields 40 chars), 32 "flags" 2 chars) 16 values 13 digits, including 4 decimal places ================================================================ 6: CoDE - The Cogito Development Environment ================================================ -------------------------------- Independent Parameters: - SYIPccccc (not attached to any menu no.) Param 1 Parameter Description e.g. "Program", "Version", Source directory" etc. Param 2 Current value for this parameter. Params 3-16: 14 x 30-char parameter values (last 14 values of this variable) e.g. syipPROG param 1 "Program" param 2 "8INP01" ("Current" program) param 3 "8SYL10" (previous value) param 4 "8DTP04" (the one before) syipPVER param 1 "Version" param 2 "C2 " ("Current" program version) param 3 "S2 " (previous value) param 4 "BM " (the one before) syipCOG param 1 "Run Directory" param 2 "C:\COG9\" (Current RunTime directory) syipSRC param 3 "Source Directory" param 4 "C:\C2\S8\" (Current source directory) A "S"ystem call (i.e. a .BAT or .EXE call) can pass development parameters (as HDMenu does): e.g.: "01 Edit a source file ED_[SRC][PROG]*.cbl" will prompt: Run program: ED C:\C2\S8\8INL01*.cbl "04 Compile CV_[PROG][VER] will prompt: Run program: CV 8INL01 S2 The operator can accept the items prompted or change them (similar to "98"). -------------------------------- Parameter "variables": A parameter in a menu entry can be preceded by "%" or "|". "%" is replaced by the current "operator" code "|" is replaced by the current "terminal" code e.g.: if the current values are: operator login code is "MS" syip"ED" is "ED" syip"MSSRC" is "C:\c2\s8\". syip"MSPROG" is "8DTP04" syip"MSPVER" is "BM" "[%PROG] is expanded to "MSPROG" If syipMSPROG is not found, the system looks for a "default" parameter - "syipPROG" Using the above values, the menu entry: [%ED]_[%SRC][%PROG][%VER].* is expanded to: ED C:\c2\s8\8DTP04BM.* -------------------------------- 8SYL29C0 "development setup" to view / change current parameters. (This is one of the programs on the CODE menu - 29) Call 8SYL29C0 defaulting to Subject 29 (System Parameters) "select parameter" (F3) lists all current parameters (SYIPcccc....) showing the "current" value (param 2) Having selected the parameter, offer option to change the current value, either by typing a new one, or by selecting a "recent" one. Store the current list first. If the new one (entered) is NOT in the old list, move all entires "down" one, losing the oldest. If the "new" parameter is in the current list, or one is selected from the current list (F3), move it to the top position (current) and shuffle the rest down. -------------------------------- Add the ability to load a menu from ANOTHER FILE (e.g. from CXSYM, menu 16: Development) OR to run another "company" - e.g. when testing? 20/09/09 Implement: 8DVL09 Parameter Maint. 8SYL10 Menu Code (on any menu) to interpret Parameters -------------------------------- Passwords reduced from 20 to 12 (Texts 3, 4) -------------------------------- "Setup" string per menu (text 5) e.g. SY0016 "Development" Text 5 = "SUDV88-C". ================================================================ Use of keyboard: Function Lookup Transaction Maintenance F1 Help F2 or Enter Start Go Setup F3 "Pluck" List F4 F5 Profile Sys Func Add F6 Balance Review fix Change F7 Transactions Delete Delete F8 Recall Copy F9 Current End End Tab Next field (below, above) Enter "Finished", "next" Pg Up / Dn Prev / Next page, section Arrow Move 1 character left/right within field End / Home go to end/beginning of "field" or "page" Escape "Go Back", "Quit" Preparation for Windows Functions Supplementary Guide Invoicing Function Keys Release 8.3 Program Options Menu: Function New Old F1 Help Help F2 New Document Enter Details F3 Inquiry Inquiry F4 Logon Features F5 s F1 System Functions F6 Re-call to fix **N/A** F7 s F6 Re-call / Fix F8 Reprint F8/F5 Reprint F8/cF11 Cancel F9 Invoice Invoice F10 F8 Packing Slip F11 Quoting prog Quote F12 Ordering Prog Order sF1 System Functions F5 sF6 Confirm F7 sF7 Cancel F8/cF11 sF8 Copy sF7 ESC to exit Detail Lines F1 Help Help F3/Enter Plucker Plucker F5 New Item New Item F6 Fix F10 F7 Restart F11 F8 Text Text F9 End End ESC to exit Process Options F1 Help F7 Restart F8 Packing Slips F9 Invoice ESC to exit ================================================================ 7: Programming tips and techniques. ================================================ Reference Modification: -------------------------------- data-name (start:length) scm-description (1:12) scm-description (w5-desc-b-start:w5-desc-b-length) -------------------------------- 8SCP02L1.PD: 211107* From ~L4 to split description: 03 w5-description. 05 w5-desc-ch occurs 60 pic x. 03 filler redefines w5-description. 05 w5-desc-a pic x(35). 05 w5-desc-b pic x(25). 03 w5-desc-a-length pic 99. 03 w5-desc-b-start pic 99. 03 w5-desc-b-length pic 99. 201107* For 35-char labels, try to split longer descriptions * at a word between 25 & 35 chars: Move scm-description to w5-description. If w5-desc-b not = spaces perform J-fc-split end-if. Move w5-desc-a to w5-lb-desc-1 (w2-label-no). Move w5-desc-b to w5-lb-desc-2 (w2-label-no). J-fc-split. Perform varying ws-sub1 from 25 by 1 until ws-sub1 > 35 or w5-desc-ch (ws-sub1) = space * For TS: or w5-desc-ch (ws-sub1) = "[" if w5-desc-ch (ws-sub1) = space or w5-desc-ch (ws-sub1) = "[" subtract 1 from ws-sub1 end-if end-perform. If ws-sub1 < 35 compute w5-desc-a-length = ws-sub1 - 1 compute w5-desc-b-start = ws-sub1 + 1 compute w5-desc-b-length = 60 - ws-sub1 * reference modification: move scm-description >>>>>> (1:w5-desc-a-length) to w5-desc-a move scm-description >>>>>> (w5-desc-b-start:w5-desc-b-length) to w5-desc-b end-if. -------------------------------- 8SCL09.CBL ======================================================= INSPECT verb inspect data-name tallying ws-sub1 for leading " " inspect w3-key tallying w2-tally for characters before initial space Inspect dtm-name replacing all "," by " ". -------------------------------- 8INL01A.CBL 191206* Don't allow leading spaces in "reference": * (using "reference modification") * e.g. inwa-ref = " FG145" * the "inspect" will set ws-sub1 to 4 (1 + 3 spaces) * the "move" starts at char 4 and moves the following * characters to the beginning of inwa-ref: * i.e. " FG145" becomes "FG145 " If inwa-ref not = spaces and inwa-ref (1:1) = " " * Set ws-sub1 to 1 before the "inspect" so that * it will point to the 1st char AFTER the space(s) move 1 to ws-sub1 inspect inwa-ref tallying ws-sub1 for leading " " move inwa-ref (ws-sub1:) to inwa-ref end-if ======================================================= Programs using the "inspect" verb: 14/07/10 9CRL06Q.PD1 for characters 9CRP04E8.PD replacing all 9SCP08.CBL replacing 9SCQ05.CBL tallying