View previous topic :: View next topic
|
Author |
Message |
ksannigeri
New User
Joined: 08 Apr 2005 Posts: 18
|
|
|
|
Hello,
I have a requirement to unpack some of the fileds from my existing copybook.This is a Output file copybook.
The existing copybook has
ABC---s9(5)v99 Comp-3
XYZ--- 9(3) comp-3
I need to change the Copybook to unpack these fields.
Could you pls let me know if I can Just change the fields to
ABC---s9(5)v99
XYZ--- 9(3)
By removing the comp-3
Thanks |
|
Back to top |
|
|
ksannigeri
New User
Joined: 08 Apr 2005 Posts: 18
|
|
|
|
I have already tried it..its coming fine..but not sure..whether this is the right thing to unpack the fields..as the Copybook record length will Change after unpacking the fields. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Phew check with the person who had assigned you this or try answering these questions work why you are doing this xhange ? what is actually required and what is the output required and what needs to be done with increased lrecl will prorams using these files wont be impacted and so as copybooks
If you could answer these yourself you could get more clarity
Ppl here never know what is needed unless you explain for better guidance\suggestions |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
How else do you propose to convert from packed dec to zoned dec? What do you mean by "output" copybook. One assumes that it will be an "input" copybook in another process. Is that other process expecting zoned decimal numbers or is it a new downstream process using a similar layout but zoned dec? If the latter, and existing programs using the copybook are not changing, then you need a new copybook. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Be aware that if you change the copybook, all of the existing files will have to be converted. The original data will no longer be easily usable. . .
Also, any jcl that references this file format (i.e. lrecl/blksize) will have to be changed. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Your question is hard to comprehend.
If this is the current definition
Code: |
01 ABC PIC S9(5)V99 COMP-3.
01 XYZ PIC 9(3) COMP-3 . |
and you want to change it to zone-decimals instead of packed, without changing the length of the copybook, this is what you should look forward to:
Code: |
01 ABC PIC S9(2)V99.
01 XYZ PIC 9(2). |
but only if I understood clearly what you mean! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Even if the definitions are changed to preserve the record length, all of the existing files will still have to be converted. The content would not match the revised copybook. |
|
Back to top |
|
|
ksannigeri
New User
Joined: 08 Apr 2005 Posts: 18
|
|
|
|
Hello,
thanks all for your suggestion and valuable guidance.
the output file which is being created was using this Copybook and since we needed to unpack the fields in the output file.So I have unpacked the Fields from the Copybook.
ABC & XYZ are the output file fields.
In the program to create the o/p file, they were moving some
move 111 to ABC
Move 222 to XYZ.
111 & 222 were unpacked alphanumeric fields.So I have unpacked ABC & XYZ to include the PIC clause of the 111 & 222.
After unpack, the record length of the copybook, so as the output file increases.
I have changed(Increased) the LRECL of the output file to accommodate the unpacked fields.Similarly the File Record length has been changed in the program.
Now I am able to see the output in a readable format.
Thanks |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quote: |
Now I am able to see the output in a readable format. |
Sorry if that sounds rude - but, is this all you wanted? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Now I am able to see the output in a readable format. |
If the data is packed, you can still "see" it - all you need o do is use HEX ON.
If there was no other reason to unpack tha data, you have just wasted space and damaged performance . . . |
|
Back to top |
|
|
|