The "perform until exit" is not part of any COBOL standard, although that seems 
to me to be an "oversight" (though likely intentional).  EXIT PERFORM itself 
was actually already implemented earlier this year (yay!) as part of Enterprise 
COBOL V5R2.  My RFE is for a small enhancement to make using it even more 
friendly.

User define constants are much more than what is currently available.  Here's a 
simple example:

01  my-field    PIC X(80).
01  myfieldlen IS CONSTANT AS LENGTH OF my-field.
01  prev-my-field PIC X(myfieldlen).

my-field and prev-my-field need to always be the same size.  By changing the 
PIC length for my-field you will now implicitly change the PIC length for 
pre-my-field.  There are several other useful uses. 

I agree that all of the "binary" usages need to be added.  Since we already 
have COMP-5 I'm not sure how much traction it would get (though we are 
currently lacking altogether a BINARY-CHAR equivalent), so I didn't make it a 
priority at the moment.  The COBOL 2002 standard has additional usage types: 
float-short (*),  float-long (*),  float-extended, (* These two are, I believe, 
the same as COMP-1 and COMP-2) and COBOL 2014 added float-binary-32,  
float-binary-64,  float-binary-128, float-decimal-16, or float-decimal-34.  I 
don't have any personal "use cases" for those, but I would vote for them if 
others have a good use case.  

It's not clear to me if COBOL 2002 defines rounding rules beyond COBOL 1985, 
but COBOl 2014 definitely does.  In the OPTIONS paragraph you can specify a 
"DEFAULT ROUNDED MODE" clause with any of the following:
- AWAY-FROM-ZERO
- NEAREST-AWAY-FROM-ZERO
- NEAREST-EVEN
- NEAREST-TOWARD-ZERO
- PROHIBITED
- TOWARD-GREATER
- TOWARD-LESSER
- TRUNCATION 
NEAREST-AWAY-FROM-ZERO is the default if this clause is not specified and "is 
the rounding mode provided by the ROUNDED phrase in previous COBOL
standards"

There is also an "INTERMEDIATE ROUNDING" clause with the following options:
- NEAREST-AWAY-FROM-ZERO
- NEAREST-EVEN
- PROHIBITED
- TRUNCATION
NEAREST-EVEN is the default if this cause is not specified.

You can also override the "DEFAULT ROUNDED MODE" at the statement level:

COMPUTE X ROUNDED MODE IS AWAY-FROM-ZERO = (A * B + C - D) / E.

I dare say it appears you could even do something like this:
COMPUTE X ROUNDED MODE IS AWAY-FROM-ZERO
        Y ROUNDED MODE IS NEAREST-TOWARD-ZERO
        = (A * B + C - D) / E.

I personally have never had a need to alternative rounding rules, but I'm sure 
others have.

The TRIM function and dynamic-capacity tables are, believe it or not, part of 
the COBOL 2014 standard but not the COBOL 2002 standard.  When creating the 
2002 standard it seems like the working group spent too much time on OO COBOL 
and not enough on enhancements to basic COBOL!  :-(

Frank

> Date: Tue, 7 Jul 2015 21:00:00 -0300
> From: [email protected]
> Subject: Re: IBM Enterprise COBOL, Requests for Enhancements
> To: [email protected]
> 
> On Tue, 7 Jul 2015 10:55:43 -0700 (PDT), Frank Swarbrick
> <[email protected]> wrote:
> 
> >I made the following RFEs and would love some votes on them.
> >
> >Perform until exit (73686): 
> >https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=73686
> >User defined constants (73687): 
> >https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=73687
> >Boolean support and bit manipulation (73688): 
> >https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=73688
> >TRIM Intrinsic function (73689): 
> >https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=73689
> >Implement dynamic-capacity tables (73693): 
> >https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=73693
> 
> Note for those reading this on comp.lang.cobol, these are for the IBM
> z series environment which has gotten a totally new compiler in the
> past couple of years.  The back end of the compiler (machine code
> generation) will be shared with compilers for other languages.
> 
> These require an IBM id to view.  I'm assuming that all are taken from
> the 2002 standard (or more recent if any).  I'm assuming the first is
> the EXIT PERFORM and related constructs.  I don't recall the second
> and wonder if it is needed since modern IBM compilers treat a field
> that is never updated as a constant and if 1 byte have used Compare
> Logical Immediate and Move Immediate instructions with the values
> (this dates back to COBOL VS 1.4, the first IBM implementation of the
> 1985 standard).  Boolean and Bit are definitely in the 2002 standard
> and were at least 3 decades overdue then.  I think dynamic capacity
> tables are in the 2002 standard.  I would add a request for the
> decimal floating point data type and the additional rounding options,
> both of which are either in the 2002 standard or draft (final?)
> follow-ons.  PL/1 has the data type as does IBM C/C++ and DB2.  All of
> the BINARY usages (CHARACTER, SHORT, LONG, etc.) also should be added.
> There are SHARE requirements submitted by me for many of these things
> in the 2001 - 2002 time frame if I recall correctly (SHARE
> installation CFM).
> 
> Clark Morris
> >
> >Frank Swarbrick
> >FirstBank - Lakewood, CO USA
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
                                          
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to