When the DCLGEN variable are used?
-
- Registered Member
- Posts: 12
- Joined: Tue Jan 19, 2016 10:32 am
When the DCLGEN variable are used?
Hi,
Another interview question is this with whcih I need help.
When we write a COBOL DB2 program, we use DCLGNE in the program. When we include the DCLGEN in the program then are the variable taken into consideration at the time of pre-compilation or compilation?
I do not know answer. But I think it shouldbe at compilation time but do we have some place explaining it or someone can help me with an answer please.
Another interview question is this with whcih I need help.
When we write a COBOL DB2 program, we use DCLGNE in the program. When we include the DCLGEN in the program then are the variable taken into consideration at the time of pre-compilation or compilation?
I do not know answer. But I think it shouldbe at compilation time but do we have some place explaining it or someone can help me with an answer please.
-
- Website Team
- Posts: 70
- Joined: Wed Jul 31, 2013 10:19 pm
Re: When the DCLGEN variable are used?
All the copy books mentioned with INCLUDE taken into consideration during per-compilation and all the copy books mentioned with COPY are taken into consideration during compilation
-
- Registered Member
- Posts: 13
- Joined: Tue Jan 19, 2016 11:49 am
Re: When the DCLGEN variable are used?
But DCLGEN has Cobol variables, if INCLUDE is used on precompile time...what is the use of DCLGEN in precompile ?
Re: When the DCLGEN variable are used?
Have you ever looked at the output from the precompiler? If not then I suggest that you do and then, perhaps, it will become clear to you.
Regards
Nic
Nic
-
- Registered Member
- Posts: 13
- Joined: Tue Jan 19, 2016 11:49 am
Re: When the DCLGEN variable are used?
I have seen the output of precompiler. But waht I wanted to say is, we use DCLGEN for COBOL equivialent variables of a Table. But precompiler will not check the COBOL declaration, so does precompile check for table-definition in DCLGEN?
-
- Registered Member
- Posts: 12
- Joined: Tue Jan 19, 2016 10:32 am
Re: When the DCLGEN variable are used?
i also looked at DCLGEN.
So basically precompiler will check all this from above definition:
Is that correct?
Code: Select all
***** DCLGEN TABLE(DSN8A10.VPHONE) ***
***** LIBRARY(SYSADM.TEMP.COBOL(VPHONEC)) ***
***** QUOTE ***
***** ... IS THE DCLGEN COMMAND THAT MADE THE FOLLOWING STATEMENTS ***
EXEC SQL DECLARE DSN8A10.VPHONE TABLE
( LASTNAME VARCHAR(15) NOT NULL,
FIRSTNAME VARCHAR(12) NOT NULL,
MIDDLEINITIAL CHAR(1) NOT NULL,
PHONENUMBER VARCHAR(4) NOT NULL,
EMPLOYEENUMBER CHAR(6) NOT NULL,
DEPTNUMBER CHAR(3) NOT NULL,
DEPTNAME VARCHAR(36) NOT NULL
) END-EXEC.
***** COBOL DECLARATION FOR TABLE DSN8A10.VPHONE ******
01 DCLVPHONE.
10 LASTNAME.
49 LASTNAME-LEN PIC S9(4) USAGE COMP.
49 LASTNAME-TEXT PIC X(15).
10 FIRSTNAME.
49 FIRSTNAME-LEN PIC S9(4) USAGE COMP.
49 FIRSTNAME-TEXT PIC X(12).
10 MIDDLEINITIAL PIC X(1).
10 PHONENUMBER.
49 PHONENUMBER-LEN PIC S9(4) USAGE COMP.
49 PHONENUMBER-TEXT PIC X(4).
10 EMPLOYEENUMBER PIC X(6).
10 DEPTNUMBER PIC X(3).
10 DEPTNAME.
49 DEPTNAME-LEN PIC S9(4) USAGE COMP.
49 DEPTNAME-TEXT PIC X(36).
***** THE NUMBER OF COLUMNS DESCRIBED BY THIS DECLARATION IS 7 ******
Code: Select all
EXEC SQL DECLARE DSN8A10.VPHONE TABLE
( LASTNAME VARCHAR(15) NOT NULL,
FIRSTNAME VARCHAR(12) NOT NULL,
MIDDLEINITIAL CHAR(1) NOT NULL,
PHONENUMBER VARCHAR(4) NOT NULL,
EMPLOYEENUMBER CHAR(6) NOT NULL,
DEPTNUMBER CHAR(3) NOT NULL,
DEPTNAME VARCHAR(36) NOT NULL
) END-EXEC.
Is that correct?
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