Code Monkey home page Code Monkey logo

Comments (3)

seahopki12 avatar seahopki12 commented on May 19, 2024 1

Ah...Totally missed the period sign. That's exactly what I needed to know. Thanks!

from cobol-programming-course.

sccosel avatar sccosel commented on May 19, 2024 1

@pineconeman09 - My advice, get rid of ALL unnecessary periods. They are just not necessary any more. And, more good advice for those starting out:

  1. There should only be 2 periods per paragraph, 1 at the end of the paragraph name, and 1 on a blank line of its own at the end of the paragraph.
  2. Always use GOBACK instead of STOP-RUN.
  3. No need to use PERFORM THRU or EXIT paragraphs.
  4. No need to use GOTOs. Use an IF statement and CONTINUE to check the (88-level) value of LASTREC to conditionally execute the PERFORM. Or, since you will only use 1 period within a paragraph, NEXT SENTENCE will take you to the end of the paragraph.
  5. A READ or WRITE paragraph should be limited to just a READ of a file or WRITE of a record. Optionally, one group MOVE statement. The purpose of this type of paragraph is to be versatile enough to be able to perform it multiple times from different parts/areas of your program.
  6. Never use NOT or only in very obvious, simple usage.

from cobol-programming-course.

binary-sequence avatar binary-sequence commented on May 19, 2024

Explicit means being verbose about something. Implicit means omitting something because that something is expected or obvious.

If you notice, there is an implicit termination

       IS-STATE-VIRGINIA.
           IF USA-STATE = 'Virginia' THEN
              ADD 1 TO VIRGINIA-CLIENTS. <---- here, the period
           END-IF.

But, the compiler doesn't know what you want to achieve. For the compiler the implicit termination is enough, so it complains that the it END-IF is not necessary.

There are two ways of resolving that compiler error:

  1. You decide to use the implicit terminator (period is a sentence terminator that implicitly terminates IF)
  2. You decide to use the explicit terminator (END-IF, so you should remove the period at the end of previous line). END-IF is an explicit terminator, but it is only valid with a period END-IF.

from cobol-programming-course.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.