View previous topic :: View next topic |
Author |
Message |
Baskaran Beginner
Joined: 04 May 2007 Posts: 2 Topics: 1
|
Posted: Tue May 08, 2007 1:20 am Post subject: DCLGEN-Creation |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue May 08, 2007 2:27 am Post subject: |
|
|
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 |
|
 |
Baskaran Beginner
Joined: 04 May 2007 Posts: 2 Topics: 1
|
Posted: Tue May 08, 2007 2:56 am Post subject: |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue May 08, 2007 3:03 am Post subject: |
|
|
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 |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue May 08, 2007 3:54 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Wed May 09, 2007 2:31 am Post subject: |
|
|
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.
 |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed May 09, 2007 4:53 am Post subject: |
|
|
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 |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Wed May 09, 2007 5:11 am Post subject: |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed May 09, 2007 6:02 am Post subject: |
|
|
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 |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Wed May 09, 2007 6:31 am Post subject: |
|
|
yes, if it's not going to use it in the future... maybe it's better 'by hand'. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed May 09, 2007 6:45 am Post subject: |
|
|
deleted by dbz _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed May 09, 2007 6:47 am Post subject: |
|
|
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 |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Thu May 10, 2007 6:52 am Post subject: |
|
|
ok, I had read the post twice to understand that's what he's trying to do... |
|
Back to top |
|
 |
|
|