Home > Archive > Cobol > January 2008 > COBOL 61 Data Definitions [was Re: checking if NUMERIC]
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
COBOL 61 Data Definitions [was Re: checking if NUMERIC]
|
|
| Arnold Trembley 2008-01-28, 3:55 am |
| Pete Dashwood wrote:
> (snip)
> I started with COBOL 61 as well :-) You forgot to mention that, prior to the
> introduction of PICTURE, data was defined with SIZE, CLASS, and *USAGE*
> clauses.
>
I'm just a newbie with COBOL. I've only been programming in it since
1978. But I'm very curious as to what data definitions would have
looked like in COBOL 61 without PICTURE clauses. Could anyone provide
me with some examples of how various kinds of data items would have
been defined with SIZE, CLASS, and USAGE clauses?
I realize it's unlikely anyone will go back to the old way, but it
just seems interesting to see where we've come from.
With kindest regards,
--
http://arnold.trembley.home.att.net/
| |
| Pete Dashwood 2008-01-28, 3:55 am |
|
"Arnold Trembley" <arnold.trembley@worldnet.att.net> wrote in message
news:d2fnj.173198$MJ6.117779@bgtnsc05-news.ops.worldnet.att.net...
> Pete Dashwood wrote:
>
> I'm just a newbie with COBOL. I've only been programming in it since 1978.
> But I'm very curious as to what data definitions would have looked like in
> COBOL 61 without PICTURE clauses. Could anyone provide me with some
> examples of how various kinds of data items would have been defined with
> SIZE, CLASS, and USAGE clauses?
Sure, here are some examples, with their "PICTURE" equivalents...
01 field PIC X(12).
01 field CLASS ALPHANUMERIC, SIZE 12, USAGE DISPLAY.
01 number PIC S9(5).
01 number CLASS SIGNED NUMERIC, SIZE 5, USAGE DISPLAY.
01 binaryNumber PIC S9(4) COMP.
01 binaryNumber CLASS SIGNED NUMERIC, SIZE 4, USAGE COMPUTATIONAL.
.... and so on.
You can see why PICTURE caught on pretty quickly... :-)
Pete.
--
"I used to write COBOL...now I can do anything."
| |
| Karl Kiesel 2008-01-28, 6:56 pm |
|
"Pete Dashwood" <dashwood@removethis.enternet.co.nz> schrieb im Newsbeitrag
news:605lv6F1po926U1@mid.individual.net...
>
>
> "Arnold Trembley" <arnold.trembley@worldnet.att.net> wrote in message
> news:d2fnj.173198$MJ6.117779@bgtnsc05-news.ops.worldnet.att.net...
>
> Sure, here are some examples, with their "PICTURE" equivalents...
>
> 01 field PIC X(12).
> 01 field CLASS ALPHANUMERIC, SIZE 12, USAGE DISPLAY.
>
> 01 number PIC S9(5).
> 01 number CLASS SIGNED NUMERIC, SIZE 5, USAGE DISPLAY.
>
> 01 binaryNumber PIC S9(4) COMP.
> 01 binaryNumber CLASS SIGNED NUMERIC, SIZE 4, USAGE COMPUTATIONAL.
>
> ... and so on.
>
> You can see why PICTURE caught on pretty quickly... :-)
The specification of COBOL-61 extended shows also some more, especially for
editing:
{ZERO SUPPRESS/CHECK PROTECT/FLOAT DOLLAR SIGN}[LEAVING interger PLACES]
POINT LOCATION IS {LEFT/RIGHT} integer {PLACES/BITS}
RANGE IS lit-1 THRU lit-2
SIZE IS [integer-1 TO] integer-2 {CHARACTERS/DIGITS} [DEPENDING ON
data-name]
and the only one of these which is still available: BLANK WHEN ZERO!
K. Kiesel
Fujitsu Siemens Computers, München
| |
| Howard Brazee 2008-01-28, 6:56 pm |
| On Mon, 28 Jan 2008 06:58:17 GMT, Arnold Trembley
<arnold.trembley@worldnet.att.net> wrote:
>I'm just a newbie with COBOL. I've only been programming in it since
>1978. But I'm very curious as to what data definitions would have
>looked like in COBOL 61 without PICTURE clauses. Could anyone provide
>me with some examples of how various kinds of data items would have
>been defined with SIZE, CLASS, and USAGE clauses?
I only have a decade more experience - but PIC took over very rapidly,
I have never seen SIZE.
| |
| Howard Brazee 2008-01-28, 6:56 pm |
| On Mon, 28 Jan 2008 08:50:14 -0700, Howard Brazee <howard@brazee.net>
wrote:
>
>I only have a decade more experience - but PIC took over very rapidly,
>I have never seen SIZE.
Actually, that was wrong. We probably have the same amount of
experience as I had a hiatus in the USAF after I started my CoBOL
career.
| |
| Arnold Trembley 2008-01-29, 9:57 pm |
| Pete Dashwood wrote:
> (snip)
> Sure, here are some examples, with their "PICTURE" equivalents...
>
> 01 field PIC X(12).
> 01 field CLASS ALPHANUMERIC, SIZE 12, USAGE DISPLAY.
>
> 01 number PIC S9(5).
> 01 number CLASS SIGNED NUMERIC, SIZE 5, USAGE DISPLAY.
>
> 01 binaryNumber PIC S9(4) COMP.
> 01 binaryNumber CLASS SIGNED NUMERIC, SIZE 4, USAGE COMPUTATIONAL.
>
> ... and so on.
>
> You can see why PICTURE caught on pretty quickly... :-)
>
> Pete.
> --
> "I used to write COBOL...now I can do anything."
Thanks, Pete! And also thanks to Karl and Howard.
--
http://arnold.trembley.home.att.net/
|
|
|
|
|