Digital PDFs
Documents
Guest
Register
Log In
AA-D758A-TA
December 1978
84 pages
Original
2.9MB
view
download
Document:
aa-d758a-ta
Order Number:
AA-D758A-TA
Revision:
Pages:
84
Original Filename:
https://svn.so-much-stuff.com/svn/trunk/pdp8/src/dec/qf310/aa-d758a-ta.pdf
OCR Text
decidusgsbem magnum COS-310 New User’s Guide Order No. AA-D758A-TA 1978 November the to introductory manual DIBOL language, procedures, operating conven— programming logical units, and This is an tions associated ating System. allow a COS—310 with This new user a minimal in to the COS—310 information be Oper— will operating with amount of time. introduced, programs are herein their actual operating instructions in contained the COS—310 are System Reference Manual. Utility but Supersession/Update Operating System and Information: Version: Software Version: This is a new COS-310 V 8.00 COS—310 V 8.00 manual. To order additional copies of this document, contact the Software Distribution Center, Digital Equipment Corporation, Maynard, Massachusetts 01754 digital equipment corporation mognard, massachusetts . First The and November 1978 change without notice Digital Equipment Digital Equipment Corporation assumes no responsibility information in this document is subject to should not be construed as a commitment by Corporation. for Printing, errors any that may in appear this document. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such license. responsibility is assumed for the use or reliability of software on equipment that is not supplied by DIGITAL or its affiliated companies. No Copyright.(3 1978 by Digital Equipment Corporation postage—prepaid READER'S document requests the user's paring future documentation. COMMENTS The of The following are trademarks critical form on the last page of this evaluation to assist us in pre- Digital Equipment Corporation: DIGITAL DECSystem-lO DEC DECtape OMNIBUS PDP DIBOL 05/8 DECUS EDUSYSTEM PHA UNIBUS FLIP CHIP FOCAL RSTS INDAC LAB-8 TYPESET—B TYPESET-ll DECSYSTEM-ZO RTS-8 TMS-ll ITPS-lO COMPUTER LABS COMTEX DDT DECCOMM ASSIST-11 I¢/?9-1u MASSBUS RSX CONTENTS Page PREFACE ORGANIZATION NOTATIONAL CHAPTER CHAPTER CHAPTER OF THE MANUAL CONVENTIONS 1 INTRODUCTION 1.1 1.2 1.3 OVERVIEW HARDWARE FOR TO THIS MANUAL H COS-310 REQUIREMENTS COS-310 FUNCTIONAL VIEW OF The System Monitor 1.3.1 1.3.2 1.3.3 A 2 OPERATING COS-310 2.1 2.2 2.3 2.4 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 USING THE KEYBOARD ERROR CORRECTION I I High-level Programming Language N ERROR MESSAGES USING THE KEYBOARD MONITOR DIRECTORY, RUN, SAVE, ERASE - Line AND MONITOR COMMANDS EDITOR FETCH, and and WRITE Command Number Command Number Commands Commands and RESEQUENCE Command DELETE 3 LOGICAL UNITS 3.1 3.2 3.3 3.3.1 3.3.2 3.3.3 3.4 3.4.1 3.4.2 3.4.3 LOGICAL UNIT LIST Commands ASSIGNED UNITS ARE Display Assignments List Assignments on Display an Expanded DISPLAYED AND LISTED the Screen (DFU/D) the Printer (DFU/DL) Table on the Screen on (DFU/E) 3.4.4 List an NNNNNN \DGJQNUIANWH I H wwwww bhfiwwNI-d I w Expanded Table on the I .5; Printer (DFU/EL) 3.5 3.6 [—4 TABLE Assignments Through the Keyboard (DFU/K) Assignments From the Edit Buffer (DFU/B) Assignments From a Named File (DFU,filnam) LOGICAL I w LOGICAL UNIT NUMBERS HOW LOGICAL UNITS ARE HOW 5..- HPHFHFJH NMNI—‘I—l PROGRAMS System Utility Programs CALLING I ARRANGEMENT OF LOGICAL UNITS ON MEDIA HOW A DIBOL PROGRAM USES LOGICAL UNIT NUMBERS W W O‘U‘lnb I CONTENTS (Cont.) Page CHAPTER 4 THE 4.1 4.1.1 4.1.2 4.1.3 4.2 4.2.1 4.2.1.1 4.2.1.2 4.2.1.3 4.2.1.4 4.2.1.5 4.2.1.6 4.2.1.7 DATA 4.2.1.8 4.2.1.9 4.2.2 4.2.2.1 4.2.2.2 4.2.2.3 4.2.2.4 4.2.2.5 4.2.2.6 4.2.3 4.2.3.1 4.2.3.2 4.2.3.3 4.2.3.4 4.2.3.5 4.2.3.6 4.2.3.7 4.2.4 4.2.4.1 4.2.4.2 4-1 LANGUAGE DIBOL 4-1 4-2 DIVISION RECORD and Field Labels A or D Field Types Initial Values PROCEDURE DIVISION 4—3 4—3 4-4 — 4-4 4-5 4-6 4-6 4—7 4—9 Manipulation Statements Moving Alphanumeric Data Moving Numeric Data Moving Records Calculating Arithmetic Expressions Data Data Conversion Formatting Clearing Fields 4-11 4-12 Data Using Literals and to Records Implement 4-13 4-14 4—14 4-14 Data Incrementing Data Input/Output Statements DISPLAY An Input/Output Statement An Input/Output Statement XMIT INIT and FINI Input/Output Statements READ and WRITE Input/Output Statements An Input/Output Statement ACCEPT An Input/Output Statement FORMS - 4-15 4-16 4-18 4-19 4-19 - - - - - 4-20 Program Control Statements IF A Program Control Statement A Program Control Statement STOP - - GO TO — Program Control Statement A CALL and RETURN Program Control Statements A Program Control Statement ON ERROR - - CHAIN TRAP - Program Control Statement Program Control Statements A and RETURN — Debugging Statements TRACE Debugging Statement A Debugging Statement NO - TRACE A — 4-20 4—21 4—21 4—21 4-22 4—23 4—24 4-25 4-25 4-26 A-l APPENDIX A GLOSSARY Glossary-l Index—1 INDEX FIGURES 3-1 Arrangement of Logical Units 3—2 Flowchart of INIT iv Operation on Devices 3-5 3-7 PREFACE DIBOL to the introduces you operating procedures, units, and programming conventions associated with logical related Actual installation procedures the COS-310 Operating System. to the hardware and mass storage media configurations are contained in This manual language, the COS—310 Release This manual does Notes not attempt is It Installation Guide and to written puter concepts. the following categories: (AA-D759A-TA). comteach fundamental programming or for people who fall into one or more of programmers unfamiliar with DIBOL or COS—310 programmers of DIGITAL's equipment configurations Inexperienced—but-interested people seeking to understand 0 Experienced 0 New o of operation The COS-310 New User's Guide is Reference Manual (AA-D647A-TC). ORGANIZATION OF THE the COS—310 a supplement to COS—310 the System MANUAL audience. is written to meet the needs of a diversified don't feel obligated therefore, find familiar information; may, Three of the four chapters contain ex— to read through such material. to guide you in practicing the skills associat— amples and/or programs or advanced Information on ed with chapter information. particular applications is found in the COS—310 System Reference Manual. This manual You CHAPTER 1 provides a general hardware associated with the the programs within COS—310. CHAPTER 2 describes Emphasis is given to introduction COS-310 to system, COS—310, and a a listing functional a the procedures for operating the Monitor and editor commands. COS-310 of the view of system. 3 CHAPTER explains the use of logical units in COS—310 the Operating unit within a mass storage device, the logical The System. logical unit table, and logical unit numbers are explained according to manner of assignment, use, and arrangement. CHAPTER amples 4 introduces and explains the DIBOL illustrate many DIBOL statements. NOTATIONAL CONVENTIONS FOR THIS language. Executable ex— MANUAL Press the RETURN key following information you input through the key— It is assumed board. No special RETURN symbol is used in this text. that you will press the RETURN key at the end of each statement line, after a response to a program display, and at the end of each command. to format minimize the probability of confusion with respect the characters and content of between and COS—310, example dialog you which you must input are printed in red. To uppercase alphabetic characters within program statements exactLowercase characters in a program statement are symbolic ly as shown. characters which are representations of specific names, numbers, or required in a particular application. Enter COS-310 will fields in the example lower case characters Although not recognize lowercase programs in this manual to make reading easier. characters, are the printed in comment upper and Monitor and editor commands are spelled out rather than indicated by their two-character However, when you type these com— designations. The exceptions to mands, you only need to use the first two letters. this first—two-letter convention are the RUN command, the Line Number RUN only requires Line Number command, and the Number command. R; the Number command requires the statement line number. requires LN; The following symbolic representations Symbol [ AV [ are used: Meaning character Insert one Make choice a space. between the items contained within the braces. ] dev Decide within Use the media. whether to use the brackets. the optional items contained three-character designation of the mass The first two characters designate the vi storage type of Symbol Meaning the indicates is operating. media. The third character which the mass storage media indicates indicates indicates DK RX DY cmndfl Command file pronam Program name. filnam Unique Channel Numeric unit or label an an an RK05 RXOl RX02 disk. diskette. diskette. to data assigned a file. expression associating a character-oriented a label Reference on name. name to drive number to a logical input/output device. assigned to a time of their in statement a DIBOL pro— gram. Other The symbols following are explained terms are of the at this text. Meaning Device media are also called mass or disks diskettes and/or Device type Drive number data Device are storage media. on identifies in refers the These are the operating system stored. to the the the order in which cabinets. media when type. are which refers to the hardware drive which contains the mechanisms to read or write information onto or from a mass storage media. located terms in particular importance Term Other use. explained in the Glossary. it is the device loaded types into a are device 1 CHAPTER INTRODUCTION 1.1 TO COS-310 OVERVIEW is disk-resident operating system that operates on the DataDECstation 78, Datasystem 310 (D310), or DECstation 88 hardware configuration. is an COS—310 development applications tool for data processing users who do such typical business applications as order entry, inventory control, back—order processing, sales and profit analysis, and accounting. COS—310 system 308 1.2 a (D308), HARDWARE REQUIREMENTS Minimum hardware required: of 16K bytes of memory). 0 Datasystem 310 (D310). 0 Datasystem 308 (D308). 0 DECstation DECstation Up 4 to drives. of the following (with a 78/50, 78/70, 88/70, or 88/80. (The RLOl 88/80 is not supported by COS—310.) Optional hardware 0 One with D308 or DECstation minimum on the 78: RX01 floppy disk drives, or up to 4 RX02 floppy disk (RX01 and RX02 drives are not supported on the same system.) 0 One LA8, Optional LQP, hardware or LA120 with D310 0 Additional memory up 0 Up to 4 drives RX01 (RX01 printer. to or a DECstation system total of 64K bytes. floppy disk drives, and RX02 88: drives or are up to 4 RX02 floppy not supported on the disk same system.) 1-1 1.3 to 0 Up 0 One 4 RKOS LA35, cartridge disk drives LA36R0, LQP, LAB, LA8A, (D310 only). LA120 or LP05 printer. COS-310 FUNCTIONAL VIEW OF provides the Operating System needed for applications develop— and execution on the D308, DECstation 78, D310, and the DECstaintion 88 hardware configurations. The COS—310 System Operating cludes a Monitor, a high-level programming language (DIBOL), system and system utility programs. COS-310 ment 1.3.1 The System Monitor operation is controlled through the system Monitor. The Mon— divided into two parts: one residing in memory (a portion of media. the hardware) and the other residing on the operating system The Monitor controls program execution, maintains file directories, controls stores all of the I/O handlers necessary for the system, and the source text editor. Software itor is The source text and editor uses line numbers as a reference for inserting, information. The editor can sequence line numbers. to comes the the editor through resequence Input and from the editor can be displayed on the screen, keyboard. Output listed on the printer, or written to a mass storage device. deleting, 1.3.2 A changing program High-level Programming Language Business Oriented Language (DIBOL) as its proof statements which are divided consists between the Data Division and the Procedure Division in a program. statements are much like English verbs and are mnemonic in na— These 4 of Each of these statements is introduced in this ture. Chapter and treated in detail of Chapter 1 of COS-310 System Reference manual Manual. COS—310 uses gramming 1.3.3 DIGITAL's language. DIBOL System Utility Programs COS-310 includes various programs written to perform specialized functions in the overall operation of COS—310. These are introduced below and are described in the COS-310 System Reference Manual. 1-2 INTRODUCTION TO COS-310 A program called SYSGEN lets another mass storage device for lets you change the I/O handlers utility onto and to variety of disk and operations using conversato adapt these (You system operating start—up and backup, the copy installation configurations. perform prompted by the SYSGEN printer tional you statements a program. The COS-310 Operating System depends upon the proper use of logical A units 3 of this Data File manual). (See Chapter Utility program unit (DFU) lets you make and examine assignments. Logical logical unit can be input to DFU from the keyboard, from a file assignments DFU stored on the system device, or from a table in the edit buffer. lets current you display logical unit assignments on the screen or output them to the printer in either of two formats. You the can create a DIBOL program that COS-310 utility program PRINT. describe the report and A flowchart generator which illustrates the then run the will You generate first command program (FLOW) lets sequence of program a create file report a through generate you using by command file to PRINT. a flowchart logic. The Peripheral Interchange Program (PIP) transfers files from one vice to another, replaces an existing file with a new file, and bines data files. PIP accepts input from the from or keyboard disk and produces output on the screen, the disk, or the printer. decom— the COS-310's reorder a file data multiphase SORT lets you containing records into a will indepenSORT fixed-length specified sequence. dently umes sort within each volume the file. of a multivolume file and then merge the vol- File Conversion program (FILEX) can copy a file a COS—310 onto flexible diskette in a format directly readable by the IBM 3740. IBM files on flexible diskettes can also be converted to COS-310 format. FILEX allows various file transfers not usually possible in functions of COS—310. The A MENU created program lets you select and execute commands from a previously command file. The MENU program can potentially eliminate many operator errors. DIBOL aids in A (DDT) Debugging Technique program debugging. dump—and—fix technique (DAFT) lets you search for, examine, list, and DAFT is also used to make minor to a change records. data changes file. A cross—referencing (CREF) provides an alphabetical program listing each of label all labels used is defined, and in a DIBOL program, the line number the line numbers where each label is where used. INTRODUCTION TO COS-310 1-3 CHAPTER OPERATING 2 COS-310 needed This chapter provides the basic information COS—310 system. Emphasis is given to the use of the itor commands during program creation and editing. This basic is information presented in a to operate keyboard and logically applicable the Mon- order. is to various COS-310 Operating System software applicable hardware configurations, starting instructions for particular hardware and loading instructions for various devices are not contained here. The COS-310 Release Notes and Installation Guide is the best written source for this information. Because 2.1 USING The keyboard THE KEYBOARD enter data and interact with the computer. identical to a typewriter keyboard. Unlike on a typewriter, does not pressing a key on the keyboard automatically a character. display Pressing a key causes the selected character to be sent to the Central Processing Unit (CPU). A will then program this character on a the screen. display key Consequently, pressing will have no effect if the CPU is not running or is running a program that is not waiting for input from the keyboard. Most of the The CAP LOCK by COS-310. Adjacent COS-310 to allows you keyboard is key If the must it is main recognizes to be locked for alphabetic not locked, only numbers keyboard keys these may as The following keys have special other keys operate as if on a pressed register must still be double-character key. 0 RETURN the command Pressing tor be a another smaller numeric key of numeric keys. to used panel. set functions when normal be characters to will be accepted. used with All COS-310. The shift typewriter keyboard. use the top character on any key edikey indicates the end of COS-310 Monitor and lines, of program statements, and of re5ponses to program RETURN inquiries. 2-1 DELETE O key the DELETE key erases typing errors made while entering Moni— editor commands. The DELETE key erases the last character or space typed and thus allows you to make character—by-character correcIf It can be used on a line prior to pressing the RETURN key. tions. the RETURN key, you find an error on a line after you have pressed make corrections with the Monitor Number commands. Pressing and tor o CTRL key The CTRL (control) key is held down is while another pressed. key These combinations are represented in this manual by using a slash (/) combinations between CTRL and the designation for the other key. The and their effect are shown below. Terminates CTRL/C and CTRL/O the Stops Characters are this execution returns control of to the currently the Monitor. display of sent the to or a Resumes CTRL/S Suspends output to the screen char— neither loses No input command. is control. Output but by CTRL/Q. CTRL/U Deletes an CTRL/Z Indicates the end of and terminates automatic input line numbers. Deletes the contents of a line if used before pressing the RETURN key. These Use entire line if pressed before typed. BACKSPACE, COPY, BREAK, ESC, LINE FEED keys and their characters are not part They produce unpredictable results. keys of the COS—310 character ERROR CORRECTION the DELETE the key RETURN line before CRTL/U to correct errors on a you The DELETE erases individual characters; key. key or press the CTRL/U combination erases an entire line. want to make a change after you press RETURN, 2-2 RETURN. other preceding combinations require neither a RETURN key nor any the system performs the function as soon as the com— key; O 2.2 or nor resumed terminator bination is set. the screen. initial CTRL/O will CTRL/C stop output suspended by CTRL/S. CTRL/Q terminates the program is possible while a CTRL/S is in The program characters on screen after an Another CTRL/O discarded. loss of characters. acters running OPERATING COS-310 If use you find an error or the Number command. 2.3 ERROR MESSAGES kinds COS—310 is programmed to display error messages for certain These messages are referenced in Appendix C incorrect information. the COS-310 System Reference Manual. 2.4 CALLING THE Once and/or disks on these and Installation Guide), the date in are is turned mounted and the system in the COS—310 Release Notes for a date by displaying: instructions are the Monitor asks 8.00 COS MONITOR V DATE? Enter of MONITOR KEYBOARD the diskettes and booted (all of the form: dd-mmm-yy .DA where: If dd is mmm are yy are you the the the number representing the first three letters of last two digits of the type anything before the date, the day of the name year the month designation Monitor the month of displays: DATE? If You you enter the BAD DATE must enter change date in the wrong a the Monitor displaying indicates that it is ready the COS MONITOR message. 2.5 MONITOR AND The Monitor USING Enter (.) Monitor all displayed by acter or a the Monitor displays: \ date whenever system date. the form, blank booted or accept further whenever commands you by EDITOR COMMANDS and editor the system. space to is occurs commands An error between immediately message is the dot and the dot following displayed if a char— the command. The cursor will flash after the last character or space on a line and will wait for you to either enter more information, press CTRL/Z, or on press the RETURN key. Pressing CTRL/Z will erase whatever else is the same line. OPERATING COS-310 2-3 2.5.1 DIRECTORY, FETCH, and LIST Commands The three commands (DI, FE, and LI) are used information contained on a system device. Type DI/T A display to directory similar the directory of all the following will to to files appear display on on or print the device. the system the screen. ~DI/T 03—AUG—78 DIRECTORY NAME TYPE LN DATE COMP v PIP v 14 10 MENU v 05 18-JUL-78 19-JUL-78 19—JUL-78 SYSGEN PATCH CREF v v BOOT v SORT v LINCHG v FILEX v 19 05 07 02 15 02 23 02 02 07 12 15 16 15 v DKFMT v DYFMT v DFU v DAFTA s DAFTB s PRINTO PRINTl PRINT2 s s s PRINT3 PRINT4 s s PRINTS PR!NT6 PRINT7 PRINT8 Type on The s s s s PRINT9 FLOWl FLOW2 FLOW3 FLOW4 KRFSRT s KREF s TRMTST s s s s s s LPTEST s FLOPXX s (0173 FREE DI the to list 19—JUL-78 l9—JUL-78 l9-JUL-78 l9-JUL—78 l9—JUL-78 19—JUL-78 l9—JUL—78 19—JUL—78 19-JUL-78 19—JUL—78 l9-JUL—78 04 l9-JUL—78 12 l9-JUL-78 05 19-JUL—78 15 19—JUL-78 09 l9-JUL-78 13 19-JUL-78 06 l9—JUL—78 09 l9-JUL-78 11 19—JUL-78 06 19—JUL-78 10 19-JUL-78 11 l9—JUL-78 01 19—JUL—78 06 19-JUL—78 05 l9-JUL-78 06 19—JUL—78 07 19-JUL-78 BLOCKS> the directory on the printer rather than to display it screen. directory gives creation date 2-4 l9—JUL-78 l9-JUL—78 l9-JUL-78 Of the name, each file. OPERATING COS-310 the type, the length in blocks, and the and three types of files: (S), system binary (B), source or altered by cannot be edited files The and the (V). binary system edit files can be called into the source the usual editing commands; Do not edit or alter programs which come with your buffer and edited. notifiinitial system unless you are advised to do so in an official to software from Unauthorized DIGITAL. cation (a changes you patch) There are will void Type FE sdftware your and memory) and buffer. An the file warranty. name the clear to edit buffer (a work area into the buffer. program from the directory displays the contents of the edit source a copy LI command in edit ,FE KREF ,LI to CTRL/S and CTRL/Q respectively to start and output stop Use CTRL/C to stop the output to the printer and return Use screen. trol 2.5.2 The the to RUN, The Monitor. SAVE, and WRITE command is used Other commands and (R) RUN grams. mand to compile and commands SAVE device. The source a execute and WRITE SAVE storage stores program. this to execute binary (V) (B) or system option switches are used with the RUN a DIBOL are (SA) compile teration of the the FETCH the used to store a binary (FE), LIST TRMTST (Terminal gram COS-310 software. the and a and on a programs program and WRITE (LI) com— mass (WR) explanation: enter RUN, SAVE, and WRITE date, and step through the and of use the the order duplicate of a interrelationship distributed program, rename the program work with the duplicate. Test); pro— program. stores the system, familiar with source source, source Example exercise exercise, you will make program, Use Commands following exercise illustrates commands. Initialize this exercise to become of commands. In the con— to source prevent al- source combination to display the pro— this is a program distributed with the ,FE TRMTST _LI Before a source program can be executed, it must be compiled (a special that converts a high—level programming language into an program inexecutable binary program). It is good programming to practice clude the name of the file whenever you use that file in a Monitor is command. If the source file is in the edit buffer, the file name optional. Compile the source program by typing: .RUN COMP,TRMTST OPERATING COS-310 2-5 the the compiler program, slight delay while COS—310 loads will output a two—part compilation listing (Data and Procedure of To the Divisions) and a storage—map listing. suppress printing imif a use the or are without these /N option listings you printer, After a printer mediately oRUN When the the after RUN COMP,TRMTST command (leave no space). COMP,TRMTST/N program has been compiled into a binary program and is stored in the binary scratch area (a work area in memory), MONITOR message will appear. source temporarily the COS To this store device, newly compiled program as a binary file following command (LEARN becomes its the type on the new name): system LEARN -SA file The name The program can now be executed with the RUN command. is needed following this RUN command because the program is being exe— cuted from the system device rather than from the binary scratch area. It is good programming practice to include the name of the binary file If the file whenever you use that file in a Monitor command. binary is in the binary scratch area, the file name is optional. -RUN LEARN Questions from the appear DO If tor on the YOU something or boot WISH ENTER is it LEARN) program (you are calling first question is as follows: should PARAMETERS? either start type CTRL/C and over to date. return by entering the the Moni- program written to test the terminal, feel free to YES (Y) and NO questions in a number of ways. numbers be used. responses as well as other characters and may your imagination, but remember what happens with each response. TRMTST anSwer the (N) TO The else happens, the system and Because Use TRMTST screen. a displayed to resume CTRL/S to temporarily halt output and CTRL/Q output. but data will be lost. After a CTRL/O comCTRL/O will stop output mand, only another CTRL/O or a CTRL/C will get things going again. Use The TRMTST program (renamed LEARN in this excercise) is written in a it continues to execute until you either stop it with closed so loop CTRL/C itor; correct you turn the system off. CTRL/C returns control to the Monturning off the system requires a complete power up, boot, and date entry before the COS MONITOR will appear. or If you use the SAVE command to copy LEARN back into the directory, RE— will PLACE? be displayed on the screen. The directory already contains a binary file named LEARN so the system wants to know what to do about an attempted duplication. 2-6 OPERATING COS-310 (NO) N Type 'SA this at time. (Yes) A Y will replace file. the LEARN REPLACE? N The WRITE followed by LEARN will store the newly named program because no source (S) file named LEARN is in the the Names must be used with the SAVE or WRITE command, or directory. Monitor will display ERROR IN COMMAND. A name not found in the directory will initiate the message FILE NOT FOUND. command without any questions LEARN °WR Type DI/T DI or to see this file new name (LEARN) in the directory. 'DI/T After device, the file file command erases it A source a or will binary file is copied from the edit buffer onto remains in the edit buffer until an a FETCH remain (FE) in the is If compiled. area, see Chapter 8 program scratch a of command binary a storage (ER) ERASE replaces it. scratch program is too big the COS—310 System until another fit in the binary Reference Manual. area to 2.5.3 ERASE The command clears the edit buffer. it imErasing makes retrieve erased information from the edit buffer. Always (WRITE) information that you want to keep before using ERASE. ERASE possible store Command (ER) to If the buffer is terfere with new 2.5.4 Use information Line Number line numbers the old entered erased, not contents through Line numbers to write for are the will in- numbers location are buffer keyboard. Command a program with COS-310. for and are used editing cross-referencing in conjunction with system necessary of the entered manually or with a These error and programs. Line Number (LN) command. Line Number program development, enter either a number or the command whenever the system displays a dot (.). The highest line number that the system will accept is 4095. Since the edit buffer is During (LN) not large enough to hold the 4095 lines, line numbers You can LN command. If you don't designate values, and is incremented by 10. 100 designate starting number and the are incremented. increment number in the the numbering begins with OPERATING COS-310 2-7 one space after the LN your increment value after a If you want the increment to enter the starting number. Leave and your starting which follows your be number. enter comma the same as the starting Enter number. starting number, only to indi— Automatic line numbers will continue until you press CTRL/Z cate that data has stopped. Press RETURN before CTRL/Z or a input a dot line of input will be lost. After CTRL/Z, the system displays If you press LN after a CTRL/Z, the incremented numbers continue (.). if as Use LN and new parameters they were before you pressed CTRL/Z. want to increment values. you change .LN .LN 50 and increment by .LN 50: ;Line numbers begin at 50 and increment by 10. .LN 50:15 ;Line numbers begin increment by 15. 2.5.5 ;Line numbers begin Number the Use or and increment 10, ;Line numbers begin at 100 by to continue to increment ;numbers parameters according ;established before the CTRL/Z. and Number at at 50 50 and 50. RESEQUENCE Commands command to edit source programs. Automatic Number command. Only entire lines can be edited with the line must be stopped with a CTRL/Z before editing with the numbering Number command as you just be completely can be want it; done. Type the line number and the entire if you are replacing a line, the old line line will deleted. Use CTRL/U to erase an entire line before you Use the DELETE key to erase individual characters beRETURN. press A line number followed by RETURN fore you press RETURN. will delete the contents of the line. Type LI to display the edited program the on screen. the RESEQUENCE (RE) command to make increments This consistent. The RESE— RESEQUENCE standardizes the increment between line numbers. Line Number the QUENCE command uses the same numbering procedure as In place of LN, you type RE. command. Use Be .RE ;Line numbers begin at 100 .RE 20 ;Line numbers begin at 20 and increment by 20. .RE 20: ;Line numbers begin at 20 and increment by 10. .RE 20:5 ;Line numbers begin increment by careful that the highest line the LI 2-8 OPERATING COS-310 command to display the at 20 number results of and and by 10. increment does not the RE exceed command. 5. 4095. Type 2.5.6 DELETE The DELETE Once a Command is used to erase programs from the is the information is deleted, it is gone; program caution should be exercised when using this command. Great (DE) command Because you created, named, out altering your operating and distributed with your COS—310 must DELETE, you stipulate (preceded by /) the that you are stored system. Do withyou can delete it delete any of the programs LEARN, not Operating System software. both the deleting. directory. wiped out. file The name type When using and the type of file in of file is listed directory. 'DI/T LEARN/B 'DI/T 'DE A review of assure erased the directory before and after DELETE will the command that the Once the file is you proper file has been erased. it cannot be referenced or accessed; it is gone. OPERATING COS-310 2-9 CHAPTER LOGICAL 3 UNITS storage logical unit is a data file storage area located on a mass device. Logical units are sequentially ordered on a mass storage deThe DIBOL language uses a logical unit number reference a vice. to unit. A logical logical unit table maintained on the system device links a logical unit number to a logical unit. A number identifies an entry in the logical unit table. information which points to a specific data file contains area One logical unit table can access storunit). storage (logical areas contained on many different devices. age The The logical unit entry This enhances storaccessing of data through the logical unit table age flexibility because the same data file storage areas can be referenced by different programs in different ways. be may Logical units reassigned (given different numbers) without changing the contents of the data file, and logical unit assignments can be made or remade at each system start-up or between programs being executed. 3.1 LOGICAL UNIT TABLE The logical unit table maintained on the system device is a centralized index for logical unit assignments. This table contains and disfor devices plays a list of unit numbers, device designations being and in the of each logical unit (1 segment used, length segments A logical unit table disequals 16 blocks which equals 8192 bytes). play is similar to the following example. UNIT DEV. l 2 3 4 RXO RXO RXO SEGS. 0001 0001 0001 RXO RXO 0001 0001 5 6 7 8 -UNDEFINED- 15 -UNDEFINED- -UNDEFINED- -UNDEFINED- 3-1 The table also contains but does first block and the address of logical unit the of address the not display the handler. starting bearea table only knows where a data file storage file's in that The data how reserved area. are and many segments gins block first name, volume number, and creation date are stored on the of the data file. The logical unit 3.2 LOGICAL UNIT NUMBERS Unlike data file directory information which is referenced and acfile name, information on a logical unit is referenced by unit number and accessed through the logical A unit table. of 15 logical unit numbers can be assigned in a table. cessed by logical maximum 3.3 HOW LOGICAL UNITS ARE units and done with Assigning logical cal unit table is ASSIGNED associating the Data them File with Utility numbers (DFU) in the logi- program. is an interactive program which allows you to designate the device which you want the data to be stored and the number of segments you want reserved for the data. The DFU program goes to the that device and determines where on that device your data storage designate you The starting address of the first in area will be located. segment the area and its length in segments is then recorded in the storage The starting address of the first segment is not logical unit table. DFU on displayed by any of the options of DFU. Option switches (/K, /B, filnam) used with unit assignments in different ways. DFU allow you to make logi— cal 3.3.1 Assignments Through DFU/K allows you to make or the to information putting through makes logical unit assignments ~ 13% N F v’% .‘66K lij0,10 2:RX1,10 3'Rxo,15 l°=END 3-2 LOGICAL UNITS Keyboard (DFU/K) inchange logical unit assignments by the The following exercise keyboard. with the /K option. 3.3.2 Assignments From the Edit Buffer (DFU/B) to create a logical unit table in the edit buffer and then the unit assignments and copy the logical automatically make table onto the system device. table The following exercise creates a in the edit buffer and then makes logical unit assignments with the /B of The .ER command clears the edit buffer to prevent mixing option. and new entries. old It is good practice to use END to indicate your DFU/B allows you last to entry the oER . -0100 -0200 -0300 .0400 RXO,2 RXO,1 RXl,l RXl,l -0900 END -RUN DFU/B V8.00 MONITOR V 8.00 Assignments From DFU COS 3.3.3 way to the taining time by using exercise ing new a Named File (DFU,filnam) and name a file con— file can then be used at any the DFU command the file name. The followmakes logical units assignments with the filnam option. .ER command clears the edit buffer to prevent mixing of and old entries. Another The logical unit table. assign logical units for DFU. This input is to create named followed by °ER ~0100 -0110 -0120 °0130 RXO,1 RX1,1 RX2,15 RX0,05 '0200 END 'WR TABLEl 'RUN DFU,TABLE1 DFU V 8.00 COS MONITOR V 8.00 LOGICAL UNITS 3-3 HOW LOGICAL UNIT ASSIGNMENTS 3.4 ARE LISTED DISPLAYED AND option switches (/D, /DL, /E, /EL) used with DFU allow play or list logical unit tables in different ways. The to you dis- unit the table /D and /DL options output a logical containing the device on which the unit resides, and the number of segnumber, The in reserved ments each unit. The /E and /EL options output an expanded table containing the logical unit number, the device on which the unit resides, the number of segon ments reserved in each unit, the name of the file contained the the sequence number of the file, the date the file was created, unit, and the actual number of segments in the file. When is not 3.4.1 To the /E or /EL options, you must have unit assignments mounted on the logical mounted, an error message is displayed. Display Assignments display .RUN list a .RUN 3.4.3 To -RUN of on RUN (DFU/D) logical assignments current the Printer the on screen, type: (DFU/DL) logical assignments a an list Expanded Table of assigned, on the printer, type: data files on the Screen and the logical (DFU/E) units on which which the the type: DFU/E an Expanded Table print a list of data files assigned, type: - 3-4 current Screen system. a DFU/DL List 3.4.4 are table display are of Assignments Display files To table the If DFU/D List 3.4.2 To a on which device devices all use you contain DFU/EL LOGICAL UNITS on and the Printer the (DFU/EL) logical units on files 3.5 ARRANGEMENT 0F LOGICAL UNITS ON MEDIA data file storage areas sequentially ordered on mass The method of storage differs between devices containSequential ing only data and devices containing the operating system. order on data media is from the beginning of the media moving in inunit The first cremental order toward the end of the media. logical the on data media is at the beginning and data storage units are se- Logical units are storage media. quentially numbered through the remainder Sequential sequential order the on of the storage media. from the operating system media is different Rather than beginning at the front of of media. end the the input from order on data media. the logical units are the media, in a push—down sequence. are assigned The first storage unit Numbers second When a created is temporarily placed at the end of the media. is first unit is pushed toward the front of the unit the created, This can continue until media and the second unit remains at the end. disk is full or the maximum number of units has been desig— area the more units The first unit always goes nearer to the front as nated. the This arrangement on the system device is to added at end. are files. allow the unused space to be between the programs and the data Any new programs can then be added in the unused space. This is illus— trated in Figure 3—1. SYSTEM DEVICE unit 3 Logical unit 2 Logical unit 1 Logical Unused Unused Space User (Source NON-SYSTEM DEVICE Space Program & Binaries) System Programs Logical unit Monitor Logical unit 5 Directory Logical unit Beginning Figure of the 3—1 Device Beginning Arrangement of Logical Units of on the 6 4 Device Devices LOGICAL UNITS 3-5 3.6 DIBOL HOW A PROGRAM LOGICAL UNIT NUMBERS USES uses a INIT statement following explanation illustrates how an table. unit in the location to a number unit logical identify logical first the to which The table location contains information points The first unit on mass storage device. of an assigned logical block volume block of data on a logical unit is reserved for the file name, The creation 3-2. and number, in Figure If a unit logical date. number is A flowchart executed, the logical unit table. an INIT operation is shown the when time, compilation number unit the uses logical program specified is statement INIT of at The information stored in the table access the finds the device where the logical unit (the storage area) is located the and reads the file name and volume number from the first block on to the unit is from the The file name unit. compared logical logical file name as specified in the INIT statement. to If of file file the the are the is the specified logical logical unit, fied one volume program verifies that If volume one is on the unit. the program associates the logical unit with the speciThis association of channel with logical unit number. the names channel on same, completes the purpose of the INIT statement. when If a logical unit number is not specified at time, compilation the INIT statement is executed the program checks to see what mode was mount a The program then displays specified in the INIT statement. to the to operator specify a logical unit number. message prompt is unit the device After the operator specifies a logical number, first block is the read, comparisons and verifications are found, made, and the channel number is associated with the logical unit. different is If the file name on the first block of the logical unit than the file name specified in the INIT statement, the program checks If the specified to see what mode is specified in the INIT statement. input, the program displays a mount message to prompt the opAfter the number. operator specify another logical unit a specifies logical unit number, the device is found, the first block is read, comparisons and verifications and the channel are made, number is associated with the logical unit. is mode erator to the file names are different and the specified mode is output, checks to see if the file name on the logical unit is a tempo— If the file name is temporary, the replaces program rary file name. with the name specified in the INIT statement and the name temporary associates the specified channel number with the logical unit. If the prOgram If the file names are different, the specified mode is output, but the file name is not temporary, the program displays a replace message to the prompt the operator to decide whether to replace the file name on unit. If the name is replaced, the specified channel number logical If the is not re— is associated with the logical unit. file name the entire placed, operation goes back to the mount messages which for a new logical unit number. ask 3-6 LOGICAL UNITS INIT (channel,mode,lllnam[,loglcal unlt #]) Wu VES Loglcal unlt # apocmcd? Mod. = ouiput 7 YES Dlspllv Dlsplly "MOUNT "In-m #01 "MOUNT "In-m #01 FOR INPUT" FOR OUTPUT“ Walt for IogIc-I unll # to ho omorld Uu logic-I unll # In n lndox Into Ioglc-I unlt tublu Flnd dcvlco com-Inlng dam m. and road flat block "In-m Ill. name In = first block? YES Volume # Mod. = 017 = output 7 "I. name In first block = YES lompornry Illa Dlsplay "REPLACE m. nlmo' #017" 'me name In Ilm block Rosponu = V? YES Auocllh channel wlih NO luglc-l unlt # Fllo hu bun INchd Figure 3-2 Flowchart of INIT Operation LOGICAL UNITS 3-7 CHAPTER THE DIBOL 4 LANGUAGE DIGITAL‘S Business Oriented is to run DIBOL, Language, designed commerical applications on COS—310 based systems. COS-310 will recognize no other high—level language programs. A DIBOL sion. of data program is divided into a Data Division and a Divi— Procedure The Data Division allocates data storage, designates the records and fields, determines the type of fields being names used or numeric), indicates the number of characters in each (alphanumeric The Proce— field, and may contain initial values assigned to a field. dure data Division consists of English—like information to develop programs. 4.1 THE DATA action statements used with DIVISION Division optionally begins with START. This nonexecutable issues a top—of-page command. A heading optionally follows a semicolon after START. COS-310 prints this heading at the of top the page. Any comment to accompany START follows a second semicolon. The Data statement The Data Division contains RECORD statements and field accompanying data information. The RECORD statement designates the beginning of a the group is called a record. RECORD state— group of data fields; ments control the location in memory where the data is stored during Unnamed records (records without labels) cannot be program execution. used for input/output operations. The RECORD statement should have a space but no punctuation between the word RECORD and the name assigned (optional) to the record. Field data information fields the designate always accompanies RECORD statements. Data type of information (alphanumeric or numeric), the number of characters, and optionally designate an initial value for each array is a The field. series of Fields optionally contain array information. same—sized entries within the same field. following example illustrates COS-310 ignores program. Division within an after the semicolon after START and PROC). Comments are optional and are used in program listings to explain and document the program. DIBOL An Data actual comments (except a source Example: START RECORD PFOl, I PF02, ;Record named XXPLIN. XXPLIN number. A7 A2 ;Account A25 ;Description. A2 I ;Invoice number. A8 PF03, A2 A8 A2 A10 I PF04, I PF05, ;Date. ;Amount. RECORD ACTNO, DESC, VENNO, INVNO, DATE, AMT, ACCT record. number. account ;Input A7 ;Account A25 5A4 A8 ;Description. ;Vendor D6 ;Date. ;Amount. ;Column headings. D8 RECORD A7 numbers. ;Invoice number. XXHDOl ,'ACCOUNT' A5 Al9,'ACCOUNT DESCRIPTION' V‘V“‘VD‘ A6 A7 A4 A6 A6 ,'DATE' ,'AMOUNT' RECORD ;Work variation (COS-310 4.1.1 area. D2,00 LINE, The ,'INVOICE' A4 in spacing ignores it) but and RECORD Field in is the for preceding convenience example and ease is of mandatory reading. not Labels A label are used to identify RECORD and field statements. can have any number of alphabetic and numeric characters (the first charThe six. acter is alphabetic) but COS-310 works with only the first A comma must follow labels referenced in the Procedure Division. are Labels label in a field statement; if no label is used, a comma must begin field statement. Without proper placement of punctuation, the in— formation within the Data Division will be incorrectly interpreted. Name and label are used interchangeably. The following example contains statements and comments from a Data Division. a a Example: RECORD 4-2 PFOl, A7 I A2 PFOZ, A25 THE DIBOL XXPLIN LANGUAGE ;Record labeled XXPLIN. ;Field labeled PFOl. ;Unnamed field statement. ;Field named PF02. Field Types 4.1.2 A - D or Numerics and the alphabetic characters A or D follow the comma first in a field statement. The alphabetic characters indicate the type of D A for numeric. for characters within the field; alphanumeric, Numeric characters before the A or D indicate the number of elements D within an array. or the Numeric characters after the A indicate number of characters in the field or in each element of an array. Elements in an with the use command or array can be referenced individually A subscripted label of subscripts. where statement a label is or can in combinations be used in any appropriate. used Numeric fields contain up to 15 characters. Only numbers can be if want to in numeric fields are fields; you required alphanumeric use punctuation. Calculations can only be done in numeric fields. Alphanumeric fields COS-310 character can can be contain part of up an characters. alphanumeric field. to The following example contains statement field size, and array information. 510 labels, A and D Any legal designations, Example: DESC, VENNO, RECORD A7 A25 5A4 ;Alphanumeric field. ;Twenty—five character field. INVNO, A8 ;Eight-character alphanumeric DATE, AMT, D6 D8 ACTNO, characters each. field. ;Six-character numeric field. ;Eight-character field. ;Five elements, four Initial Values 4.1.3 Initial values in the Data Division follow a comma after the type and character count designations. Alphanumeric initial values begin and end with single quotes. All spaces and characters enclosed between the are included in the character count; the single single quotes Numeric initial values do not require quotes. quotes are not counted. No spaces are allowed between numbers in a D (numeric) designation. Example: , A4 A6 A6 LINE, RECORD D2 ,00 , , ,'DATE' ;Alphanumeric initial value. ,'AMOUNT' ;Alphanumeric initial value. initial value on Record. ;Numeric initial value ;No Notice that only fields contain initial values. Initial values in the Data Division must agree in type and character count with the information defined 1n the type and character count designations. THE DIBOL LANGUAGE 4-3 4.2 THE PROCEDURE DIVISION The Data Division is separated from the Procedure Division by the non— PROC. This statement indicates that statement executable mandatory the Data Division is complete and the Procedure Division is to begin. Procedure Division contains DIBOL statements tion, input/output of data, program control, and The The following example dure Division. contains statements and for data program comments manipuladebugging. from a Proce— Example: l PROC READ, ;Open the printer. ;Open account file in INIT(6.LP) INIT(1,IN,'ACCTFL',2) XMIT(1,ACCT,EOF) ;Get the next account ;Move ACTNO to PFOl. PF01=ACTNO PF02=DESC PF03=INVNO ;Move description to print record. ;Move INVNO to PF03. ;Move date to print record. ;Move amount to print record. ;Start new page if needed. ;Print this line. ;Decrement line counter. PF04=DATE,'XX/XX/XX' PF05=AMT,'XXX,XXX.XX' IF(LINE.LE.0)CALL TOP XMIT(6,XXPLIN) LINE=LINE-l XXPLIN= GO TO ;Clear print ;Continue. READ STOP FORMS(6,0) XMIT(6,XXHD01) FORMS(6,1) TOP, record. ;Close account file. ;Close the printer. ;Stop program execution. FINI(1) FINI(6) EOF, input mode. record. ;Start a new page. ;Print column headings. a line. ;Set line counter to 55. ;Return from subroutine. ;Skip LINE=55 RETURN END 4.2.1 Data Manipulation Statements DIBOL data statements move fields data between manipulation between calculate arithmetic expressions, convert data records, one type of field to another, clear data fields, and format data. DIBOL uses the following destination 4-4 = source THE DIBOL LANGUAGE form as a data manipulation statement. and from interprets this COS-310 moved Data are the source that the contents of The destination is defined and named in the is a variable, a literal, or an expression. to mean the destination. Division. The source to data is moved from source to destination, the source remains The following example changed but destination is always altered. When tains data manipulation un- con— statements. Example: PF01=ACTNO PF02=DESC PF03=INVNO The PF04=DATE,'XX/XX/XX' PF05=AMT,'XXX,XXX.XX' LINE=LINE-1 ;Decrement XXPLIN= ;Clear print next amples account ;Move ;Move ;Move ;Move ;Move two are number description invoice date to amount number and will work if you to print record. print record. to print record. print record. to print record. line counter. record. examples contain data manipulation executable to input statements. them These ex- properly. Example: RECORD FLDl, A7, 'DEVICES' ;Initial value is DEVICES. PROC FLD1= 'SEGMENT' DISPLAY(0,0,FLD1) into FLDl. contains SEGMENT. ;Move SEGMENT ;FLDl now STOP Example: RECORD FLDl, A7, FLD2, D7, 'NUMBERS' 1234567 ;Initial value is NUMBERS. ;Initial value is 1234567. PROC FLD1=FLD2 ;Move DISPLAY(0,0,FLD1) XMIT(8," ') DISPLAY(0,0,FLD2) ;FLDl 1234567 to FLDl. contains 1234567. ;Execute a carriage return/line ;FLD2 still contains 1234567. now feed. STOP 4.2.1.1 Moving Alphanumeric Data data alphanumeric source moved to an alphanumeric destination by a statement is in destination. If the manipulation left—justified source has fewer characters than the is data destination, and the characters in the destination are unleft—justified rightmost If the source has more characters disturbed. than the destination, An data is left-justified and the rightmost characters THE from the DIBOL source LANGUAGE 4-5 into moved of are not the moving the larger a illustrates The following example destination. into a smaller destination. source Example: RECORD ACCT 'BALANCE' 'TOTAL' HEADl, A7, HEADZ, A5, ;Seven-character alphanumeric field. ;Five—character alphanumeric field. PROC HEAD2=HEADl ;Move the seven ;five-character HEADZ) DISPLAY(0,0, ;Disp1ay the characters the into area. five—character area. STOP Alphanumeric only be moved 4.2.1.2 records and fields are used in moving into fields, and records can only be Moving Numeric Numeric source tion statement characters If source characters destination, data characters moved. more not are can Fields into records. Data data moved to a numeric destination is right-justified in destination. than has data. moved data by a If source manipulahas fewer filled. is right—justified and zero than destination, the leftmost source sum into the a following example performs a calculation, moves and displays the answer on the screen. The sum of area, BILLS + TAXES + MORTG produces a 4 digit result (1075). Since costs is only 3 digits in length, the most significant digit is lost. The destination Example: RECORD A D2, D3, BILLS, TAXES, MORTG, RECORD D3, 75 800 200 ;Two-character numeric field. ;Three-character numeric field. ;Three-character numeric field. B D3 COSTS, ;Three—character numeric field. PROC COSTS=BILLS+TAXES+MORTG ;Calculate ;store XMIT in to source four-digit three-digit destination. ;Disp1ay destination (8,B) and (RECORD B). STOP 4.2.1.3 Moving Records large If moved Records with alphanumeric source has left—justified fewer and a data statement are treated like manipulation fields. Source and destination are record areas. characters than defined for destination, data is the rightmost characters in destination are undis— turbed. If source 4-6 DIBOL LANGUAGE THE has more characters than defined for destination, data is left-justified moved to destination. The the the and following example moves record and named ENGR rightmost the contents ENGR displays source of on characters the record the screen. named are not FRMR into Example: RECORD ;Record named ENGR ENGR ;Five-character unnamed field. ;Six—character unnamed field. ,A5 ,A6 RECORD ;Record named FRMR FLDl, All, 'OCCUPATIONS' FRMR ;Initial value is OCCUPATIONS. PROC ;Move OCCUPATIONS into ENGR. ;DISPLAY record named ENGR. ENGR=FRMR XMIT (8,ENGR) STOP 4.2.1.4 Calculating Arithmetic Expressions Arithmetic expressions are used as the source in a data manipulation value of the expression is moved to the destination. data elements, Expressions can contain numeric elements, subscripted literals, variables, and arithmetic operators (#, #, +, —, *, /). The statement. The arithmetic (#), adding performed are calculated The and operations of converting to internal code (#), rounding subtracting (—), multiplying (*), and dividing (/) on of the is a priority basis. The value expression (+), the value is moved to the destination. following example performs calculations, and displays the record named TOTAL. stores in them destina- a tion, Example: START RECORD QORDER, D4, 0002 ;Four—digit numeric with initial ;value. UCOST, D4, 0200 ECOST, D10 Y, 5D3,000,007,100,025,023 ;Four-digit initial value. ;Ten-digit numeric field. ;Five RECORD X, TOTAL D5 with elements array ;three-digit initial values. ;RECORD named TOTAL. ;Only field in RECORD TOTAL. PROC and in ECOST=UCOST*QORDER ;Multiply X=X+l ;Add one to X and store in X. ;Value of X determines subscript Solve equation and store ;of Y. Y(l)=Y(X)+(25*Y(2)+Y(3))/Y(4) X=Y(3)+Y(4)+Y(1) XMIT (8,TOTAL) store ECOST. ;in first element of Y. ;Add elements and store ;Display RECORD TOTAL on in X. screen. STOP THE DIBOL LANGUAGE 4-7 char~ arithmetic operator # converts an alphanumeric or a numeric the for returns code then internal code and to its equivalent use as a decimal value (see Appendix A for equivalent internal codes). This converting to internal code is expressed with # inserted prior to The acter the in source the destination If a data = manipulation statement. #source the code is in a used calculation, preceded by # takes place first and then the arithmetic calculations are the value is moved to destination. character conversion done and Example: RECORD CUSNAM, A1, FACTOR, D2, RATING, A3 '0' ;Initial value Q 02 ;code 50. ;Initial value 02. equal to decimal ;Alphanumeric field. PROC RATING=#CUSNAM*FACTOR DISPLAY(0,0,RATING) ;Multiply and store in RATING. ;Display alphanumeric field RATING. STOP Another use rounding of # is numbers in and # is 1 7 for through conjunction with the digits When them into certain formats. manipulating placed after the element being rounded and bedigit indicates how many characters are removed used for rounding, fore the The digit. from the right of the number. If a number larger than 7 is used, the number is divided by the maximum number plus one (7+l=8) and the remainder is the number of characters to be removed. This is modulo 8. The and to following exercise rounds numbers, moves them displays the record wherein the answer is stored. a destination, Example: START RECORD SUBl, TOTALl 5D5 RECORD TOTAL2 SUBT, 5D5 ;Record named TOTALl. numeric ;Five-element ;SUBl. ;Record named TOTAL2. numeric ;Five—element array named array named ;SUBT. RECORD SUBZ, D5, ;Unnamed record. 13579 ;Five—digit numeric field named numeric field named ;SUBZ. 5083, D5, 86420 ;Five-digit ;SUB3. PROC SUBl(1)=SUB2#2 SUBT(1)=SUB3#2 ‘ XMIT XMIT (8,TOTAL1) (8,TOTAL2) STOP 4-8 THE DIBOL LANGUAGE ;Cut SUBZ by two digits and store ;the first element of array SUBl. ;Cut SUBB by two digits and store in in ;the first element of array SUBT. ;Display TOTALl (contents of SUBl). ;Display TOTAL2 (contents of SUBT). In addition to cutting number to be ing off 5 was COS-310 is (#) or will done (+) and by 1 if # the the rightmost leftmost number that causes remain— cut was Rounding operators in order of priority. multiplying (*) and dividing (/) are done next; subtracting (-) are done last. Operators with the same executed left to right. Operations within parentheses are arithmetic first, executed be characters, greater. executes adding priority off incremented first. The following example different priorities. performs calculations using the same numbers but Answers are displayed on the screen. Example: START RECORD ;Four-character FLDI4A5 array, five charac- ;ters each. PROC FLD(1)=100*10/2+3-l ;Ca1culate expression and ;first element of FLD. store in FLD(2)=100*10/(2+3)-1 store in FLD(3)=100*(10/2+3-1) ;Calculate expression and ;second element of FLD. ;Calcu1ate expression and store in FLD(4)=100*10/(2+3-1) ;third element of FLD. ;Calcu1ate expression and store in DISPLAY (0,0,FLD(1)) XMIT (8," ') (0,0,FLD(2)) (8," ') DISPLAY (0,0, FLD(3)) XMIT (8," ') DISPLAY (0,0, FLD(4)) DISPLAY XMIT ;fourth element of FLD. ;Display first element in array. ;Carriage return/line feed. :Display second element in array. ;Carriage return/line feed. ;Disp1ay third element in array. ;Carriage return/line feed. ;Display fourth element in array. STOP 4.2.1.5 Data Conversion manipulation statements allow alphanumeric fields to be converted numeric fields for arithmetic operations and then converted from numeric to alphanumeric for display. Data to Signs usually in associated with arithmetic calculations are alphanumeric in numeric fields. The actual display and are simplified by this data conversion capa- type and cannot be used computation requirements bility. following example converts data from alphanumeric to numeric form, a and displays the results of the calculation calculation, performs The and conversion on the screen. ms DIBOL LANGUAGE 4-9 Example: A RECORD ;Numeric field. NUM1,D4 A1 , ;Numeric field. NUM2,D4 Al , ;Numeric field. NUM3,D4 B RECORD ALFl, A4, '—123' ;Alphanumeric field. '-456' ;Alphanumeric field. Al , ALF2, A4, , Al ;Alphanumeric field. ALF3, A4 PROC into NUMl. ALFZ into NUM2. ;Add NUMl to NUMZ and store in NUM3. ;Move NUM3 to ALF3. ;Display contents of RECORD A. ;Display contents of RECORD B. NUMl=ALFl NUM2=ALF2 ;Move contents ;Move contents NUM3=NUM1+NUM2 ALF3=NUM3 (8,A) (8,B) XMIT XMIT of of ALFl STOP least significant character in a numeric field may have a bit set indicate that the field has a negative value. This saves one char— acter of disk space for each numeric field. If this negative numeric field were or printed, it would have a Q through Y as its displayed The to last character. Numeric Display Alphanumeric Display -0 -1 -2 -3 -4 U1 i<><S<CF3UISUIOTJ I The negative value of numeric for display numbers are displayed the negative value of seeing —1 which is an This direct phanumeric the 4-10 use of THE appears in an the negative in numeric form 1 alphanumeric display value l is Q. as All —l. The negative code for equivalent using significant digit. People are used to alphanumeric character combination. the least data conversion from a numeric field allows computation and special formatting DIBOL of the LANGUAGE statements. an alto negative value display or printing without 4.2.1.6 Data Formatting characters and punctuData arithmetic calculations. fields alphanumeric formatting requires converting numeric fields to The format string must with the use of a data manipulation statement. The number of characters and spaces begin and end with single quotes. the between single quotes should agree with the character count deLabels can be used to reference for— fined for the destination field. mats contained in the Data Division. Data ation fields can be formatted to contain which cannot be present during Formatting uses the following alphanumeric destination form = of special the numeric data statement. manipulation 'format source, string' in be used character except X, Z, *, -, ., ', and , may format string. These restricted characters have special meanings the These meanings are explained in Chapter 1 and must be used with care. of the COS-310 System Reference Manual. Any COS—310 The following example formats data and it displays the on screen. Example: START RECORD A Al,A8 ,A3 A2,A4 ,A3 A3,A4 ,A3 A4,All ,A3 RECORD labeled ;Record A. ;Field to allocate three ;Field to allocate eleven spaces. spaces. B EMT,A4,'X.XX' DATE,D6,103078 format ;Field with initial value of ;field. with informa— date ;Numeric field ;tion. NUM,D3,123 COST,D3,999 TOT,D12,000007894211 ;Numeric field with ;characters. initial twelve PROC Al=DATE,'XX/XX/XX' A2=NUM,'ZZX' ;Format ;Format date for field; be to (Z in Al. lead- stored suppresses ing A3=COST,'XXXO' A4=TOT,'*XXX,XXX.XX-' XMIT (8,A) A2=NUM, FMT ;zeros). ;Format with ;Format TOT; (8,A) preceded by the ;replaces leading ;Display contents ;Use format ;format XMIT 0 ;Display NUM from and * is Xs. inserted of Record statement store contents and zeros. of in A. FMT to A2. RECORD A. END THE DIBOL LANGUAGE 4-11 Clearing Fields and 4.2.1.7 Records or field entire This data manipulation statement clears an record, characters within fields, or clears designatd eleclears designated ments within an array. Clearing entire fields or records is done with No source is used. the following manipulation statement. destination = characters Clearing specific field or (beginning The array name and and ending) of following example of contents the elements requires the use of both These subscripts set the limits characters or elements to be used. or subscripts. the clears fields within and records displays the records. the Example: START RECORD ACCTNG D7, D8, ACCTNG. 24680864 ;Eight-character numeric field. INVNTR FIFO, LIFO, named 1357975 ,A3 ACCTRB,3D2,99,88,77 RECORD ;Record ;Array with two elements. ;Three-character temporary storage. ;Array with initialized values. ;Record named INVNTR. ;Seven-character numeric field. ACCTPB,2A4,'0000','1111' PROC ACCTPB(2)= ACCTRB(3)= XMIT (8,ACCTNG) XMIT (8,1NVNTR) ;Subscripted statement. ;Subscripted statement. record ACCTNG ;Display ;(channel 8). ;Display record INVNTR on on screen channel 8. END The Records may be cleared in a similar fashion as arrays. in an array must be in sequential order and must all be used The records do not have to have length in the Data Division. name. Records numeric fields. records the same the same cleared to all spaces even if the record contains This is illustrated in the following example. are Example: START RECORD BUSNS ;First record ENGR ;Second ACCT ;Third record in Data Division. ,A20 RECORD record in Data Division. ,D20 RECORD in Data ,D20 PROC BUSNS(2)= BUSNS(3)= END 4-12 THE DIBOL LANGUAGE ;Clears second record. ;Clears third record. Division. Using Literals to Implement alphanumeric literal is a 4.2.1.8 An Data series of characters delimited by single A numeric literal is a series of up to 15 numbers (not delimquotes. A numeric or alphanumeric literal is used as a field ited by quotes). anywhere except as the destination in a data manipulation statement. The following example uses alphanumeric and numeric literals. Example: START RECORD ;Record named INVNTY INVNTY. ITEMl, A5 NUMl, D3 ITEMZ, A7 NUM2, D3 ITEM3, A9 NUM3, D3 RECORD ;Record TOTAL named TOTAL. ITEM4, A7 NUM4, D3 PROC ITEM1='POTS' NUM1=25 ITEM2=', PANS ;Literal moved to ITEMl. ;Numeric literal moved to NUMl. ;Literal moved to ITEMZ. ' NUM2=101 ITEM3=', DISHES' NUM3=125 ' ITEM4='ITEMS= NUM4=NUM1+NUM2+NUM3 (8,1NVNTY) (8,TOTAL) XMIT XMIT ;Total moved ;Display ;Display to record record NUM4. INVNTY. TOTAL. END A literal a quote record double literals at is a the used are following example of alphanumeric characters delimited by and a single quote at the end. Record as the source in a data manipulation statement. The shows the use of record literals. sequence beginning Example: START RECORD HDNG ;Record named HDNG. ;Ten-character field. ;Record named DATA. ;Fourteen-character field. ,AlO RECORD DATA ,Al4 PROC HDNG=" MONTHLY' DATA="BALANCE REPORT' XMIT XMIT (8,HDNG) (8,DATA) ;MONTHLY preceded by three spaces. ;Record literal moved to DATA. ;Display ;Display contents contents of of HDNG. DATA. END Alphanumeric, numeric, are not defined or record literals cannot be altered. These in the Data Division of the program. THE DIBOL LANGUAGE 4-13 4.2.1.9 Incrementing Data kind of data manipulation is done with the is incremented by l with INCR faster than source pulation statement which uses destination used to increment a counter. Another INCR statement. variable with +1. the = The following example increments a counter to total a It of A data manioften is 20. Example: START RECORD COUNT CTR,D2 PROC ;Labe1 where control transfers. LOOP, INCR :Add CTR 1 to ;Control IF(CTR.LT.20)GO TO LOOP CTR. transfer statement. (8, COUNT) XMIT END 4.2.2 Input/Output 4.2.2.1 DISPLAY - Statements An Input/Output Statement The DISPLAY statement is used to move the cursor to a particular location on the screen, to display a message beginning at that particular be either The message can cursor location, and to clear the screen. the contents of an alphanumeric data field or an alphanumeric literal. The DISPLAY statement is also used to display questions on the screen. The DISPLAY statement has the fields cannot be Numeric displayed. form: following DISPLAY (x,y, literal afield dfield ) extwo numeric positioned according to the values of The in the format a comma and above). (x by y pressions separated if the value of the first expression indicates a line on the screen; value is than the number of lines on the screen, the cursor larger The cursor will go The the last line on the screen. a character position on indicates larger than the number of character to pression value is width, the 4-14 is THE cursor goes to the last DIBOL LANGUAGE position value the of positions on the screen the second if ex— width; the the screen on screen width. are generated by numeric fields after effects Special inserted as characters select group of numeric the cursor positioning information. a the cursor but displays no message. from the cursor position to the end of screen. from cursor position to the end of line. the terminal alarm. positions \lNl-‘O clears clears sounds Any other numeric fields must be converted to alphanumeric fields fore they be can used be- with DISPLAY. Examples: DISPLAY ;Display DATE beginning position 10. (5,10,'DATE') on line char- 5, ;acter DISPLAY ;Display (3,5,REC) ;on DISPLAY line ;Display (0,0,‘RESPOND') the contents 3, character RESPOND of the at beginning REC position 5. current cursor ;location. DISPLAY (10,15,l) ;Clear to end of screen ;character position 15. from line DISPLAY (6,7,0) ;Position the line 6, ;acter at cursor 10, char- 7. position Example: START RECORD LINEl, A18, 'THIS IS AN EXAMPLE' ;Field named LINEl. PROC the ;Clear DISPLAY (1,1,1) (10,31,LINE1) (12,37,'OF THE') DISPLAY (14,32,'DISPLAY STATEMENT') ;Begin display on line 14, ;character position 32. DISPLAY (0,0,7) ;Sound DISPLAY DISPLAY screen. ;Display contents of LINEl. ;Begin display of literal ;on line 12. terminal alarm. STOP 4.2.2.2 XMIT — An Input/Output Statement transfers a record between memory, storage devices, The transfer involves a channel over which devices. peripheral in the of the involved transfer will happen, the name record and includes a label which indicates a program transfer, optionally If a record exceeds statement to branch to if an end—of—file is read. the size of the record into which it is being read, an error message is displayed. An XMIT statement and the THE DIBOL LANGUAGE 4-15 The XMIT literal the record record when label record the for substituted be can is form: following [,eof 1abel]) (channel,record XMIT A the has statement being output. Example: XMIT (3,ACCT,TOTAL) 3 channel ;Transfers a record from record called ACCT (3 must a ;into :have been open by an INIT statement Branch to TOTAL at ;in input mode). ;end-of-fi1e. XMIT (8,SCRTST) ;0utput record ;onto XMIT on allow statements the records to be the displayed on test) (screen (channel 8). SCRTST screen the screen listed or printer. Example: RECORD SHOW FLDl,Al8,'THIS FLD2,All,' OF AN XMIT' IS EXAMPLE AN ;Record named SHOW. ;Field with initial value. ;Field with initial value. PROC of SHOW content :Transfer ;channel 8 (screen). transferred 7Record literal ;channel 8. XMIT(8,SHOW) XMIT (8, "STATEMENT') over over STOP the be read from allows data to keyboard. does not work with XMIT statements, use CTRL/U acIf you type more data than the record can to This use of XMIT is not de— cept, an error message will be displayed. with fewer sirable because the ACCEPT statement does the same thing The also the DELETE key correct any errors. XMIT statement Because complications. 4.2.2.3 DIBOL INIT uses and channel FINI - Input/Output numbers (1-15) to Statements reference mass storage devices and character-oriented input/output devices during program execution. If you stipulate a number greater than 15, it is treated modulo 16. statement opens a device and associates device. The FINI statement closes a device channel number from the device. The the INIT 4-16 THE DIBOL LANGUAGE a channel number with disassociates the and device, whether Each mass storage character-oriented, or has The a in an mode designadesignation for or tions (I, O, update) (input, output, allows the device was which sequential reading opened. Input storage of data, output overwrites the data stored on a logical unit, and upindi— The designations (K, T, L, S) date is a random I/O operation. device cate the character-oriented terminal, printer, (keyboard, source file) and its relationship to program execution. that is used along with U) indicate the purpose The channel the mode statement. INIT designations are required INIT to de— and the terminal respectively. the printer, associated with any other mode, their channel numbers are is no longer in effect. de- statement. fault these fault number and COS—310 is the to shipped with the keyboard, numbers channel 6, 8 7, set and file name file It is good programming practice to stipulate the data the logical unit number referencing the logical unit in which the The complete INIT statement has the following form: is stored. INIT If (channel,mode[,filnam][,logical unit #1) Examples: INIT (9,U,BKLG,3) - 9 for (initializes) channel the file BKLG contains ;update. ;Opens ;name INIT (1,I,'INVNTY',7) on logical unit 1 for channel file found on ;Associates ;INVNTY 3. is a input. logical ;unit 7. INIT ;Associates the keyboard with ;nel 7. (7,K) the FINI statement disassociates the related information, the FINI statement only The FINI statement has the following form: Because FINI chan- from. its channel number needs the channel number. (channel) Examples: Assume INIT that the statements FINI (9) FINI statements below are in the FINI (1) (7) program ;Disassociates channel 9 as the closes as an up- logical BKLG on ;Closes and disassoci- ;ates input ;date mode; ;unit 3. FINI same above. file INVNTY channel 1 from ;Disassociates channel ;board. 7 mode. from key— THE DIBOL LANGUAGE 4-17 4.2.2.4 The READ DIBOL files The READ area a Both ord READ and WRITE move of working memory during the relative record number. areas data between records associexecution by program data statement moves a data record from a specified of working memory defined in the program's Data The WRITE to Statements Input/Output - statements and ating through an and WRITE statement moves data file. specified READ and numbers. READ (channel, READ WRITE from record statements use channel and Write statements WRITE The data a area of working numbers, records, have following the to memory and rec- forms: rec#) record, (channel, an data file Division. record, rec#) statement is the name of a in record number (rec#) associated with in the READ The record into which data is to be read. the READ statement specifies the location within which The channel devices in a number input is statement (1—15) in the READ The record (I) or update (U) mode. logical unit from data is to be label read. Example: READ (3,ACTPBL,5) chan;Read record 5 of the file on ;nel 3 into record named ACTPBL. READ (10,ACTRCB,11) ;Read record 11 of the file on chan;nel 10 into record named ACTRCB. READ (ll,STKINV,REC+5) ;Read record determined by the REC+5 into STKINV. ex— ;pression READ The associated ;Read EXAM from the file ;with channel 5 into CUSNAM. (5,CUSNAM,EXAM) channel in number in the or update is with associated record label in the WRITE statement is the name of a defined record area in the program from which to data is be output. The record number (rec#) in the WRITE statement is a number or the location expression specifying within a logical unit into which data is to be written. devices output (1—15) (0) WRITE (U) statement mode. The Example: WRITE (5,ADDRES,PLC+1) ADDRES ;Write record PLC+l from ;file associated with channel 5. WRITE (11,PHONES,41) ;Write record 41 from PHONES ;associated with channel 11. WRITE (15,ZIPCOD,EXPR) ;Write record EXPR from to to file ZIPCOD ;file associated with channel 15. 4-18 THE DIBOL LANGUAGE to 4.2.2.5 The ACCEPT ACCEPT An - statement Input/Output ACCEPT ACCEPT statement (dfield, program execution to pause and information through the keyboard. used with the DISPLAY statement. causes while you input statement is most often mant The Statement has the following remain dorThe ACCEPT form: afield) in an The ACCEPT statement stores the alphanumeric entry keyboard and field stores the decimal equivalent of the terminator character The decimal equivalent (the last character typed) in a numeric field. of COS—310 terminator characters is shown with the ACCEPT statement in the COS-310 System Reference Manual. Example: ACCEPT (FLDl,DETAIL) DETAIL named ;Store input in field ;and terminator character in FLDl. ACCEPT (DIGl,SUMMRY) ;Store ;and 4.2.2.6 The FORMS An - Input/Output input in terminator named field character in SUMMRY DIGl. Statement FORMS statement causes the printer to skip lines The FORMS statement has the following form: or to start new pages. FORMS The The the (channel, is any skip-code is channel skip-code) number (1-15) previously associated with a printer. If 0, the form goes to one of the numbers 0—4095. top of the page. Any skip-code other than 0 causes the printer to skip that many lines before printing characters. numbers cause results. unpredictable exceeds 4095, COS-310 will begin reading 4096 as on. This is modulo 4096. Negative the 4097 as If 0, skip-code 1, and so Example: FORMS (6,18) channel ;Printer is associated with 18 lines from ;6. Begin printing ;the top. FORMS (15,4050) channel ;Printer is associated with ;15. Begin printing after skipping ;to FORMS (12,4099) a new page. channel ;Printer is associated with ;12. Begin printing after skipping ;3 lines (modulo 4096). THE DIBOL LANGUAGE 4-19 4.2.3 Program Control 4.2.3.1 IF DIBOL uses course of - Program Control Statement A the IF statement action. The compared. Statements The IF to expressions statement has and expressions compare must be of the determine to data same type a be following form: the (expressionl.rel.expression2)statement IF used The following two-letter codes set between periods are the relationships. No spaces should separate the expressions relational comparison codes. show to from the Equal Equal .EQ. .NE. Not .LT. Than Than or Greater Than Greater Than Less .LE. Less .GT. .GE. If the relationship is If the relationship next line in sequence. The to statement at the Equal or the true, is end not of Equal an rest true, IF of the program statement is statement execution must be executed. to the continues one of the follow— ing: GO TO CALL label label STOP TRACE NO RETURN ON ERROR TRACE label The expressions being compared be The a combination expressions are must be of the same data type and can of literals, variables, or arithmetic expressions. made the same size before a comparison is made. Example: IF (INCOME.LT.OUTGO)CALL IF (EOJSW.EQ.1) IF (DEBIT.GT.CREDIT+10)RETURN HELP STOP ;RETURN ;DEBIT 4-20 (ITAX.GE.RSTAX)TRACE THE DIBOL LANGUAGE INCOME ;Stop program if EOJSW equals 1. to ;previous IF if :Branch control to HELP ;is less than OUTGO. is first CALL statement after if + 10. or TRAP statement greater than CREDIT :Branch to TRACE if ITAX ;than or equal to RSTAX. is greater 4.2.3.2 STOP Program Control Statement A - program execution and return control to the Mon— does not close files (FINI closes files) nor to be the last statement in a does (the program optional END is the last statement). If you do not close files that statement were opened for output or update, the STOP statement may cause records STOP Use itor. to terminate to This it have statement lost. be STOP statement can be Procedure Division of a A 4.2.3.3 GO TO A — used DIBOL anywhere and number any of times in the program. Program Control Statement GO TO statement branches to the location indicated. are two There forms of the GO TO statement, unconditional and computed. The uncon— a ditional GO TO branches immediately to a location identified by label. The unconditional GO TO statement has the following form: A GO label TO GO TO contains a number of possible variable which indicates which label is to computed GO TO statement has the following form: The and computed a GO TO The (labell variable is a labels The referenced. referencing be labe12,...labeln),variable numeric value or an expression representing value. a Example: GO TO LOOP ;Branch control ;statement GO is to LOOP executed. when this of TO(LOOP,STOP,RETURN),EXPR ;Branch control to LOOP if value ;EXPR is l, to STOP if value of EXPR ;is 2, to RETURN if value of EXPR is and the next statement if EXPR ;3, ;has any other value. 4.2.3.4 CALL and RETURN - Program Control Statements The CALL and RETURN statements branch to, and return subroufrom, A tines. subroutine is a routine to be used a number of times in a program or to be used only under certain conditions. Write subroutines quential tion to program a in places where they will not be run as part of seA CALL statement branches program execuexecution. subroutine; a RETURN statement branches execution from a subroutine. THE DIBOL LANGUAGE 4-21 The CALL it which includes The branch. label statement a is CALL to to form: following the has subroutine the identify to statement label CALL Example: A CALL LOOP ;Branch control to subroutine LOOP. CALL SUBRl ;Branch control to subroutine As many CALL may be used within subroutines. used at a time. This multiple statement statements branches be CALL2 can to which branches CALL3, to and CALL so SUBRl. 50 as is forth) CALL (CALLl procedure called nesting. a subroutine. executed in of a subroutine. Failure stack to use a RETURN statement will eventually overflow the pushdown No label is needed the to abort. and will cause arrangement program with the RETURN statement because it automatically branches control to the next statement after the last CALL statement that was executed. The RETURN statement has the following form: The RETURN Do not is statement a use GO TO the last statement statement branch to out RETURN Do not or a use TRAP 4.2.3.5 RETURN a statement unless it corresponds to either CALL a statement. ON ERROR - A Program Control Statement A fatal and nonfatal errors can occur during program execution. A crashes and a a restart. requires complete program program nonfatal error is one where COS—310 an an detects error, displays error message, and waits for you to make the correction. Fatal error ON ERROR statement branches execution to another location a when nonfatal error is encountered. This branching prevents COS—310 from An No automatic corissuing error messages and waiting for corrections. the rection of error is made; the DIBOL program must be written to shut-down take some corrective action or at least make an orderly of the files before stopping. Execution continues from the (FINI) statement to which control was branched. Write an above) a ON ERROR statement statement requires a label to where an into a error identify the program might just preceding occur. location The where ON (on the ERROR line statement execution is to branch. Example: ON ERROR LOOP ;Branch control ;statement 4-22 THE DIBOL LANGUAGE to creates LOOP an if the error. next A common is to that of the ON ERROR statement verify keyboard This verification involves using a data maninumeric data. to a an statement to move keyboard data from alphanumeric this field. The verification illustrates following example use is entry pulation numeric process. Example: RECORD ALF, A10 NUM, D10 PROC ACCEPT ON ;Alphanumeric field. ;Numeric field. (NUM,ALF) ;Enter data. ERROR NONNUM NUM=ALF ;Move ALF to NUM. (8,"NUMERIC') XMIT STOP NONNUM, XMIT (8, "NONNUMERIC') STOP 4.2.3.6 CHAIN — A Program Control Statement Programs whose size exceeds the capacity of working memory executed unless they sequentially statement effect List of the this A gram. A desired CHAIN from are divided executes the these oversized cannot be A CHAIN into smaller programs. smaller programs to produce the program. to be chained following the RUN command. The order listing determines the number (0—7) associated with the pro— number larger than 7 results in an error message. programs written into a program must include a number indicates which of the programs in the RUN command is The CHAIN statement has the following form: statement This number cuted next. CHAIN 0-7. exe- number program loaded by a CHAIN statement does not automatically return to the calling program. Once you have chained out of a program, the only statement. way to return to that program is with an appropriate CHAIN Programs loaded by a CHAIN statement always begin execution immediate— It is to ly after the PROC statement in a program. good practice close (FINI) files before chaining to another program. A Any DIBOL record storage area in a program loaded by the RUN command is if the record is in a However, automatically cleared. program loaded by the CHAIN statement, the record retains whatever contents it had in the previous program unless the clear option (,C) is specified for the record. THE DIBOL LANGUAGE 4-23 Example: TRFFC+SCHDL+FLGTM+DEPTTM .RUN Div. Data Div. Data Data PROC . PROC Div. CHAIN 2———- PROC . r..———>. . . PROC . . CHAIN ——>. . CHAIN 1 TRAP 2 , 3 CHAIN 4.2.3.7 Div. Data . ——>. . DEPTTM FLGTM SCHDL TRFFC and RETURN - Program Control Statements with overall buffer its coordinates a printer and into a is the for Information execution. put printer output program it can The buffer holds the data until buffer one record at a time. If information is output for the printer but the buffer be printed. execution statement is filled, a program without TRAP halts further and waits until the printer makes the buffer available for more char- A TRAP statement acters. The TRAP allows allows statement TRAP taneously. other task buffer has When the 0 o 0 and to more buffer output room for empties, two the more separate operations to take place simulDIBOL run-time system to interrupt the data to the printer whenever the printer data. TRAP implements the following procedure. Program execution temporarily halts. Dibol run-time system stores the location of the halt. TRAP transferred to the location specified in the DIBOL the hwere (most program outputs likely) record to the printer and executes a RETURN. was execution returns to the location where program is Control statement 0 another Control halted. 0 Program statement execution then runs concurrently with the printer. The TRAP tine. 4-24 statement The TRAP includes a has statement TRAP label THE DIBOL LANGUAGE label which identifies the following form: a printer rou- The last statement in the RETURN statement returns execution. gram printer routine is to the statement a RETURN where TRAP 1-500 numbers The following example program prints while other program statements are being executed. This statement. interrupted pro- on the printer Example: RECORD A D3 PROC N, TRAP SUB FORMS (6,0) ;Start ;Perform . IF(N.LT.500)GO TO LOOP LOOP, printer. the task. a ;If the other task finishes ;first, wait for the ;printing :stopping finish to the before program. STOP N=N+l SUB, IF(N.GT.500)RETURN (6,A) ;Print record A 500 XMIT times. RETURN 4.2.4 Debugging 4.2.4.1 TRACE - Statements A Debugging Statement When properly written and activated within a DIBOL program, TRACE pro— vides a record of program execution by causing the line number of each statement in the Procedure Division to be printed as it is executed. These line numbers are printed in the following form: AT If a LINE xxxx line covered by TRACE a contains of the result the manipulation will in the following form: statement statement, line number AT LINE manipulation printed with the data be xxxx result The TRACE function is activated which begins the execution of a by a /T option in the RUN command program. THE DIBOL LANGUAGE 4-25 4.2.4.2 The NO lines ing of The N0 TRACE that line TRACE - A Debugging statement is the written into a DIBOL program following The NO TRACE statement stops the print- be traced. numbers under the to are Statement following example includes TRACE statement. and NO TRACE TRACE statements. Example: 0110 0120 0130 0140 0150 0160 0170 0180 0190 RECORD D5 ITEM, HOURS, D2 SALARY,D5 WAGES, D7 PROC HOURS=40 SALARY=300 TRACE 0200 WAGES=HOURS*SALARY 0210 0220 HOURS=10 0230 0240 0250 0260 0270 0280 0290 IF(WAGES.EQ.10000)NO IF(HOURS.EQ.10)GO TO NO NEXT,WAGES=HOURS*SALARY NO TRACE HOURS=20 WAGES=HOURS*SALARY STOP the TRACE statement is for the preceding command listed on the printer. LINE 0200 0012000 AT LINE AT LINE 0210 0220 10 AT LINE AT LINE 0230 0250 0003000 AT 4-26 LINE THE NEXT TRACE When AT TRACE 0260 DIBOL LANGUAGE activated program, in RUN the /T option following information will be by the the APPENDIX COS-310 A CHARACTER SET and both source and data files, characters (alphanumeric numeric) in six-bit word stored two characters binary. Negative per set numbers are stored with the high-order bit of the low—order digit to 1. For the number 1234— is stored as two words in the example, following form: In are 22 l 24 3 23 2 WORD l 65 4 WORD 2 (with high—order bit on) in This means that This number is recognized as 123T. program any which the numeric—to-alphanumeric conversion is not made might produce Refer to Table A-1 for a list of charnegative numbers with letters. acters representing negative numbers. Table A—1 Characters Representing Negative Negative Equivalent Decimal Number Character Code Numbers Octal Code -0 P 49 61 -1 Q 50 -2 -3 -4 R 51 52 62 63 64 53 54 65 66 V 55 67 W 56 57 58 70 71 —5 -6 -7 -8 -9 S T U X Y 72 Table A-2 COS-310 Character Decimal Code 00 00 01 02 01 02 03 04 05 03 04 05 06 07 08 09 10 11 06 07 10 11 12 13 12 14 13 14 15 15 16 17 20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 A-2 Octal Code COS-310 Decimal Character Null Space 37 CHARACTER SET ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > Code 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Set Octal Code Character 40 ? 41 @ 42 A 43 44 45 B 46 47 50 51 52 53 54 55 56 57 60 61 62 63 64 65 66 67 70 71 C D E F G H I J K L M N 0 P Q R S T U V W X 72 Y 73 74 Z 75 Tab 76 77 ] [ 4 GLOSSARY alphanumeric character set that contains letters, digits, and other characters such as punctuation marks. The COS—310 alphanumeric character set includes the uppercase letters A-Z, the digits 0—9, and most of the characters on the terminal keyboard. Two of these char~ special some termi— acters, back slash (\) and back arrow (<-—) (shown on A nals as an underscore), illegal. are array A DIBOL technique for specifying more than field one of the same and The length type. array 5D3 reserves space for five numeric The array 2AlO describes two fields, each to be three digits long. alphanumeric fields, each to be ten characters long. ASCII American method of Standard Code Information Interchange. characters. for This is one coding alphanumeric batch file file containing a sequence file will cause the commands A of commands. within the A file command be to to execute executed the sequen- tially. batch processing The technique of automatically stored Monitor commands. executing a of previously more constants group binary operator An operator, such or variables (e.g., A=B-C). binary The as + or program kind of program which -, is which acts upon two or output by the compiler. binary scratch area in memory where tion. The area the binary program is stored during execu— GLOSSARY-l bit A binary digit (0 or 1). block The basic COS'310 unit of of up to 512 characters. storage capacity. mass consists block A bootstrap short routine loaded at system start—up time system software to be read into machine memory. which A enables the branch A change in the sequence execution of of COS—310 for input state- program ments. buffer A temporary storage output data A byte is the smallest as a unit. addressed in a DIBOL program. unit used usually area or transfers. bug An error or malfunction in a program or machine. byte A of of bits considered information that can be group channel A number between 1 and 15 used ment with a specified device. associate to input/output an state- character A letter, digit, or other symbol used control to or to represent data. character A string connected linear sequence of characters. clear Setting alphanumeric field an to or spaces numeric a field to zeros. command An operator request following a RETURN for Monitor services; to usually be executed key. comments for people to read; they Comments are optional and follow a Notes are ignored semicolon concatenated Strung together without intervening space. 2-GLOSSARY on by a the compiler. statement line. conversational program A program that prompts responses from an operator pending upon the response from the operator. and reacts de- cursor flashing light indicator which The screen where the character next at the appears will be displayed. point on the data representation of information in a manner suitable for communicaor interpretation, processing by either people or machines. A tion, In COS-310 data systems, data entry The process of collecting files. Data entry is key is represented by characters. and to inputting data management The planning, by an development, and operation to mechanize its organization available the data needed into data the computer data disk. of a system information like COS—310 flow and make by the organization. debug To detect, or machine. locate, and remove errors or malfunctions from a program DEC Acronym for Digital Equipment Corporation. decimal Refers to a base ten number. delimiting The device bounds (beginning and end) of a series or string. designation three-character designation for a mass storage device. two characters the third designate the type of device; designates the number of the drive on which the device is A The first character mounted. device independence COS-310 system design permits data files and programs to be stored on either diskettes or disks. At run time, the operator chooses the most suitable or most available input and output devices. device designations A three-character vices. abbreviation TTY = Screen KBD = Keyboard LPT = DKO-DK3 = Printer Disk drives Disk drives Disk drives RXO—RX3 DYO—DY3 = = used to name the COS-310 I/O de— GLOSSARY-3 DIBOL Digital's Business Oriented Language is to write business application programs. COS-310 direct COBOL-like a The source used language language of the system. access The process of obtaining data from, or placing data into, a storage device where the availability of the data requested is independent in or obtained of the location of the data most recently placed is to users of COS-310 Direct access available systems by storage. For exwriting the position number of any record in a data file. ample, you can request the 5th, 35th, and 711th records in a file. directory A place ed for the with listing information for reference. Displayed or print- command. DI dump To to copy the external of contents all or part of storage, usually from memory storage. edit buffer The work in memory where area files source are created and edited. end-of—file mark a multivolume control character which marks the physical end of this Monitor detects For and the file. both input output files, next EOF mark and types a message for the operator asking that the volume in the file be mounted. A fatal error An error which terminates program execution. field A specified data; area cannot in exceed a data record used for alphanumeric the specified character length. or numeric file A collection of records, treated as a logical unit. records record in a data file is the same length. recFixed—length are the only type handled by COS—310 utility programs and the type on which direct access to data files is allowed. fixed-length Each ords only flowchart flow data pictorial technique for analysis and solution of processing problems. Symbols represent operations, and necting flowlines show the direction of data flow. A data 4-GLOSSARY and con- handlers A specialized software function which interfaces peripheral devices. between the system and illegal character to the COS-310 character that is not valid design according rules. DIBOL will not accept back slash (\) and back arrow (<¢—) alunderscore) in (back arrow is replaced on some terminals with A phanumeric strings. initialization Putting a device into successfully function the correct format or in a configuration. position where it can input flowing into Data input/output Either input or the computer. output, both. or I/O. jump A departure from the normal executing instructions in of sequence a computer. justify The process of positioning data in a field size is whose larger than the data. In alphanumeric fields, the data is left—justified and any remaining positions are space—filled; in numeric fields the are digits right-justified and any remaining positions to the left are zero—filled. key fields within a record used to match or sort file. a file is to be arranged by customer name, then the field that contains the customers' names is the key field. In a sort opera— the fields of two records are compared and the records tion, key One or If a are resequenced when necessary. more load To enter data or programs into main memory. load-and-go An operating technique in which loading and executing phases of there a are no between stops the program. location Any place where data may be stored. logical unit number number (1—15) which identifies an The table references the number device. A entry in to a a logical unit location on a mass table. storage GLOSSARY-5 units logical An of area units storage be may on at file utility in listed are sizes These areas and their assigned program (DFU). the logical unit table printed by DFU. logical 15 to device. Up storage system start-up by the data mass a assigned loop sequence of instructions minal condition prevails. A until is that executed repeatedly commonly used programming A a ter- technique in processing data records. machine-level programming Programming using a sequence cutable by the computer. mass A binary instructions of in form a exe- storage device device having large storage capacity. file data file master A as memory The that is either authority in an a relatively permanent particular job. internal computer's primary or that is treated storage. merge combine records from two or more is another that string arranged similarly To phases of mnemonic Brief LPT, a in the into ordered strings The latter order. same operation. sort . identifiers and which are easy remember. to Examples are KBD, TTY. mode A designation which being a file used in was INIT to indicate the for purpose indicate the input/output device statements opened or to used. modulo A condition where a specified number equals or the base exceeds modulo The base is then divided into the specified (the number). number and the remainder is used as the variable. In modulo 16, if 17 17 were would be divided by 16 and the processor specified, would use 1 as the variable. Monitor A COS—310 system program other useful tasks. that loads and runs in other programs and performs nest To embed grams. 6-GLOSSARY subroutines, loops, or data subroutines or pro- nonfatal error . An which error will completely terminate not program execution. nonsystem device A device A tor. that does not contain the operating system and device used exclusively for data storage. Moni— the option switch A one— in two—character or conjunction with a of the function designation indicating a special a slash (/) in Usually preceded by command. COS-310. output Data flowing out technique of computer. overlay The the same data. several different rules apply. formats record specifying Special for parameter A variable is that given a constant value for specific a purpose or process. peripheral equipment Data processing equipment which is distinct from the computer. pushdown stack list of items where the last item entered becomes the first item the list and where the relative position of the other items is pushed back one. A in random access Similar to direct access. RECORD A statement that reserves memory for DIBOL data language programs. segment Sixteen blocks of storage. sequential operation Operations performed, serial The screen The block after the is 512 bytes long. other. access data from, or putting time is dependent upon the recently obtained or placed in storage. process where the most one A of getting access line number number which indicates the order of the data into, location horizontal of storage the lines on data the screen. GLOSSARY-7 sign is number Indicates whether a do not numbers require a with the minus sign (—). significant digit A digit that is needed or sign, P081tive or positive. negative but negative numbers are prefixed recognized for specified a purpose. source A program program written in COS-310 DIBOL language. statement instruction An in source a program. string A connected linear sequence of characters. subscript A designation which clarifies the particular parts records) within a larger grouping or array. values, switch A character letter single specified in a command following of language. (characters, slash a (/). syntax The rules the governing structure a system configuration combination The puter hardware of and software make that up usable com- System, and a system. system device A mass storage device reserved for Monitor, other system and source programs. Run-Time systems directory A list of creation, programs on the systems device and other useful information. with lengths, dates of system handlers specialized software which interfaces peripheral devices. The terminal A unary An alarm emitted signal operator operator, constant utility A such the from as + or the between system and variable or ‘ terminal. -, which acts upon only one (e.g., A=-C). program system program which performs programs. 8-GLOSSARY Examples are SORT and common PRINT. services and requires format variable A quantity that can assume any one of a set record in which the data records are not to such records is not possible. of values. variable—length A file access uniform in length. Direct accomplished accu— verify To determine if a transcription of data has been rately. word A zero To string of fill fill the 12 binary bits representing two remaining character positions in COS-310 a characters. numeric field with zeros. GLOSSARY-9 INDEX A C A, alphanumeric field type, 4-3 ACCEPT, 4-16 see XMIT, input/output statement, 4-19 often used with DISPLAY, 4—19 ICI 4—7, 4—8 terminal, 4-15 Alphabetic characters, CAP LOCK key locked for, 2-1 Adding (+), Alarm, 7 sounds lowercase, uppercase, vi vi without, 4—23 Calculations in numeric fields only, 4-3 CALL and RETURN, program control statements, CALL statement, the Calling Alphanumeric data, moving, 4-5 Alphanumeric fields, records treated in a CHAIN statement, 4—23 record retains contents like, 4-6 Alphanumeric literal, 4-13 Array, clear elements in, 4-12 elements in, 4—3 information, fields contain, 4—1 number of characters in, 4—3 subscripts reference elements in, 4-3 CAP 2—3 LOCK 4—21 form of, 4-22 keyboard Monitor, key, 2-1 Central Processing Unit (CPU), character sent to, 2-1 CHAIN statement, form of, 4-23 Chaining, close files before, 4—23 ’ Arithmetic expressions, calculating, 4—7 manipulation data calculate, statements 4-4 Arithmetic operators, expressions contain, 4—7 Assignments, logical unit displayed and listed, 3-4 Automatic line numbers, continue until CTRL/z, CTRL/Z terminates, 2—2 Channel, FINI disassociates 4-16 in statement, 4-14, 4—15 associates device with, 4—16 numeric expression, vii with FORMS statement, 4-19 Channel number, COS-310 shipped with, 4—17 in READ statement, 4—18 in WRITE statement, 4-19 XMIT INIT Character, designations, count 2-8 Data Division of, (binary) files, /B, DFU, 3-3 BACKSPACE key, not 2-5 part of COS—310,_2—2 Backup, installation start-up and, 1-3 Binary (B) files, 2—5 Binary scratch area, 2—6 program too big for, 2-7 Block, address of first, 3-2 Braces, choice of items within, vi Brackets, optional items within, vi BREAK key, not part of COS-310, 2-2 Buffer, TRAP coordinates printer, 4-3 key erases, 2-2 Characters, CAP LOCK key.to input alphabetic, 2-1 DELETE B B device from, indicates number 4-1 label can have number of, 4-2 lowercase alphabetic, vi number in field, 4-3 numeric after A or D, 4—3 numeric before A or D, 4—3 numeric generate special effects, 4—15 restricted in format string, 4-11 up to 15 in numeric field, 4—3 uppercase alphabetic, Clear data fields, data vi manipulation statements, Clearing fields and records, 4-4 4—12 Cmndfl, command file name, Code (#), converting to vii 4-24 INDEX-1 INDEX relational 4—20 Codes, comparision, follow label, unlabeled field 4—2 must 4-2 in statement, Command, (DE), 2-9 (DI), 2—4 DELETE DIRECTORY DI/T, 2—4 FETCH (LI), RESEQUENCE deletes to editor, 2-8 numbers, 2-5 number, fields editor, in vi notational, Conversational 2—3 vi statements, 1—3 internal code 2—2 Corrections, character—by— character, 2-2 COS—310, default channel numbers, 4—17 to, multiphase SORT, v 1-3 procedures for operating, v. use of logical units with, 1—3 utility programs, 1-3 CPU, central processing unit, Cross-referenceing program ' CTRL key, 2-INDEX 2-2 1-3 2-2 location on position according example (#), 4-7, 4—8 COPY key, not part of COS-310, (CREF), 2—2 error, screen, 4-14 data manipulation statements, 4-4 introduction to move data, Converting an 4-14 2—5 programs, Comments, 4—1 Comparison, relational codes, 4-20 Compilation Listing, 2-6 Compile source program, 2—5 Conventions for manual, to 2—2 line, last character, 2—3 location, display message at, vi and 2-8 a correct Cursor, after interrelationship of, Monitor 2—5 2—2, line numbers continue until, 2—8 terminates automatic line RUN (R), 2-5 SAVE (SA), 2-5 WRITE (WR), Commands, of 2-2 CTRL/Z, 2—7 2-4 (RE), execution to return to Monitor, 2-5 CTRL/O, stops display of characters, 2—2 CTRL/Q, resumes terminal output, 2—2, 2-5 CTRL/S, terminates screen output, file name, vii Line Number (LN), Convert terminates CTRL/U, 2-7 2-4 (ER), (FE), ERASE Comment CTRL/C, program, Comma, LIST (Cont.) to values, 4—14 D D, numeric /DL, DFU, field type, 4—3 list table on printer, 3-4 DAFT, dump—and—fix technique, 1-3 Data, data manipulation convert, data statements 4—4 manipulation statements 4—4 fields, data manipulation statements clear, 4-4 fields used in moving, 4-6 format, file name (filnam), vii files, display a list of, 3—4 files, print a list of, 3-4 formats referenced by labels, 4—11 formatting, data manipulation allows, 4-11 moving alphanumeric, 4—5 moving numeric, 4-6 on logical unit, first block of, 3-6 RECORDS used in moving, 4-6 INDEX using literals 4—13 XMIT reads Data to from implement, 4—16 keyboard, conversion, data manipulation allows, 4-9 devices, arrangement of storage on, 3-5 Data Division, allocates data storage, 4-1 designates names of files, 4—1 destination defined in, 4-5 determines types of fields, Data 4-1 in a program, 1-2 indicates number of characters, 4-1 initial values in, 4—3 literals defined in, 4—3 may contain initial values, 4—1 optionally begins with START, 4-1 Data File Utility Program (DFU), 1-3 Data Manipulation statements, allow data allow data calculate conversion, 4—9 formatting, 4—11 DE (DELETE) command, Default 88, 78, channel technique, 4-25 numbers, COS-310 2-2 (DE), 2-9 DELETE (DE) DELETE key to correct error, 2-2 key, will not work with XMIT, 4-16 associates 4—16 from, INIT channel with, loading instructions for, 2-1 logical unit on mass storage, 3-1 media loaded into, vii order on nonsystem, sequential 3-5 sequential order system, on 3-5 utility DFU/g, display table DFU/E, display a program, on screen, list of data DFU, filnam, 3-3 DFU/K, 3-2 DFU option switches, 3-2 DI (DIRECTORY) command, 2-4 DI/T command, 2—4 4-1 program, program, DIBOL 1—1 shipped with, 4-17 Delete a line, CTRL/U, DELETE arrangement of storage on data, 3-5 arrangement of storage on system, 3-5 FINI disassociates channel DIBOL, 2-9 1-1 command 4-6 to, source files, 3-4 DFU/EL, print a list of data files, 3—4 Debugging statements, 1—3, Decimal equivalent, 4-19 DECstation DECstation example of Device, -4 (D308), l—l (D310), l-l asks for, 2-3 Date, Monitor DDT, DIBOL debugging 1-3 vi three-character, vi two-character, vi Designations, data manipulation statement in, 4-4 defined in Data DivisiOn, 4—5 type, INCR, 4-14 in TRACE, 4—25 4-4 move data, Datasystem 308 Datasystem 310 character count, 4—3 of mass storage media, DFU/B, 4-4 4-12 fields, records, 4-12 convert records, 4-12 DIBOL form of, 4—4 examples of, 4-5 format data, 4-4 clear clear Designations, vii 3—3 DFU, data file 1-3 arithmetic expressions, (Cont.) labels reference, vii logical units in, Debugging Technique, 3—6 (DDT), 1-3 Directories, Monitor maintains file, 1—2 DIRECTORY (DI) command, 2-4 Directory, erase programs from, 2-9 Disk, DK indicates RK05, vii 4-16 INDEX-3 INDEX (Cont.) correction Diskette, RX DISPLAY statement, Dividing (/), 4-7, form 4—8 DELETE fatal 4-14 of, MENU disk, vii indicates RK05 DK CTRL/U RX02, vii RX01, vii indicates indicates Dx 1—1 1—1 (Datasystem 308), (Datasystem 310), Dump-and-fix technique ESC key, part of COS-310, not 2—2 Double quotes, record literal delimited by, 4-13 Drive number, vii D310 2-2 and nonfatal, 4—22 eliminates many operator, 1-3 2—3 displayed by the system, Double-character key, shift register on, 2-1 Dot D308 2—2 of, correct, 2-2 key to correct, to Example programs, comment fields in, vi Expression, source is an, 4—5 Expressions, calculate arithmetic, 4—4 calculating arithmetic, 4-7 (DAFT), with compare 4-20 IF, 1—3 DY indicates RX02 diskette, vii F Fatal E errors, ON with, ERROR 4—21 /E, DFU, display files, 3—4 Edit ER buffer, clears, LI displays logical a list data of data contents unit 2—3 Editor commands 2—4 of, assignments source text, Elements, 4—3 Erase programs 2-9 from directory, characters, Messages, Errors, correct 4-INDEX character statement in, Field Field labels, DELETE key, 2-3 after RETURN key, 2-2 4-3 designates 4—6 4-1 4-2 statement, label comma in, must 4-2 4-3 Field Types, A or D, File conversion program (FILEX), 1—3 File directories, Monitor maintains, 1-2 name, command, vii data, vii Files, binary source (B), (S), 2—5 2—5 STOP does FILEX, file conversion data file name, DFU, 3-3 not close, 2—5 (V), system three types of, 2-5 1-3 2-2 Error of statements 4-12 4—4, group of, 4-1 used in moving data, Field data information File clear, 4—12 subscripts reference, 4-3 END, last entry in logical unit table, 3—3 ER command, prevent mixing of entries, 3—3 ERASE (ER) command, 2—7 Erase number RECORD follow controls array, array, vi manipulation clear, 1-2 output from, 1—2 /EL, DFU, print a list of data files, 3-4 in in 2-4 command, accompanies RECORD, spelled out, vi Editor, Monitor 1—2 (FE) comment, 2—7 through, 3—3 Edited, entire lines by number command, 2-8 Editor commands, Monitor and, input to, FETCH Field, Filnam, vii 4-21 program, INDEX (Cont.; operation, INIT FINI, closes device and disassociates channel, form of statement, 4—17 table 3-1 Flexibility, 4—16 an values, Data Division 4-1, 4-3 4—14 only fields contain, code, converting to (#), 4—7 1/0 handlers, Monitor stores, Internal operation, INIT data manipulation 4—4 Format string, characters restricted in, 4-11 FORMS, form of statement, 4-19 1-2 data, Format contains, an, Input/Output statements, 1-3 of of 4—3 storage, generator program (FLOW), Initial enhances Flowchart Flowchart 3-7 flowchart 3—7 statements, Input 1-2 editor, to Installation Installation procedures, v start-up and loading and backup, 1—3 Instructions, starting, G GO out of Interrelationship TO, form 2—1 of statement, of subroutine, commands, 2—5 4-21 4-22 K H for K, mode designation keyboard, Handlers, address Monitor of, /K, DFU, 3-2 Key panel adjacent 3—2 I/O, stores 1-2 Hardware, drive, vii minimum I, page, data 1—1 3740, IF, 1—3 form for input, readable statement, Implement data, by, 4—20 using literals to, 4—13 INCR, form of statement, information, messages for, 2—3 Incorrect Increment by 1, # error causes, 4—9 are, 2-7 Incrementing data, use be RE read from, 4—16 4-19 with computer, 2—1 logical unit assignments through, 3—2 Monitor, calling the, 2—3 Keys, special function, 2—1 L L, mode designation 4—17 for printer, Label, 4-14 Incremented, Line numbers Increments, to interact directly of keyboard, input information through, 4-1 mode designation 4—17 IBM to Keyboard, required, starting instructions for, 2—1 Heading, COS-310 prints at top of 4—17 4-14 to make consistent, 2-8 Index, centralized, 3—1 INIT, form of statement, 4-17 comma must follow, 4-2 interchangeable with name, RECORD and field, 4—2 reference reference reference data DIBOL formats, program, in Procedure Division, 4-2 4-2 4-11 vii (DIBOL), high-level programming, 1-2 LINE FEED key, not part of COS-310, 2-2 Language, INDEX-5 INDEX Line Number (LN) Line numbers, references, as command, 2—7 is (LI) display at cursor location, 4—14 Mode designation, 4-17 a, 4-5 Command, Modulo 16, Monitor, instructions named file, 3—3 the edit buffer, 3- 3 through the keyboard, 3— 2 Logical unit numbers, 3—2 a Name, command Logical units, reassigned, referenced 4—2 vii unit from, 3-3 assignments Negative Numbers, 3-1 Logical unit table, 3—1 displayed on screen, 3—4 is listed END Lowercase last on printer, characters, in 3—4 vi Manual, notational conventions for, of this, v vi organization storage device, unit on, logical storage media designations of, vi Nonfatal errors, ON ERROR with, 4-22 Notational conventions for manual, vi NO TRACE, form of statement, 4-26 Number commands, 2-8 Numeric called mass of storage, mass vi into vii storage, device, vii loaded 4-10 device, vii 1—2 skip-codes with negative, device, vii Media, designations form, Number, drive, vii Numbers, lines as reference, 3—1 called numeric skip-codes with, 4—19 Negative value, 4-10 Nesting, 4-22 3-3 entry in, vii program (pronam), Named file, logical 3—l by number, file, Division designates, 4-1 interchangeable with label, Data media, 3—5 arrangement COS-310 depends on, 1-3 explains use of, vi how assigned, 3-2 on 6-INDEX 4—4 alphanumeric, 4-5 fields used in, 4-6 numeric, 4-6 records used in, 4-6 Multiplying (*), 4-7, 4-8 2-6 for 2—1 devices, manipulation Moving data, Logical unit assignments, displayed and listed, 3-4 also data statements, storage-map, 2-6 two—part compilation, Loading data, Move 2—4 4-16 and editor commands, 2-3 commands spelled out, vi divided into two parts, 1-2 number commands, 2-2 system, 1—2 Listing, also errors, Message, source Mass bytes of, MENU, eliminate operator 1-3 1-2 2—2 Mass 16K 1—1 incremented, 2—7 Literals, alphanumeric, 4-13 defined in Data Division, 4-13 expressions can contain, 4-7 implement data, 4-13 numeric, 4—13 record, 4-13 from from minimum of Memory, CTRL/Z terminates automatic, LIST (Cont.) 4—19 characters, after A or D, 4-3 before A or D, 4—3 generate special effects, Numeric data, moving, 4-6 4-15 INDEX ON ERROR, verifies, 4—23 elements, expressions (Cont.) Program, Numeric contain, Numeric fields, can compile calculations only up in, 4-3 characters in, 4-3 15 to and comments explain Vi 1 4-1 4-7 the document, 2-5 source, control statements, 4—20 CTRL/C terminates execution Numeric form of negative numbers, 4-10 Numeric key panel, adjacent to of, 2-2 labels reference DIBOL, vii Monitor controls execution, 1-2' keyboard, 2-1 literal, 4-13 Numeric name too use 0 (pronam), vii big, 2—7 of logical units, 3—6 Program execution, mode designation 4-17 0, ON ERROR, form of for TRACE output, TRAP provides record of, 4—25 coordinates printer with, 4—24 statement, 4—22 Programs, from the directory, 2—9 functional view of DIBOL, v perform functions with, 1-2 Operating COS-310, procedures for, v Operators, expressions erase can contain arithmetic, 4—7 Option switches, DFU, 3—2 Optional hardware, 1—1 Organization of manual, v Output, CTRL/S suspends terminal, 2-2 Output from editor, 1-2 system utility, 1—2 language Progragming (DIBOL), 1- Punctuation, in RECORD 4—1 4-2 numbers statement, placement of, proper Push-down sequence, assigned in, 3—5 p Pages, FORMS starts new, 4-19 Parentheses, operations within 0 Questions, to display on screen, 4-14 executed first, 4-9 Patch, official notification from DIGITAL, 2-5 Quotes, Peripheral interchange program 1-3 COS-310 program, double, 4-11, single, 4—13 4—13 (PIP), PRINT, utility R 1-3 Printer, R records listed routine, 4—25 TRAP on, 4-16 RE coordinates with program, 4-24 statement, mandatory, 4-7 on, nonexecutable 4-4 Procedure Division, contains DIBOL statements, 2—5 4-18 2-8 units, 3—1 statement, (RESEQUENCE) command, Reassigned, logical in a program, 1—2 labels referenced in, 4-2 installation, v label, 4-2 in READ statement, 4—18 in WRITE statement, 4-18 Record Record 4-4 develop programs in, 4-1 example statements from, 4-4 Procedures, command, form of Record Priority, calculations PROC (RUN) READ, literal, 4-13 number (rec#), in READ statement, 4—18 in WRITE statement, 4—18 RECORD statement, designates a group of fields, 4-1 punctuation in, 4-1 INDEX-7 INDEX (Cont.) Segments Records, Shift register on double—character like alphanumeric fields, 4—6 used in moving data, 4—6 to, 2—5 SORT, COS-310's treated Red, printed in, vi comparison codes, characters Relational 4-20 DIBOL Report, generate, program will 1-3 Representatidns, symbolic, vi (RE) RESEQUENCE Resume terminal 2—2 RETURN 2-1 key, correct Command, 2-8 output, CTRL/Q, after, 2—2 symbol for, vi errors special press following input, vi no form of statement, 4-21, 4-24 last statement in printer routine, 4-25 with CALL, 4-21 with CALL or TRAP, 4-22 with TRAP, 4-24 RK05 disk, DK indicates, vii RETURN, Rounding (R) RUN (#), 4—7, 4-8 command, 2—5 programs 4—23 to be /T activates TRACE, Skip-code, 4—19 Skip lines, FORMS follow, 4—25 2—1 key, printer causes 4—19 to, unauthorized Software, changes 1-3 multiphase, Source, data manipulation statement, 4-4 example of, 4-6 expression as, 4—5 files (S), 2—5 literal as, 4-5 program, compile a, 2-5 record literal as, 4—13 text editor, Monitor controls, 1—2 variable as, for of ease 4-2 reading, START, 4—5 variation Spacing, nonexecutable statement, 4-1 address Starting of first block, 3—2 Starting instructions for hardware, 2—1 Start-up and backup, installation, 1-3 Statements, follow label must comma chained 3—1 logical units, on cleared as in an array, 4—12 data manipulation statement clears, 4—12 display or list, 4—16 field data information accompanies, 4-1 in, 4—2 conversational, 1—3 1-2 are mnemonic, from Procedure Division, 4—4 Stop display of characters, DIBOL RX indicates RX01 diskette, vii RX01 and RX02 drives, 1-1 RX01 diskette, RX indicates, vii RX02 diskette, DY indicates, vii RX02 drives, RX01 and, 1-1 CTRL/O, 2-2 STOP, does not program close files, control 4-21 statement, 4—21 S S, S designation for file, 4-17 (source) files, 2—5 mode SAVE (SA) Scratch command, area, source 3-5 arrangement of system device, 2-5 binary, 3—5 2-6 Data clear the, 4—14 cursor to 4-14 records location on, displayed on, 4—16 suspend output to, 2-2 8-INDEX Division designations flexibility, Screen, move Storage, arrangement of data device, media, vii Storage device, mass, allocates, of mass, 3—1 4—1 vi logical unit 3—l Storage-map listing, 2-6 on INDEX Terminates program execution, Subroutines, CALL (Cont.) with, 4-22 and RETURN from, 4-21 where to write, 4-21 Subscripted data elements, expressions can contain, STOP, Terminator elements in 4—7 array, 4—3 to clear 4—12 elements in character, 4—19 editor, Monitor controls Text Subscripts, reference 2-2 4-21 CTRL/C, statement CALL source, 1-2 Three—character TRACE, array, designation, vi Top-of—page command, issues, 4—1 START form of statement, 4—25 of records, 4-15 form of statement, 4—24 Transfer, Subtracting (-), 4-7, 4-8 Symbolic representations, vi SYSGEN, utility program called, TRAP, Type of fields, determines, Data Division 4-1 1—3 System, date, change the, 2-3 devices, arrangement of storage on, (V), 2-5 U U, files Monitor, utility mode 1-2 programs, designation terminal, 4-17 for for update, 4—1 system, 1-2 Uppercase alphabetic characters, Utility 1-2 designation 4—17 Unnamed records, 3-5 programs, vi T V mode T, /T, TRACE function activated 4-25 V by, (system) Values, contain 2-5 Division may initial, 4—1 files, Data Table, display on screen, 3-4 in listed END logical unit, 3—3 on printer, 3—4 output an expanded, 3-4 Terminal alarm, 7 sounds, 4—15 Terminal output, CTRL/Q resumes, 2—2 VV (WR) WRITE WRITE, form command, of 2-5 statement, 4—18 X XMIT statement, form of, 4-15 INDEX-9 COS-310 New User's Guide AA-D758A-TA READER'S COMMENTS ————.—_._—_—_—_—_._— DIGITAL will for document comments only. submitted on this form at the company's Problems with software should be reported discretion. If you on a Software Performance Report (SPR) form. require a written reply and are eligible to receive This NOTE: use form is comments under SPR service, form. one Did you find Did you find line Please make errors submit your comments in this manual? If so, this manual understandable, suggestions for on specify by and usable, an SPR page. well-organized? improvement. is E afimg cut Please sufficient documentation on associated system programs If not, for use of the software described in this manual? what material is missing and where should it be placed? Is there required Please indicate the type of user/reader that you most nearly represent. Assembly language programmer Name DDD Higher-level language programmer Occasional programmer (experienced) User with little programming experience Student programmer Non-programmer interested in computer concepts and capabilities Date Organization Street City State____________.zip Code or Country Fold Here Do Not Tear - Fold Here and Staple FIRST CLASS PERMIT NO. 33 MAYNARD, MASS. BUSINESS REPLY MAIL NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES Postage will be paid by: EJflElflIEII Business Products Software Development Group 2/H32 Camp Sargent Road Merrimack, New Hampshire MK 03054 Eflaflflfifl digital equipment corporation
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies