View previous topic :: View next topic
|
Author |
Message |
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Hello, how are you.?
Suppose I have this copy.
Code: |
01 BIG-FILE.
05 TEX-1 PIC X(02).
05 TEX-2 PIC X(10).
05 FILLER PIC X(08).
05 TEX-3 PIC X(02).
05 TEX-4 PIC X(10).
05 FILLER PIC X(08).
|
Why is it consider wrong if I add
05 TEX-2A PIC X(2).
and I take bytes from the first filler and not from the last one? Like this:
Code: |
01 BIG-FILE.
05 TEX-1 PIC X(02).
05 TEX-2 PIC X(10).
05 TEX-2A PIC X(2).
05 FILLER PIC X(06).
05 TEX-3 PIC X(02).
05 TEX-4 PIC X(10).
05 FILLER PIC X(08).
|
THANKS |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Quote: |
Why is it consider wrong |
Who said it was?
As long as you populate the new field correctly and all programs know that, what's the problem? |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Phrzby Phil wrote: |
Quote: |
Why is it consider wrong |
Who said it was?
As long as you populate the new field correctly and all programs know that, what's the problem? |
But if you take bytes from the middle filler and not from the last one, can doing this modify the layout or anything happens? in my work always say that you have to take the bytes from the filler in the last field of the copybook, so I thought that taking bytes from the filler in the middle of the copybook could entail modify the logic of the copy.
But I see from your words that is indifferent and provoke the same result taking the bytes from any of the fillers |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The issues would come in if the new field has a different number of bytes than what is removed from the filler. In such a case, there would be a shift in the data after the FILLER and that means either a conversion program has to be written or the program(s) must be updated to allow for the shifted bytes. As long as the new field byte count is the same as what was removed from the FILLER, you won't see any problems. |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Robert Sample wrote: |
The issues would come in if the new field has a different number of bytes than what is removed from the filler. In such a case, there would be a shift in the data after the FILLER and that means either a conversion program has to be written or the program(s) must be updated to allow for the shifted bytes. As long as the new field byte count is the same as what was removed from the FILLER, you won't see any problems. |
but when I add the new field all the fields after it will be in another position, so if I have a jcl with a sort this new position will break the logic?
this is right? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10879 Location: italy
|
|
|
|
Quote: |
but when I add the new field all the fields after it will be in another position, so if I have a jcl with a sort this new position will break the logic? |
NO!
now You have
Code: |
.... HEAD
... filler x(8)
... TAIL |
after you have
Code: |
... HEAD
... some field x(2)
... filler x(6)
... TAIL
|
the important factor is that the sum of the lengths of the substituted fields/fillers
is the same as the length of the original filler |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
enrico-sorichetti wrote: |
Quote: |
but when I add the new field all the fields after it will be in another position, so if I have a jcl with a sort this new position will break the logic? |
NO!
now You have
Code: |
.... HEAD
... filler x(8)
... TAIL |
after you have
Code: |
... HEAD
... some field x(2)
... filler x(6)
... TAIL
|
the important factor is that the sum of the lengths of the substituted fields/fillers
is the same as the length of the original filler |
Excuse me, in my mind I was refering to this example:
if I take the bytes from the SECOND FILLER then I see that its going to produce a movement of the fields right to tex-2a. Is this right?
Code: |
01 BIG-FILE.
05 TEX-1 PIC X(02).
05 TEX-2 PIC X(10).
05 FILLER PIC X(10).
05 TEX-3 PIC X(02).
05 FILLER PIC X(10).
05 TEX-4 PIC X(10).
05 FILLER PIC X(10).
|
Code: |
01 BIG-FILE.
05 TEX-1 PIC X(02).
05 TEX-2 PIC X(10).
05 TEX-2A PIC X(2).
05 FILLER PIC X(10).
05 TEX-3 PIC X(02).
05 FILLER PIC X(8).
05 TEX-4 PIC X(10).
05 FILLER PIC X(10). |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Yes, the fields would move in that case. If you insert a field and you don't take those bytes from the FILLER immediately next to the field, then you will be shifting bytes and that causes issues. But that is not what you asked in your original post. |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Robert Sample wrote: |
Yes, the fields would move in that case. If you insert a field and you don't take those bytes from the FILLER immediately next to the field, then you will be shifting bytes and that causes issues. But that is not what you asked in your original post. |
Thank you, you are right about this.
Can I ask you if you know some pdf that let me study this matter about how to act when changing a copy? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2115 Location: USA
|
|
|
|
Ali_gezer wrote: |
Robert Sample wrote: |
Yes, the fields would move in that case. If you insert a field and you don't take those bytes from the FILLER immediately next to the field, then you will be shifting bytes and that causes issues. But that is not what you asked in your original post. |
Thank you, you are right about this.
Can I ask you if you know some pdf that let me study this matter about how to act when changing a copy? |
Record Layout in COBOL
Any Google search would return hundreds, or thousands of acceptable references. |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
sergeyken wrote: |
Ali_gezer wrote: |
Robert Sample wrote: |
Yes, the fields would move in that case. If you insert a field and you don't take those bytes from the FILLER immediately next to the field, then you will be shifting bytes and that causes issues. But that is not what you asked in your original post. |
Thank you, you are right about this.
Can I ask you if you know some pdf that let me study this matter about how to act when changing a copy? |
Record Layout in COBOL
Any Google search would return hundreds, or thousands of acceptable references. |
for example that url that you pass doesnt tell nothing about copy modification. I only ask questions on the forum when I do not find information. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2115 Location: USA
|
|
|
|
Ali_gezer wrote: |
sergeyken wrote: |
Ali_gezer wrote: |
Robert Sample wrote: |
Yes, the fields would move in that case. If you insert a field and you don't take those bytes from the FILLER immediately next to the field, then you will be shifting bytes and that causes issues. But that is not what you asked in your original post. |
Thank you, you are right about this.
Can I ask you if you know some pdf that let me study this matter about how to act when changing a copy? |
Record Layout in COBOL
Any Google search would return hundreds, or thousands of acceptable references. |
for example that url that you pass doesnt tell nothing about copy modification. I only ask questions on the forum when I do not find information. |
In order to understand "copy modification" you must first of all understand the record layout ideology.
The rest of understanding is only common sense.
There is no specific manual on "copy modification" available in this world. |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
sergeyken wrote: |
Ali_gezer wrote: |
sergeyken wrote: |
Ali_gezer wrote: |
Robert Sample wrote: |
Yes, the fields would move in that case. If you insert a field and you don't take those bytes from the FILLER immediately next to the field, then you will be shifting bytes and that causes issues. But that is not what you asked in your original post. |
Thank you, you are right about this.
Can I ask you if you know some pdf that let me study this matter about how to act when changing a copy? |
Record Layout in COBOL
Any Google search would return hundreds, or thousands of acceptable references. |
for example that url that you pass doesnt tell nothing about copy modification. I only ask questions on the forum when I do not find information. |
In order to understand "copy modification" you must first of all understand the record layout ideology.
The rest of understanding is only common sense.
There is no specific manual on "copy modification" available in this world. |
Yes, I think you are right.
But maybe I was refering to some kind of pdf or article on copy modification behaviour, I read several of this kind of articles in other suspects, but yes I agree with you if I fully learn record layout ideology maybe I can arrive to the answer. I have the murachs cobol book but is sad to admit that only with that information I can handle to know the answer by myself. |
|
Back to top |
|
|
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Robert Sample wrote: |
Yes, the fields would move in that case. If you insert a field and you don't take those bytes from the FILLER immediately next to the field, then you will be shifting bytes and that causes issues. But that is not what you asked in your original post. |
Thanks.
In that case to avoid issues is it correct to see if there are pgm sort using that old position and cobol programs and correct them?
is there any other thing to have in mind?
thanks again.
greetings. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1198 Location: Dublin, Ireland
|
|
|
|
I would think it's just simple mathematics to add the number of bytes for each field to find the displacement of fields to see if any field in the original structure moves offset. This applies to any structure whether in a copy book or otherwise.,
Garry. |
|
Back to top |
|
|
|