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
 
Can I edit the DCLGEN member without changing Table structur

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Can I edit the DCLGEN member without changing Table structur
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Can I edit the DCLGEN member without changing Tabl
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 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 exec macro in the end of edit anatol CLIST & REXX 8 Fri Sep 22, 2017 5:10 am
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

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