Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Requirement to add a new field to the copybook

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mallem_ravi
Warnings : 1

New User


Joined: 29 Mar 2007
Posts: 10
Location: India

PostPosted: Mon Jun 04, 2007 7:35 pm    Post subject: Requirement to add a new field to the copybook
Reply with quote

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
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 7:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 04, 2007 8:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Tue Jun 05, 2007 12:03 am    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 05, 2007 1:23 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jun 05, 2007 2:20 am    Post subject:
Reply with quote

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
View user's profile Send private message
mallem_ravi
Warnings : 1

New User


Joined: 29 Mar 2007
Posts: 10
Location: India

PostPosted: Tue Jun 05, 2007 5:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Tue Jun 05, 2007 6:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jun 05, 2007 7:09 pm    Post subject:
Reply with quote

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. . . icon_confused.gif
Back to top
View user's profile Send private message
mallem_ravi
Warnings : 1

New User


Joined: 29 Mar 2007
Posts: 10
Location: India

PostPosted: Tue Jun 05, 2007 8:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jun 05, 2007 9:36 pm    Post subject:
Reply with quote

You're welcome icon_smile.gif

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 icon_smile.gif
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us