MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DCLGEN-Creation

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Baskaran
Beginner


Joined: 04 May 2007
Posts: 2
Topics: 1

PostPosted: Tue May 08, 2007 1:20 am    Post subject: DCLGEN-Creation Reply with quote

Hi All,

I was trying to create DCLGEN,I got Declaration of table and host variable declaration in same member in my PDS.

But i need in two different members in my PDS one with just declaraion of table and other member with just host variable declaration,How can it be done with a JCL

Thanks
Baskaran
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 08, 2007 2:27 am    Post subject: Reply with quote

You cannot do it with JCL.

Why do you want to do it anyway? It is done that way because you generally need both together. If you need a separate one for the variables just cut and pasteit in ISPF.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Baskaran
Beginner


Joined: 04 May 2007
Posts: 2
Topics: 1

PostPosted: Tue May 08, 2007 2:56 am    Post subject: Reply with quote

Hi Nic,


We have around 200 tables to be recreated with DCLGEN since there is datatype change.The existing programs have separate copybooks for declare table and host variable.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 08, 2007 3:03 am    Post subject: Reply with quote

Where-ever I have worked I have NEVER seen them split in two! I am not aware of an option to do this - maybe someone else is. I would have to look at the manual, perhaps you should? Maybe they were created in the standard manner and someone went and split them? If so, did they do it by hand or write a little something to do it? Can you find whovere did it in the first place - or someone who has continued the practice?
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Tue May 08, 2007 3:54 am    Post subject: Reply with quote

The standard here is 'splitted', is done by a homegrown utility but you could play with syncsort/dfsort to copy to different files with outrec... for example is the reg has level numbers or PIC or... copy to outrec 1, else to outrec 2.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue May 08, 2007 7:50 am    Post subject: Reply with quote

Baskaran,

Your approach to use DCLGEN as DDL language is quite wrong. DCLGEN creates a DECLARE statement but it does not create a DDL statement like CREATE. How are you going to get the buffer pool/tablespace information from DCLGEN? what about the indexes?


There are many utilities which generate the DDL statements from IBM. If your shop DB2 visual explain or DB2 Control center , then both of them can generate the DDL statements. Check this link

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.cc.doc/db2_udb/generatingddlstatements.htm


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Wed May 09, 2007 2:31 am    Post subject: Reply with quote

What I understood:
When Baskaran use the option DCLGEN in the DB2I PRIMARY OPTION MENU:
Code:

DCLGEN                 (Generate SQL and source language declarations)   


Code:

                           DCLGEN                             SSID: DSNZ     
===>                                                                         
                                                                             
Enter table name for which declarations are required:                       
 1  SOURCE TABLE NAME ===> yourtable                        (Unqualified)   
 2  TABLE OWNER ..... ===> theowner                            (Optional)   
 3  AT LOCATION ..... ===>                                     (Optional)   
                                                                             
Enter destination data set:          (Can be sequential or partitioned)     
 4  DATA SET NAME ... ===> 'yourlibrary(yourtable)'                         
 5  DATA SET PASSWORD ===>           (If password protected)                 
                                                                             
Enter options as desired:                                                   
 6  ACTION .......... ===> REPLACE   (ADD new or REPLACE old declaration)   
 7  COLUMN LABEL .... ===> NO        (Enter YES for column label)           
 8  STRUCTURE NAME .. ===>                                     (Optional)   
 9  FIELD NAME PREFIX ===>                                     (Optional)   
10  DELIMIT DBCS .... ===> YES       (Enter YES to delimit DBCS identifiers)
11  COLUMN SUFFIX ... ===> NO        (Enter YES to append column name)       
12  INDICATOR VARS .. ===> NO        (Enter YES for indicator variables)     
                                                                             
                                                                             
PRESS: ENTER to process    END to exit      HELP for more information       


generate the DLCGEN and the copybook in the same member:

Code:

    yourlibrary(yourtable) - 01.00                 Columns 00001 00072
 ===>                                                  Scroll ===> CSR 
***************************** Top of Data ******************************
      ******************************************************************
      * DCLGEN TABLE(THEOWNER.YOURTABLE)                               *
      *        LIBRARY(YOURLIBRARY(YOURMEMBER)                         *
      *        ACTION(REPLACE)                                         *
      *        LANGUAGE(COBOL)                                         *
      *        QUOTE                                                   *
      * ... IS THE DCLGEN COMMAND THAT MADE THE FOLLOWING STATEMENTS   *
      ******************************************************************
           EXEC SQL DECLARE THEOWNER.YOURTABLE TABLE                   
           ( ONE_FIELD                      CHAR(4) NOT NULL,           
             ...                                                       
           ) END-EXEC.                                                 
      ******************************************************************
      * COBOL DECLARATION FOR TABLE THEOWNER.YOURTABLE                 *
      ******************************************************************
       01  DCLYOURTABLE.                                               
           10 ONE-FIELD            PIC X(4).                           
             ...                                                       
      ******************************************************************
      * THE NUMBER OF COLUMNS DESCRIBED BY THIS DECLARATION IS 108     *
      ******************************************************************
**************************** Bottom of Data ****************************


and Baskaran wants DLCGEN in one member and the copybook in other member...


I don't understand he's trying to use the DCLGEN for other purpose.


Question
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed May 09, 2007 4:53 am    Post subject: Reply with quote

acevedo,

Who are you trying to explain? I am sure that both nic and myself understood the question

btw DCLGEN can be run in batch

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Wed May 09, 2007 5:11 am    Post subject: Reply with quote

just to myself becouse what I don't understand is this:

Quote:

Your approach to use DCLGEN as DDL language is quite wrong. DCLGEN creates a DECLARE statement but it does not create a DDL statement like CREATE. How are you going to get the buffer pool/tablespace information from DCLGEN? what about the indexes?
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed May 09, 2007 6:02 am    Post subject: Reply with quote

Seems to me the place to start is withthe original create table ddl. If there are ONLY 200 tables then it will not take long to update using cut'n'paste - one day at most.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Wed May 09, 2007 6:31 am    Post subject: Reply with quote

yes, if it's not going to use it in the future... maybe it's better 'by hand'.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed May 09, 2007 6:45 am    Post subject: Reply with quote

deleted by dbz
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed May 09, 2007 6:47 am    Post subject: Reply with quote

acevedo wrote:
just to myself becouse what I don't understand is this:


kolusu wrote:


Your approach to use DCLGEN as DDL language is quite wrong. DCLGEN creates a DECLARE statement but it does not create a DDL statement like CREATE. How are you going to get the buffer pool/tablespace information from DCLGEN? what about the indexes?



acevedo,

Baskaran has clarified in the 3rd post of this topic where he wrote that he need to "recreate" around 200 tables. His idea was to manipulate the DCLGEN output so that he can recreate the tables stripping of the cobol/pli declarations. This is not a good approach as there are many other factors to be considered for creating tables.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu


Last edited by kolusu on Thu May 10, 2007 9:06 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Thu May 10, 2007 6:52 am    Post subject: Reply with quote

ok, I had read the post twice to understand that's what he's trying to do...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group