Hi,
How to understand this syntax
Copy AAAAAAAA REPLACING ==:BBBBBBBB:== BY ==:CCCCCCCC:==
REPLACING in COBOL.
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: REPLACING in COBOL.
AAAAAAAA is a member of the copy library, which is the SYSLIB DD statement. When the copy is inserted into the COBOL source code, every occurrence of :BBBBBBBB: will be replaced by :CCCCCCCC: but this does not change the copy library member -- just the inserted text.
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: REPLACING in COBOL.
SYSLIB is a special DD statement that is used for copy books in COBOL (although it can be used with the linkage editor / binder as well as other languages). When you code COPY ABCDEFGH in COBOL, the compiler looks in the SYSLIB partitioned data set for a member named ABCDEFGH and inserts the contents of that member into the source to be compiled. This allows different programs (possibly in different applications) to use the same code (for example, to define the layout of a data set).
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