Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What is the use of DCLGEN for table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
anurag_25dec

New User


Joined: 01 Aug 2006
Posts: 4
Location: Banglore

PostPosted: Wed Sep 27, 2006 7:23 pm    Post subject: What is the use of DCLGEN for table
Reply with quote

Hi
Anyone can tell me that what is the use of DCLGEN for table?
If it is declared and included into application program then what is the need for delaring host varriable?
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Sep 27, 2006 7:47 pm    Post subject:
Reply with quote

Hi Anurag,

DCLGEN generates a table declaration and puts it into a member of a partitioned data set that you can include in your program. When you use DCLGEN to generate a table's declaration, DB2 gets the relevant information from the DB2 catalog, which contains information about the table's definition and the definition of each column within the table. DCLGEN uses this information to produce a complete SQL DECLARE statement for the table or view and a corresponding PL/I, C structure declaration, or COBOL record description. You can use DCLGEN for table declarations only if the table you are declaring already exists.

Host variable is used
Suppose we have a table EMPLOYEE that have coloumn EMPID,EMPNAME,EMPFNAME,DOJ,EMPSALARY.Now we have DCLGEN
EMPLOYEE for this table which is included in the application pgm but
in the pgm we need to select all the emp whose fname is VIJAY which is
in some working storage variable like WS-EMPFNAME.
In the pgm we can use
EXEC SQL
SELECT *
FROM EMPLOYEE
WHERE EMP_FNAME = :WS-EMPNAME
END-EXEC.

HERE IN THE FOLLOWING QUERY WE USED WS-EMPNAME AS HOST VARIABLE.
Hope i make myself clear enough.
Back to top
View user's profile Send private message
anurag_25dec

New User


Joined: 01 Aug 2006
Posts: 4
Location: Banglore

PostPosted: Sat Sep 30, 2006 2:28 pm    Post subject: db2
Reply with quote

Thanks !
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us