{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

section4 - Business Oriented Programming Course 92-252-01...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Business Oriented Programming Course 92-252-01 – Spring 2005 SECTION 4 – Procedure Division The PROCEDURE DIVISION contains the code used to manipulate the data described in the DATA DIVISION In COBOL, the ACCEPT and DISPLAY verbs are used to read from the keyboard and write to the screen. Input and output using these commands is somewhat primitive because they were originally designed for use in a batch-programming environment to communicate with the computer operator. In recent years, many vendors have augmented the ACCEPT and DISPLAY syntax to facilitate the creation of on-line systems by allowing such things as: cursor positioning, character attribute control and auto-validation of input. DISPLAY VERB The DISPLAY verb sends output to the computer screen or to a peripheral device. As you can see from the ellipses (...) in the metalanguage, a single DISPLAY may be used to display several data-items or literals or any combination of these NOTE: In the COBOL syntax diagrams ( COBOL metalanguage) upper case words are keywords. If underlined, they are mandatory. { } brackets mean that one of the options must be selected [ ] brackets mean that the item is optional ellipses (...) mean that the item may be repeated at the programmer’s discretion. The symbols used in the syntax diagram identifiers have the following significance:- $ signifies a string item, # is numeric item, i indicates that the item can be a variable identifier l indicates that the item can be a literal. DISPLAY OutputItem1$#il [OutputItem2$#il]… [UPON Menmonic – Name] [WITH NO ADVANCING ] After the items in the display list are seny to the screen, the DISPLAY automatically moves the screen cursor to the next line unless a WITH NO ADVANCING clause is present.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Mnemonic-Names make programs more readable. A Mnemonic-Name is a name devised by the programmer to represent some peripheral device (such as a serial port) or control code. The name is connected to the actual device or code by entries in the ENVIRONMENT DIVISION. When a Mnemonic-Name is used with the DISPLAY it represents an output device (serial port, parallel port etc). If a Mnemonic-Name is used output is sent to the device specified; otherwise, output is sent to the computer screen. DISPLAY examples DISPLAY "My name is " ProgrammerName. DISPLAY "The vat rate is " VatRate. DISPLAY PrinterSetupCodes UPON PrinterPort1 The ACCEPT verb is used to get data from the keyboard, a peripheral device, or certain system variables. Format1. ACCEPT Identifier [FROM Mnemonic – Name] Format2. ACCEPT Identifier FROM { DATE DAY DAY – OF – WEEK TIME } ACCEPT notes When the first format is used, the ACCEPT inserts the data typed at the keyboard (or coming from the peripheral device), into the receiving data-item. When the second format is used, the ACCEPT inserts the data obtained from one of the system variables, into the receiving data-item.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern