IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

[Solved]Change ZE field in copybook and compile related programs


IBM Mainframe Forums -> FAQ & Basics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ali_gezer

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Sat Nov 13, 2021 6:58 am
Reply with quote

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

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Sat Nov 13, 2021 7:23 pm
Reply with quote

You need to adjust the filler where this field fall off.

Moved to student section .
Back to top
View user's profile Send private message
Ali_gezer

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Tue Nov 16, 2021 6:06 am
Reply with quote

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

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Tue Nov 16, 2021 7:56 pm
Reply with quote

Please, read carefully about COBOL structures.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Tue Nov 16, 2021 9:29 pm
Reply with quote

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

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Wed Nov 17, 2021 1:13 am
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed Nov 17, 2021 2:55 am
Reply with quote

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

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Wed Nov 17, 2021 3:05 am
Reply with quote

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

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Wed Nov 17, 2021 3:07 am
Reply with quote

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

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Wed Nov 17, 2021 6:15 pm
Reply with quote

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

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Wed Nov 17, 2021 8:25 pm
Reply with quote

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

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Wed Nov 17, 2021 9:48 pm
Reply with quote

Never mind , I cleaned up the post.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> FAQ & Basics

 


Similar Topics
Topic Forum Replies
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts Sorting Date Field DFSORT/ICETOOL 4
No new posts Compile Sp Cobol base COBOL Programming 1
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
Search our Forums:

Back to Top