Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copybook Scope Terminator within IF/Evaluate Conditions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ramanindya55

New User


Joined: 23 May 2008
Posts: 9
Location: pune

PostPosted: Thu Mar 18, 2010 8:27 pm    Post subject: Copybook Scope Terminator within IF/Evaluate Conditions
Reply with quote

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
View user's profile Send private message

daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 670
Location: Pennsylvania

PostPosted: Thu Mar 18, 2010 10:44 pm    Post subject:
Reply with quote

Could it be that pesky period at the end of the line?

Code:

COPY PRINTEMP.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 18, 2010 11:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Fri Mar 19, 2010 3:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
No new posts Geneartion of COBOL copybook structre... murugan_mf COBOL Programming 3 Fri May 20, 2016 12:48 pm
No new posts View Copybook having COPY statement i... nkumar Compuware & Other Tools 6 Mon May 16, 2016 7:28 pm
No new posts DFSORT report with multiple conditions Bill Woodger DFSORT/ICETOOL 9 Wed Jan 20, 2016 2:19 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us