Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us