View previous topic :: View next topic
|
Author |
Message |
mallem_ravi Warnings : 1 New User
Joined: 29 Mar 2007 Posts: 10 Location: India
|
|
|
|
Hi,
i had a requirement to add a new field to the copybook, the length of the filler is not sufficient to add the new field, if i increase the length of the filler in the copybook then i need to compile and retest more than 10 programs which are all using this copybook, for this i want to create a new copybook and add it the required program, can anyone let me know
1) how can i speicfy the new field in the new copybook i.e in 01 level or 05 level
2) what would be the length of the new field.
ex:
copybook: TEX900TS
Code: |
01 TEX900-PREMIUM-FILE.
05 TEX900-POLICY-NUMBER PIC X(10).
05 TEX900-REPORT-BEG-DATE PIC X(10).
05 TEX900-REPORT-END-DATE PIC X(10).
05 TEX900-STATE-ABBR PIC X(02).
05 FILLER PIC X(08)
|
As i am not able to accomodate the new field with the length of 10 in this copybook, i have created a new copybook TEX901TS
Please let any body let me know the code for new copybook TEX901TS
field name is TEX901-DISTICT-CODE PIC X(10). |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Not only recompile but since the lrecl is changing, check jcl and parms....
I looked all through your post and couldn't find a question mark (?)....
Was there a question there? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How will a new copybook help? "The" copybook needs to match the actual record layout. Anything (program, sort, or other utility) that uses the file will need to use the new length.
Please clarify your request for the "code for new copybook". |
|
Back to top |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
Mallem,
I may not understand your situation well. However, sounds to me like creating a new copybook in order to avoid having to modify/test 10 programs is short-term thinking.
I would suggest: Bite the bullet. Modify/test your 10 programs. Do not create a new copybook.
If you do the short-term painless fix frequently then over time your system will start to acquire a smell. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Once you have created the new copybook under a different name you would have to change the copy statement in each program, then make the necessary program changes and any necessary JCL and utility statement changes. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello mallem_ravi,
Is progress being made?
Have we understood your requirement and made any suggestions that will get things done?
Looking back over our replies, i'm unsure whether we've provided the info you were looking for.
Please advise. |
|
Back to top |
|
|
mallem_ravi Warnings : 1 New User
Joined: 29 Mar 2007 Posts: 10 Location: India
|
|
|
|
Hi Scherrer,
One of the Techie proposed the solution is to create a new copybook(TEX901TS) with the same layout of the existing copybook(TEX900TS) with the additional new field like in the below format.
Code: |
01 TEX901-PREMIUM-FILE.
05 TEX901-POLICY-NUMBER PIC X(10).
05 TEX901-REPORT-BEG-DATE PIC X(10).
05 TEX901-REPORT-END-DATE PIC X(10).
05 TEX901-STATE-ABBR PIC X(02).
05 TEX901-DISTICT-CODE PIC X(10).
05 FILLER PIC X(08).
|
and we need to mention the new copybook (TEX901TS) name along with existing copybook(TEX900TS) in the current program, with this there is no need to change and test the all impacted programs which are using the existing copybook, But when ever there is any changes is happend in the existing copybook the same changes should be done in the new copybook.
Thanks
Ravi[/code] |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Ravi,
Could you please explain what have you achieved by using a new copybook? Record length of file is getting increased by addition of a new field, what happens to all the files and programs using old structure?
As Record length is increased, so if suppose same file is being read in a program which uses old structure then how you are going to tackle this situation.
Possible solution:
Increase the record length of 'existing generations/backup' of files.
Initialize the field being added in old generations also.
As TG said :Modify/test your 10 programs. Do not create a new copybook. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How will you manage having both copybooks mentioned in any one program?
The "real" file will be one length or the other but will not switch back and forth. When the file itself is expanded, any FD using it (as well as any sort or other utility) will have to be changed at that time - else jobs will terminate with an s013 abend.
Maybe there is something i'm not yet understanding. . . |
|
Back to top |
|
|
mallem_ravi Warnings : 1 New User
Joined: 29 Mar 2007 Posts: 10 Location: India
|
|
|
|
Hi,
sorry for my earlir reply, i have got the correct information now,
We should use only the new copybook TEX901TS in the program, and the output file will create based on the new copybook only, whenever the original copy book is changed then we should also need to change the New copybook.
i have done the changes and got the output. Thanks for all your help |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
As a bit of a followup question. . .
Are there also 2 physical files? One in the old format and one in the new?
If not, how will a program that compiled with the "old" copybook be able to read a file created with the "new copybook?
If you have what you need, this is good, but i see the potential for problems if the "same" data is created/read by different length copybooks in the different programs. I also do not see how the jcl for the jobs using this file will flip/flop between the file descriptions.
It may also be that i do not completely understand the situation |
|
Back to top |
|
|
|