Hi,
In a recent interview I'm asked if the COPY statement can be used in Procedure Division Yes/No?
I think we can sue it but what if the member has only a copy-book details? I've heard there are shops which might use COPY to have some "sub-modules" in the main program and there we can make use of COPY? Is that correct?
Please help.
Can COPY be used in Procedure Division.
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Can COPY be used in Procedure Division.
Yes, COPY is valid in PROCEDURE DIVISION. It is not used that often, but one example I've seen of it is where a group wanted to ensure everyone used a data base the same way, the various data base access commands (this was pre-SQL) were placed into COPY books and copied into the program when needed.
Re: Can COPY be used in Procedure Division.
Thanks Robert. But in doing so, I think , we can't use "REPLACING" phrase I believe. I'll try to experiment it once I get to Mainframes....
Thanks,
Thanks,
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Can COPY be used in Procedure Division.
I am not aware of any restrictions on REPLACING in the PROCEDURE DIVISION COPY statement.
Re: Can COPY be used in Procedure Division.
This works in PROCEDURE DIVISION as well. Thanks for your insight Robert.
Regards,
Regards,
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute