Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Tue Jun 06, 2006 8:43 am Post subject:
Deepika,
You need to provide us with details. Show us a sample input and desired output. Also explain what exactly you mean by convert as zoned decimals have a sign ovepunched on the last byte.
For eg: Amount field is 15.35 then internally in mainframe it is stored as
Positive Value is stored as : FFFFFFFFFFF
00000001535
Negative value is stored as : FFFFFFFFFFD
00000001535
We need the Sort utility function to convert the X'F' to X'D' ( Last half byte), hence the Zoned decimal amount field will be converted to Negative amount.
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Tue Jun 06, 2006 9:10 am Post subject:
Deepika,
Is your input field a packed decimal ? You say zoned decimal but your data shows a packed decimal data(comp-3) . only packed decimal fields have the sign in the last nibble X'F' & X'C' represent Positive values and X'D' represents negative value.
Just tell me the cobol declaration of the input field and desired output field.
Thanks for the quick response,Kolusu.
The COBOL Declaration for Input field is S9(18)V9(2) Comp-3.
The output should be in the same format but multipied with -1.
Please let me know if there is any sort option for the same.
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Tue Jun 06, 2006 10:14 am Post subject:
Deepika,
Assuming that you only wanted to convert positive values to negative values , the following jcl will give you the desired results. I assumed that your input field to be changed starts from position 1. S9(18)V9(2) Comp-3 occupies 11 bytes.
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Tue Jun 06, 2006 12:57 pm Post subject:
Quote:
I don't understand how that can be interpreted as PD.
Of course, if it is PD, it really doesn't look like that.
Frank,
The last post from deepika is this
deepika wrote:
Thanks for the quick response,Kolusu.
The COBOL Declaration for Input field is S9(18)V9(2) Comp-3.
The output should be in the same format but multipied with -1.
Please let me know if there is any sort option for the same.
I agree that the first initial posts are confusing , but I guess some people have hardtime understanding the basic differences zoned/binary/packed formats.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Jun 06, 2006 2:03 pm Post subject:
Quote:
The COBOL Declaration for Input field is S9(18)V9(2) Comp-3.
Yes, I know deepika said that. My point was that the declare doesn't match the data he showed on both boards. So either he pulled the data he showed out of a hat, or he pulled the COBOL declare he showed out of a hat. Hard to tell which it is. At any rate, I think we've covered all the cases. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum