2. Which of the following statement(s) explains the
difference(s) between the /INCLUDE and ICOPY directives?
a.) No difference, they function the same
b.) ACOPY cannot be used as a conditional directive
c.) IINCLUDE files cannot contain embedded SQL
d.) Nesting /TNCLUDE directives is not allowed
Answers were Sorted based on User's Feedback
Answer / sumamurali
Answer is C.
Explanation is given below to support the answer :
Using /COPY and conditional compiler directives in your RPG
IV programs lets you easily reuse RPG IV code. Some of you
using /COPY extensively have run into problems, though,
when using /COPY in SQLRPGLE members. When compiling
SQLRPGLE members, the SQL precompiler first processes the
SQL statements and then copies in the members specified
in /COPY. The problem is that the SQL precompiler doesn't
handle /EOF or nested /COPY members correctly. The
precompiler adds in the /COPY member, including /EOF, which
causes the compiler to ignore all lines following /EOF,
causing the compile to fail.
/INCLUDE can be used interchangeably with /COPY, as they
do exactly the same function with one exception: the SQL
precompiler leaves the /INCLUDE in the source member,
without reading the /INCLUDEd source member.
Because the SQL precompiler never processes an /INCLUDE
source member, the /INCLUDEd member shouldn't contain
embedded SQL or definitions relating to host variables. If
you do need to include embedded SQL or definitions relating
to host variables in an included member, you can still
use /COPY -- just don't use /EOF in the included member.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / nandini
The /COPY and /INCLUDE directives are identical except that
they are handled differently by the SQL pre-processor:
The /COPY directive is expanded by the preprocessor. The
copied file can contain embedded SQL or host variables.
The /INCLUDE directive is not expanded by the preprocessor.
The included file cannot contain embedded SQL or host
variables.
| Is This Answer Correct ? | 1 Yes | 0 No |
What is the purpose of Panel Groups?
how to convert date format from one format to another i think in CL/400 its CVTDAT,Please tell in RPG/400 sir not in RPGILE
Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?
Can you copy the records created by the OPNQRYF to other files and how?
what is the difference between the procedure and module in ILERPG?
Hi guys, anybody know How RPG/400 code can be converted to RPG IV code with a single command?
what is the rpg system?
how do I declare a table or array in rpg iv?
1.Are there any errors in the following statement?If so then list them.DTAARA is a data area having a field EMP # and EMPNO is a field in the file EMPPF.Which has one record. READ EMPPF IF %FOUND(EMPPF) IN DTAARA EVAL EMP#=EMPNO OUT DTAARA ENDIF
how do u find whether a record is locked or not??
How would display prime numbers using CL program?
1.What is the Maximum field length we can declare in RLU?? 2. What is the difference if your designing RLU using DDS and using the option 19 for the RLU??