IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can I edit the DCLGEN member without changing Table structur


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Aug 22, 2007 3:42 pm
Reply with quote

Hi All,

I have one doubt regarding the DCLGEN.

For example I have a table like EMP with fields eno,ename,dept,sal and parallely i have DCLGEN member (COPYBOOK) with the same fields
wh-eno,wh-ename,wh-dept,wh-sal.

Now In one program i have a requirement to add a new field (Age) to the copybook.

Shall I do it without adding the same field to the table.

I am analasys phase. I need a solution without testing this.

Please can anyone answer this.
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Aug 22, 2007 5:29 pm
Reply with quote

I dont know whether your system will allow you to edit DCLGEN as you have mentioned. I do not have edit access to dclgen library out here. Even if you are able to edit dclgen, you wont be able to bind the code rt, as far as the table does not have the columns age?

Thanks,
Prajesh
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Aug 22, 2007 6:59 pm
Reply with quote

Hi Prajesh_v_p


What do u mean by Column's age?
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Aug 22, 2007 7:34 pm
Reply with quote

Oouh...That was a typo..I meant the new column 'Age' that you wanted to add in table..!

Thanks
Prajesh
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Thu Aug 23, 2007 2:03 pm
Reply with quote

If you have access to edit the DCLGEN Lib u can edit that same and add the new column "AGE".
Just to provide the design , but do remeber if you are using this AGE as SQL atatement i.e with EXEC SQL and END-SQL , to fetch some value in that case it will give you BIND failure.

Adding new varibale in DCLGEN, just for desingning puprose gives no issue as it's just like one varaible is being added in one the copy book, and the same is not used in program. Issue comes if you try to fetch or update with the same DCLGEN varibale in ur table. Just declaring in DCLGEN won't give problem.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Thu Aug 23, 2007 2:30 pm
Reply with quote

So u mean,

Until and unless we use 'AGE' in an SQL statement we won't get any problems.


Another small doubt:

This particular copybook is used in many other program, do they need to recompile when i made changes to this COPYBOOK, provided that all those program using this copybook does not require this new field "AGE".
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Thu Aug 23, 2007 2:40 pm
Reply with quote

Not exactly..the things is just for analysis...but in PROD u need to have the columns same in table and DCLGEN. Just for anlysis and time being u can do that. But that is not good practice.

In case of any copy book one things is fixed if you are adding the varibale at the end of copy book by changing the filler value u don't need to recompile all the programs. Recompilation is required only in case of if the new varibale which is being added is used in a aprticular program.

Recompilation is required if u are adding the varibale in between some where not at the end.
At the same time if ur copy book total lengthe is altered and the same is used to write any new file in that case u need change the JCl and need to recompile.
Back to top
View user's profile Send private message
Balraj

New User


Joined: 16 Aug 2007
Posts: 34
Location: Bangalore

PostPosted: Thu Aug 23, 2007 3:07 pm
Reply with quote

hi mkk


U can add fields in DCLGEN thad field refers as a Working Storage

Varaible. U can use it in cobol program,but U cannot use in SQL

statements.

When U use the same copybook in other program then that field will be

defined as Working Storage Varaible.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Thu Aug 23, 2007 3:29 pm
Reply with quote

Since I am adding a new field AGE to the COPYBOOK I need to define this particular field as an working-storage variable WS-AGE in all the programs where this particular COPYBOOK has been used.

I am sure that this filed AGE is not at all used in SQL statement in any of the programs. But I am accessing all other fields of the table for some processing..

But here by adding a new filed to the copybook the length is varying. then should I recompile all other programs using this copybook even though they are not using this field AGE.

So conclusion is I can add a new field AGE to the COPYBOOK provided that AGE field should not be used in the SQL query in any of the programs.

Am I right?
Back to top
View user's profile Send private message
Balraj

New User


Joined: 16 Aug 2007
Posts: 34
Location: Bangalore

PostPosted: Thu Aug 23, 2007 5:10 pm
Reply with quote

HI

No need to declare in the Working Storage Section

Age field is used as Working Storage variable
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top