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

Explain how you can characterize tables in cobol?

634


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

724


what is the use of outrecord?

1761


Describe the cobol database components?

668


1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

5353






What is difference between static and dynamic call in cobol?

766


What is amode(31)

712


Write a program that uses move corresponding.

664


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

1691


What guidelines should be followed to write a structured cobol prgm?

661


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

919


What is the difference between Global and External Variables?

654


How arrays can be defined in COBOL?

658


System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..

1577


A table has two indexes defined. Which one will be used by the SEARCH?

745