Specifying 9(4) or S9(4) can have a maximum value of 9,999 (i.e. 4 decimal digits), depending on the chosen TRUNC compiler option.
TRUNC(BIN) means to truncate at the halfword or fullword. But we use TRUNC(OPT), which means "do whatever is the most efficient", which can truncate at 9999. So that's a good point: with TRUNC other than TRUNC(BIN), 9(4) or S9(4) has the same maximum value. -----Original Message----- From: IBM Mainframe Assembler List <[email protected]> On Behalf Of Dave Clark Sent: Thursday, June 16, 2022 9:54 AM To: [email protected] Subject: Re: When did logical instructions appear? "IBM Mainframe Assembler List" <[email protected]> wrote on 06/16/2022 10:36:12 AM: > Or it could be that whatever version of COBOL was used then (OS/VS > COBOL or earlier) was more efficient with signed binary, such as due > to the choices it made in instruction selection. My understanding, at least for VSE, is that COBOL does not really support unsigned numbers. Instead, if the S designation is not coded then COBOL simply forces a positive number. Thus, in the case of binary, specifying 9(4) or S9(4) still has a max possible value of 32,767 either way. Therefore, the only benefit of using an unsigned PIC is to prevent negative numbers. Otherwise, yes, you do save a little on performance by using the S designation so that COBOL doesn't have to go to the extra effort of forcing a positive sign. Sincerely, Dave Clark -- int.ext: 91078 direct: (937) 531-6378 home: (937) 751-3300 Winsupply Group Services 3110 Kettering Boulevard Dayton, Ohio 45439 USA (937) 294-5331 ********************************************************************************************* This email message and any attachments is for use only by the named addressee(s) and may contain confidential, privileged and/or proprietary information. If you have received this message in error, please immediately notify the sender and delete and destroy the message and all copies. All unauthorized direct or indirect use or disclosure of this message is strictly prohibited. No right to confidentiality or privilege is waived or lost by any error in transmission. *********************************************************************************************
