View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
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 |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
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 |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi Prajesh_v_p
What do u mean by Column's age? |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Oouh...That was a typo..I meant the new column 'Age' that you wanted to add in table..!
Thanks
Prajesh |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
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 |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
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 |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
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 |
|
|
Balraj
New User
Joined: 16 Aug 2007 Posts: 34 Location: Bangalore
|
|
|
|
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 |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
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 |
|
|
Balraj
New User
Joined: 16 Aug 2007 Posts: 34 Location: Bangalore
|
|
|
|
HI
No need to declare in the Working Storage Section
Age field is used as Working Storage variable |
|
Back to top |
|
|
|