Question

  Asked: Jul 4 2008   5:11 PM GMT
  Asked by: Alicsc


What is Copybook in AS/400(RPG)


AS/400, RPG/400

Can any one pl explain me with an example what is copybook?.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0



Copybook is a bunch of source code statements.
Lets take an example:

I have around 100 programs which are doing addition for two numbers.
Now in this scenario I can write logic of adding two numbers but instead of writing same code in alll programs I can create a member and put the code for adding two numbers into it and just copy that member into the programs where I want to implement this logic.
The source of this copy book can be seen into the spool file of the program in which you ha ve included it.

let me know if you stilll need any more explanation.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Gilly400  |   Jul 7 2008  8:13AM GMT

Hi,

You use the compile time directive /COPY to add the source from another source member into your
program.

These days it would be more advisable to use a module instead of a copybook.

Regards,

Martin Gilbert.