View previous topic :: View next topic
|
Author |
Message |
ramanindya55
New User
Joined: 23 May 2008 Posts: 9 Location: pune
|
|
|
|
Hi,
I have following code.
Code: |
IF AGE > 20 AND AGE < 60 THEN
Move 'Valid Data' TO WS-OUT-TEXT
ELSE
Move 'Invalid Data' TO WS-OUT-TEXT
COPY PRINTEMP.
DISPLAY 'STILL IN THE ELSE LOOP'
END-IF.
|
And in the Copybook, I have following piece of Code. I have not used any Scope terminator in the copybook.
Code: |
DISPLAY 'In PRINTEMP copybook' |
My Question is whether the display 'STILL IN THE ELSE LOOP' statement will get executed.
If so, How the compiler is interpreting the Scope terminator which I have given after COPYBOOK ?
Please help me if you have any idea.
Thanks in Advance !!! |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Could it be that pesky period at the end of the line?
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
My Question is whether the display 'STILL IN THE ELSE LOOP' statement will get executed. |
What happens when you run this? |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
Many shops have development standards that also may specify the use of copybooks. I think most standards advice against using copybooks for bringing in code. If the logic should be reuseable globally, put it in a separate submodule.
If your site endorse using copybooks for code, they (your development support) should already know the answer to your question
If the copied statements is some standard execution, it could be made part of a standard template for a Cobol module. |
|
Back to top |
|
|
|