View previous topic :: View next topic
|
Author |
Message |
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Hello, how are you?
I have to change one field of a copybook. Right now it is PICTURE -9(5)V99 but I have to change it to PICTURE -9(7).V99.
Can I use some filler and reduce it 2 bytes and add this 2 bytes to the field I have to change ( add 2 to -9(5)V99 )
Can I use any filler of the copybook? Is this just a good way to do it?
Greetings. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
You need to adjust the filler where this field fall off.
Moved to student section . |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Rohit Umarjikar wrote: |
You need to adjust the filler where this field fall off.
Moved to student section . |
Hello.
Thanks.
Can I ask you something, I can reduce any filler of the copy?
When I reduce FILLER fields that are the same level of the field I have to change nothing happens and I have a error in file manager ( =LGTH), but when I reduce the filler field of a lower levelfiller field then I see the change I want and the field manager is ok. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
Please, read carefully about COBOL structures. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
You can also share snippet of your code structure outlining the change and showing what works and what don't to be able to get helped further. |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Rohit Umarjikar wrote: |
You can also share snippet of your code structure outlining the change and showing what works and what don't to be able to get helped further. |
My doubt is where I should substract bytes, in which filler.
For example
Code: |
01
05 FIELD-1 PIC-9(5).99
05 FILLER PIC X(10)
05 FIELD-2 PIC X(10)
05 FIELD-3 REDEFINES FIELD-2
07 SUB-FIELD PIC X(5)
07 FILLER PIC X(5)
|
My doubt is that when I substract 2 bytes from 05 FILLER PICX(10) and I use this bytes an add to 05 FIELD-1 PIC-9(5).99 then when I see the filemanager I see an =LGTH error. But when I substract 2 bytes from 07-FILLER PIC X(5) and add them to 05 FIELD-1 PIC-9(5).99 obtaining pic-9(7).99 then when I see the file manager I see everything OK and no errors.
My doubt is if always when I have to use a filler to add bytes to other fields if always the filler has to be of a lower level (in my example I have to substract bytes from a filler level 7 ,the level 5 filler if I take bytes from it and then I add this bytes to other field this has no effect)
thanks! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
when you change the layout of a record
before using a program/utility referencing the NEW layout you should convert the datasets involved from the old layout to the new one |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
enrico-sorichetti wrote: |
when you change the layout of a record
before using a program/utility referencing the NEW layout you should convert the datasets involved from the old layout to the new one |
Yes. Thats a thing that I checked. Thanks. |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
enrico-sorichetti wrote: |
when you change the layout of a record
before using a program/utility referencing the NEW layout you should convert the datasets involved from the old layout to the new one |
can you give me your thoughts about the question that I made to Rohit Umarjikar?
thanks |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Ideally you are missing the FILLER at the end of all variables defined at 05 level as that will give you room to adjust the total layout.
E.g.
Code: |
01
05 FIELD-1 PIC-9(5).99
05 FILLER PIC X(10)
05 FIELD-2 PIC X(10)
05 FIELD-3 REDEFINES FIELD-2
07 SUB-FIELD PIC X(5)
07 FILLER PIC X(5)
05 FILLER PIC X(100) |
This should be changed to
Code: |
01
05 FIELD-1 PIC-9(7).99
05 FILLER PIC X(10)
05 FIELD-2 PIC X(10)
05 FIELD-3 REDEFINES FIELD-2
07 SUB-FIELD PIC X(5)
07 FILLER PIC X(5)
05 FILLER PIC X(98) |
This way your entire record layout doesn’t change. If you change the in between FILLERS then that might break the process consuming this data. |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Rohit Umarjikar wrote: |
Ideally you are missing the FILLER at the end of all variables defined at 05 level as that will give you room to adjust the total layout.
E.g.
Code: |
01
05 FIELD-1 PIC-9(5).99
05 FILLER PIC X(10)
05 FIELD-2 PIC X(10)
05 FIELD-3 REDEFINES FIELD-2
07 SUB-FIELD PIC X(5)
07 FILLER PIC X(5)
05 FILLER PIC X(100) |
This should be changed to
Code: |
01
05 FIELD-1 PIC-9(7).99
05 FILLER PIC X(10)
05 FIELD-2 PIC X(10)
05 FIELD-3 REDEFINES FIELD-2
07 SUB-FIELD PIC X(5)
07 FILLER PIC X(5)
05 FILLER PIC X(98) |
This way your entire record layout doesn’t change. If you change the in between FILLERS then that might break the process consuming this data. |
Pardon me, it dont letme edit the last messagge, I tried as you said, putting the filler in the last position and it works. is vital to put the filler in that last position, I dont know why it is but it worked as you said before
thanks!! |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Never mind , I cleaned up the post. |
|
Back to top |
|
|
|