Skip to content

Page 1

ND 10176 COBOL for ND-100

ND 10177 COBOL for ND-500

INTRODUCTION

The COBOL programming language is the industry-wide accepted high level computer language. It is oriented towards data processing tasks often found in business applications. A significant feature of the ND-COBOL product is that programs written on an ND 16-bit computer (ND-100 Family) can run on an 32-bit computer (ND-500 Family), without modification.

THE ND COBOL HANDLES DATA TYPES FOR:

  • Packed Decimal (COMPUTATIONAL-3): up to 18 digits
  • Computational:
    • Picture 9 (n) where n ≤ 4 range (-32768) to(+ 32767)
    • Picture 9 (n) where 5 ≤ n ≤ 10 range (-2147483648) to (+ 2147483647)
  • Real (COMPUTATIONAL-2): only in CALL and MOVE to and from COMP-3
  • Display: up to 18 digits
  • Numeric-Edited: up to 18 digits plus edit characters
  • Alphanumeric ND 10177: up to 2147483647 characters
    ND 10176: up to 32767 characters
  • Alphanumeric-Edited ND 10177: up to 2147483647 characters
    ND 10176: up to 32767 characters

When applying the ND extended screen handling system, all terminals with an ND-supplied VTM (Virtual Terminal Manager) table can be used.

PRODUCT DESCRIPTION

The ND COBOL compiler provides the following large-scale business data processing capabilities to the minicomputer world:

  • Conforms to the ANSI-74 COBOL standard as defined in American National Standards Programming Language COBOL, ANSI X3.23-1974 Level One.
  • Contains many selections from ANSI X3.23-1974 Level Two.
  • Includes ND extensions, eg., COBOL Screen handling.

ND-COBOL includes the following 'modules' at level 1 and extensions specified:

  • NUCLEUS
  • SEQUENTIAL I/O
  • RELATIVE I/O
  • INDEXED I/O
  • DEBUGGING
  • TABLE HANDLING
  • LIBRARY
  • INTER-PROGRAM-COMMUNICATION
  • SORT

Nucleus at Level One, with many selections from Level Two. Among others:

  • Levels 77,01-49,88.
  • 88-level condition names, with value series or range of conditions.
  • Conditional operators AND, NOT, OR, =, < >, .: in conditions.
  • Procedure names consisting of digits only.
  • COMPUTE-verb with multiple receiving fields.
  • ADD, SUBTRACT, MULTIPLY, DIVIDE-verbs with multiple receiving fields
  • DIVIDE-verb with REMAINDER.
  • PERFORM-verb with three indexes.
  • Qualification of names.
  • Sign and class tests.
  • Nested IF-statements, parenthesized conditions, abbreviated conditions, implied subject and/or relation.
  • Nested conditions.
  • ACCEPT-verb with DATE/DAY/TIME/CPU-TIME clauses.
  • INSPECT, STRING and UNSTRING-verbs full highest level.

Table handling at full Level One, and

  • SEARCH-verb, format 1, format 2.
  • Relative indexing.

Input/output for Sequential, Relative and Indexed access organizations at Level One, with the following selections from Level Two:

  • Multiple operands in OPEN and CLOSE-verbs, with individual options per file.

Page 2

ND-COBOL Features

  • DYNAMIC access mode.
  • START-verb with/without key relations EQUAL, LESS, GREATER, NOT LESS or NOT GREATER.
  • 1 primary key, up to 63 alternate keys, duplicates allowed.

Library module with Copy-verb at all divisions and sections.

Inter-Program Communication

  • WITH LINKAGE SECTION, USING clause in PROCEDURE DIVISION, and CALL-verb with USING clause.
  • With EXPORT-verb in WORKING-STORAGE SECTION and IMPORT-verb in the LINKAGE SECTION for exporting/importing variables without having to refer to them in calls.

ND Extensions

Some major extensions have been included with ND-COBOL:

Screen Handling

With many new options on the ACCEPT and DISPLAY statements, data can be displayed in any screen position. Parts of the screen, or all of it, can be blanked out using the new BLANK statement. Movement between any two data fields is provided for by control keys. User Control including ACCEPT-ERROR is provided for.

Multi-user Relative/Indexed Files

New options on the OPEN statement allow Indexed and Relative files to be opened in MULTI-USER-MODE, with or without MANUAL-UNLOCK, or with IMMEDIATE-WRITE. The READ/WRITE statements now have a WITH LOCK option to prevent two programs from accessing the same record at the same time. There is also a new UNLOCK statement. In addition to READ... NEXT RECORD there is also the feature READ... PREVIOUS RECORD.

The DO, END-DO Statement and the IF, THEN, ELSE, IF, ELSE, END-IF Statement.

A DO statement has been introduced which can contain any number of WHILE phrases, and one FOR phrase, allowing positive or negative increments.

Inter-Program Communication

  • METHOD 1: CALL... USING with PROCEDURE DIVISION USING... in the called program.
  • METHOD 2: Declaration of common areas using the new EXPORT and IMPORT clauses. Variables can be passed to called programs without having to be referred in the CALL 'xx' USING statements. These variables are accessible to all the routines in a program. This means, for example, that a program 4 levels below the program which defined the 'common area' can use it.

Using EXPORT/IMPORT

Using EXPORT/IMPORT Without EXPORT/IMPORT
PROGRAM A. PROGRAM A.
WORKING-STORAGE SECTION. WORKING-STORAGE SECTION.
01 COMMON-STRING EXPORT. 01 COMMON-STRING.
PROCEDURE DIVISION. PROCEDURE DIVISION.
CALL 'SUBR'. CALL 'SUBR' USING COMMON-STRING.
PROGRAM SUBR. PROGRAM SUBR.
LINKAGE SECTION. LINKAGE SECTION.
01 COMMON-STRING IMPORT. 01 COMMON-STRING.
PROCEDURE DIVISION. PROCEDURE DIVISION USING COMMON-STRING.

COBOL Screen Handling

The ND-COBOL screen handling system consists of extended:

ACCEPT
DISPLAY
BLANK

Examples

BLANK     LINE IND
DISPLAY   (IND 1) 'Give password:' WITH INVERSE-VIDEO
ACCEPT    (IND 16) PASSWORD WITH BEEP INVISIBLE

  UP        ENTER-USER
  LEFT      ENTER-USER
  HOME      EXIT-PROGRAM
            CONTROL CHECK-PASSWORD

The format for these statements is:

ACCEPT   [position spec.] identifier with options
DISPLAY  [position spec.] identifier or literal with options
BLANK    SCREEN
BLANK    LINE i [TO j] COLUMN n [TO m]

position spec. is line and column in the screen, which may be specified with identifier or literal.


Page 3

Options Table

Options are: available for:
ACCEPT
BEEP x
BLINK x
INVERSE-VIDEO x
LOW-INTENSITY x
UNDERLINE x
NORMAL x
SPACE-FILL x
MUST x
UPPER-CASE x
AUTO-SKIP x
INVISIBLE x
LENGTH-CHECK x
PROMPT x
UPDATE x
LISTEN x
AUTO-ERASE
BLANK-WHEN-ZERO x
LISTEN x
JUSTIFIED-RIGHT x
DOWN label x
EXIT label x
HOME label x
LEFT label x
RIGHT label x
UP label x
CONTROL label x
HELP label x
RE-DISPLAY label x
TIME-OUT label x
F1-F8 label x
CANCEL label x

Interactive Debugging

The ND-COBOL system provides the user with a number of debug options indispensable to efficient program development. When the command DEBUG-MODE is entered prior to program compilation, the user can choose between a number of debug options during subsequent execution of the program.

The options that can be invoked in DEBUG-MODE are:

  • HELP - List available DEBUG options
  • BREAK-ADDRESS
  • BREAK-RETURN
  • ACTIVE-ROUTINES
  • ALIGN-LISTING
  • CHECK-OUT-MODE
  • COMPARE-DATA
  • COMPARE-PROGRAM
  • DUMP-LOG
  • FIND-SCOPE
  • GUARD
  • LOG-LINES
  • LOG-CALLS
  • DISPLAY variable
  • EXIT - Exit to operating system
  • STEP - Execute next statement in logical sequence
  • RUN - Start/restart program execution
  • LOOK-AT-DATA
  • LOOK-AT-PROGRAM
  • LOOK-AT-REGISTER
  • LOOK-AT-STACK
  • MACRO
  • RESET-BREAKS

and others.

One or more options may be active during program execution.

A sorted Cross-reference list is available for labels and variables.

Two-Bank Mode for ND 10176

Programs are by default compiled in a two-bank mode making it possible to run programs with 128 KBytes of code and 128 KBytes of data. It is possible to compile in the 1-bank mode by giving the command 1-bank prior to the compile command.

COBOL Screen Handling

COBOL screen handling also contains some graphics features for drawing boxes (frames) and bar charts:

Example:

  Mill. $
     |
  7  |      █  Sales follow up
     |      █▄ Budget
  6  |      ▄░ Actual
     |      
  5  |      
     |      
  4  |      
     |      
  3  |    
     |      
  2  |      
     |     
  1  |     
     |
     |
  ───┼─────────────────────────────>
    January February March April May

Commands

  • DISPLAY (upper left corner) FRAME lines * columns
  • DISPLAY (lower left corner) FULL-BAR height * width
  • DISPLAY (lower left corner) SPARSE-BAR height * width

Page 4

Related Software

Database Management

The inter-program communication module allows COBOL programs to interface with the advanced SIBAS Database Management System through the Call-verb. The SIBAS DBM system is designed for multi-user, on-line terminal applications in business environments with complex information structures.

Alternative Screen Handling System

The programmer may choose to use either the screen handling system (incorporated in COBOL) or to use the FOCUS screen handling system (which consists of an interactive-forms definition segment and a run-time segment).

COBOL Code Generator (COB GEN)

COB-GEN generates COBOL source code for screen input/output, input validation and reports. The COBOL programmer's productivity rate can be highly increased with this simple, but effective method for COBOL source code generation. Using the COB-GEN utility removes the most tedious and error-prone tasks for the COBOL programmers, letting the programmers concentrate on the logic of the program. Using COB-GEN leads to brief, efficient and well-structured programs.

The simplified COB-GEN way of working is to:

  1. Draw the PICTURES and/or REPORT layouts and store them in a file.

  2. Add commands in front and at the end of the drawing in order to associate COBOL variable names to the fields on the REPORT/PICTURE.

  3. Process the files, and you get COBOL source code for input from/output to the screen and/or output to reports.

  4. COPY the COBOL SECTIONS produced in step 3 into the COBOL program's PROCEDURE DIVISION using the COBOL verb COPY.

Documentation

Documentation Reference Number
COBOL Reference Manual ND-60.144
ND Relocating Loader ND-60.066
Symbolic Debugger User's Guide ND-60.158
COB-GEN Reference Manual ND-60.171