period is missing in the cobol program which error we
getting

Answer Posted / vish

Unfortunately none of the answers are complete. A missing
period doesn't always give compilation errors rather it
depends upon at which place the period is missing. Ending a
sentence with a period in COBOL is rather a good practice
than a mandate for most of the code otherwise the code may
be logically gonig in wrong way. But true, COBOL mandates
that a period must be given at some places. for example,
see the below syntax:

000000-PARA.
IF ABC
DISPLAY 'ABC'
END-IF
<COBOL SYNTAXES>
<COBOL SYNTAXES>
DISPLAY 'AT THE END OF PARA'
000000-EXIT.
EXIT.

here it will give the compilation error as the compiler
expects the last executable sentence before the 000000-EXIT
to be ended with a period (.). However, if we end the last
DISPLAY sentence with a period then the compilation will go
fine without any error or warning.

consider some other examples...
case#1
000000-PARA.
IF ABC = 0
DISPLAY 'ABC'
ELSE
NEXT SENTENCE
END-IF
DISPLAY 'BCD'
DISPLAY 'CDE'
DISPLAY 'AT THE END OF PARA'.
DISPLAY 'BYE'.
000000-EXIT.
EXIT.

case#2
000000-PARA.
IF ABC = 0
DISPLAY 'ABC'
ELSE
NEXT SENTENCE
END-IF.
DISPLAY 'BCD'.
DISPLAY 'CDE'.
DISPLAY 'AT THE END OF PARA'.
DISPLAY 'BYE'.
000000-EXIT.
EXIT.

Suppose ABC has a value 1 then we will get the output as
follws:
for case#1
BYE

for case#2
BCD
CDE
AT THE END OF PARA
BYE

These are just some examples...bottomline is - if we don't
give the scope terminator with periods then we may get
compilation errors or we may get logical errors, depending
upon where you missed the period. Enjoy!

Is This Answer Correct ?    12 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to move the records from file to array table. give with code example

2216


What are different data types in cobol?

685


What is the default value(s) for an initialize and what keyword allows for an override of the default?

691


Differentiate between structured cobol programming and object-oriented cobol programming.

663


What is a report item?

737






What is the difference between external and global variables in COBOL?

811


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

1608


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

678


What the difference is between continue and next sentence?

651


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

670


what happens if parmparameter passes zero bytes to the program

1660


What are declaratives and what are their uses in cobol?

706


What is the default value(s) for an initialize? What keyword will allow for an override of the default?

654


What is Pic 9v99 Indicates in COBOL?

722


If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly

2657