Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
F or C for positive sign in ZD.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: F or C for positive sign in ZD.
Reply with quote

Hi,

Was browsing through the Forum and looked at this thread, http://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

Site Director


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

PostPosted: Tue May 24, 2011 8:58 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10375
Location: italy

PostPosted: Tue May 24, 2011 9:02 pm    Post subject: Reply to: F or C for positive sign in ZD.
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: 1783
Location: Bloomington, IL

PostPosted: Tue May 24, 2011 9:09 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Wed May 25, 2011 1:57 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am
No new posts IGZ0040S An invalid separate sign was... kishpra COBOL Programming 13 Sun Aug 02, 2015 2:41 am
No new posts How to modify the value using the sig... Vinay Pushpala PL/I & Assembler 3 Fri Feb 13, 2015 2:10 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us