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

F or C for positive sign in ZD.


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
DB2 Guy

New User


Joined: 28 Oct 2008
Posts: 98
Location: Cubicle

PostPosted: Tue May 24, 2011 8:46 pm
Reply with quote

Hi,

Was browsing through the Forum and looked at this thread, ibmmainframes.com/viewtopic.php?t=54604, from the thread:
Quote:
DFSORT uses an F for a positive sign if ZDPRINT=YES is in effect or a C for a positive sign if ZDPRINT=NO is in effect.

There had been couple of more instancnes where the sign-bit has been talked about:

1. I believe it's nothing to do with DFSort in partiular but I'm not very sure.
2. Why do we have two different characters represting the positive values?


PS. Question is not properly framed, however, I hope I could convey what is confusing me.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 24, 2011 8:58 pm
Reply with quote

Hello,

Quote:
Why do we have two different characters represting the positive values?
Because 50 years ago the IBM "builders" decided that there would be 3 signs - 2 positive (C and F) and one negative (D). This was a carry-over from the way signs were implemented on "punched cards" (which was handled by an "overpunch").

DFSORT allows either of the positive signs to be specified as the default.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue May 24, 2011 9:02 pm
Reply with quote

Quote:
2. Why do we have two different characters represting the positive values?


I might be wrong, just answering from early computer reminiscences

why the C/D zone value were chosen for positive and negative during and after computations should be researched in the logic diagrams of early computers/and tabulating machines

why the F is accepted as a positive sign most probably because once upon a time C and D had to be overpunched on early punching machines
( early punching machined had only the numeric keyboard )

well, the IBM type 1 keypunch I saw once had only the numeric part
later machines from the 024/026/029 had the almost full keyboard
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue May 24, 2011 9:09 pm
Reply with quote

Strictly speaking, a X'F' (all 1's) in the sign nybble is not a positive sign; it is the lack of a sign. In pretty much every case that I can think of, it is treated as equivalent to a positive sign, but you can detect the different bit pattern and, of course, a bitwise comparison will correctly detect X'123C' as different from X'123F'.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed May 25, 2011 1:57 am
Reply with quote

Further, there are actually more sign possibilities.

A, B, C, D, E and F are all valid signs.

IBM splits these into two groups, "preferred signs", which are C, D, and F and "non-preferred signs" which are A, B and E.

You end up with three for positive, two for negative, and one for unsigned (which is always treated as positive when a value of that sign is used).

At the level of the OP-codes, all arithmetic operations accept any of the signs, but will only generate results with a sign of C, positive, or D negative. You (or a compiler) have to do the F bit yourself (an Immediate Or with a mask of X'0F' or X'F0' depending on whether packed or zoned is required respectively).

Thus, the non-preferred signs are accepted, but their existence can be somewhat ephemeral.

If you ever see a non-preferred sign, start worrying and check it out, as it might be messing things up (you are unlikely to see one).

Don't ever let and F get into the sign of a field which should actually be signed (should contain a C or a D) as this can also cause problems.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Cobol 4 - The trouble with computing ... COBOL Programming 1
This topic is locked: you cannot edit posts or make replies. Missing Negative sign in COBOL COBOL Programming 6
No new posts SUSBSCRIPT WITH SIGN IN PIC CLAUSE COBOL Programming 3
No new posts Typing the CENT sign ยข on mainframe,... All Other Mainframe Topics 2
No new posts Identify who, from where, sign on CIC... CICS 1
Search our Forums:

Back to Top