Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Raghu navaikulam

Active User

Joined: 27 Sep 2008
Posts: 193
Location: chennai

 Posted: Tue Jan 14, 2014 9:36 am    Post subject: Data representation with negative values Hi all Could anyone please help me in understanding how -32 is represented with 03K. Regards Raghu

Pandora-Box

Moderator

Joined: 07 Sep 2006
Posts: 1567
Location: Andromeda Galaxy

 Posted: Tue Jan 14, 2014 10:34 am    Post subject: Pleaae explain I coudnt understand
steve-myers

Active Member

Joined: 30 Nov 2013
Posts: 707
Location: The Universe

 Posted: Tue Jan 14, 2014 10:40 am    Post subject: I presume the text you are showing is text defined as "zoned decimal." The hexadecimal form of your field is F0F3D2. Now be patient with me, because we are going back to ancient history. Back in the days of punched card based data processing we had machines called card sorters. You have probably seen them in old movies. The operator puts a bunch of (presumably) punched cards into the machine and presses the start button. The machine sucks up the cards and distributes them to various pockets. The actor pulls out one of the cards, which presumably has the information he needs and the action continues. Now what happened. A traditional punched card has 80 "columns" of data, in 12 "rows." By convention, from the top of the card, the first two rows were not punched for numeric data, and were punched for letters and punctuation. The top row was called a 12 punch, and the next row an 11 punch. The remaining rows were punched for numbers, 0 through 9. Another convention: for numeric, signed data, the top row for the last column of a number was punched to indicate a positive number, and the second row was punched to indicate a negative number. Again, by convention, a column with 12-1 punched is the letter A, 11-1 is the letter J, 11-2 is K, and so on. Each run through of a card sorter sorted one column. It could be set to distinguish the 12/11 punches, or the numeric fields. Now when a punched card reader read cards, it would translate a 0 punch to F0, a 1 punch to F1, a 12-1 punch to C1, an 11-1 punch to D1, and so on. Now, get out your Principles of Operation and turn to where it describes signs for packed decimal and zoned decimal data. In zoned decimal data the sign is the first 4 bits of the last byte of data: Cx or Fx is positive, Dx is negative. Similarly, with packed decimal data xF or xC is positive, xD is negative in the last byte of packed decimal data. Now, I hope you see where this convention comes from.
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

 Posted: Tue Jan 14, 2014 1:14 pm    Post subject: Reply to: Data representation with negative values To complement what Steve has said, you have a PIC S999 (or S9*3), same thing). If you DISPLAY that, or otherwise include it in any output, it will appear as 3K when it contains the value -32. When you look at a value like that, you need to "decode" it yourself to know that it contains (in this case) -32. If you look in this forum you will see a "Sticky" which maps the values. You can experiment with COMP-3/PACKED-DECIMAL and COMP/COMP-4/COMP-5/BINARY as well. With positive numbers you just get a di fferent set of "letters". Note the representation of +/- zero. With unsigned numeric PICtures, you just have the numbers, as there is no other information to show you.
Raghu navaikulam

Active User

Joined: 27 Sep 2008
Posts: 193
Location: chennai

 Posted: Tue Jan 14, 2014 10:19 pm    Post subject: Reply to: Data representation with negative values Hi Thanks to all for your response. What I am looking for is the table, which I got from Bill's "Sticky". Thanks Bill. Thanks to everybody. Regards Raghu
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics MQ-DATA-LENGTH is ZERO on MQGET Daniel Prosser Java & MQSeries 5 Tue Dec 18, 2018 5:41 pm To get the count of PDS data sets whi... Vignesh Sid JCL & VSAM 4 Fri Nov 30, 2018 8:38 pm DB2 - loading data Joshua1066 DB2 5 Sun Nov 18, 2018 4:58 am DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 3 Tue Nov 13, 2018 7:55 pm REFORMATTING WITH JFY CLOBBERING OUTP... speermb DFSORT/ICETOOL 12 Thu Nov 08, 2018 7:20 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us