Home > Archive > Cobol > May 2006 > Accept / Display - an "environment variables
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 |
Accept / Display - an "environment variables
|
|
| William M. Klein 2006-05-26, 6:55 pm |
| (Follow-on to other thread),
Currently, ANSI/ISO Standards allow for ACCEPT FROM DAY/DATE/DAY-OF-WEEK/TIME
(and "enhanced screen stuff")
All "other" ACCEPTS need to be to a mnemonic associated with "hardware-ish"
device via the Special-Names paragraph.
The reason that I mention this, is that IBM, Micro Focus, and possibly others
have an extension that allow one to directly reference such "hardware-ish"
device in the Procedure Division - NOT via the mnemonic-name, e.g.
Accept Some-Field from Sysout.
(This is marked as a "compatibility" feature with IBM's '74 Standard compiler -
I don't know if it was an extension or part of that Standard. I know it is NOT
allowed in the '85 Standard.)
I (personally) find it unlikely that J4/WG4 would add syntax/keyword such as
Accept whatever from ENVIRONMENT-NAME
There is certainly no guarantee that they would or would not reject this, but my
best guess is that *IF* the ACCEPT/DISPLAY approach were used, that it WOULD
still be via a "mnemonic-name" associated in the Special-Names paragraph.
--
Bill Klein
wmklein <at> ix.netcom.com
| |
| Chuck Stevens 2006-05-26, 6:55 pm |
|
"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:%KGdg.14295$sY5.9484@fe10.news.easynews.com...
> The reason that I mention this, is that IBM, Micro Focus, and possibly
> others have an extension that allow one to directly reference such
> "hardware-ish" device in the Procedure Division - NOT via the
> mnemonic-name, e.g.
>
> Accept Some-Field from Sysout.
>
> (This is marked as a "compatibility" feature with IBM's '74 Standard
> compiler - I don't know if it was an extension or part of that Standard.
> I know it is NOT allowed in the '85 Standard.)
Anything but a mnemonic-name defined in special-names in a Format 1 ACCEPT
is definitely an extension to the '74 standard, and from what I can see it's
an extension to the '68 standard as well (at least, IBM's reference manual
for DOS COBOL seems to think so).
> I (personally) find it unlikely that J4/WG4 would add syntax/keyword such
> as
>
> Accept whatever from ENVIRONMENT-NAME
>
> There is certainly no guarantee that they would or would not reject this,
> but my best guess is that *IF* the ACCEPT/DISPLAY approach were used, that
> it WOULD still be via a "mnemonic-name" associated in the Special-Names
> paragraph.
That'd be the way I'd suggest going. I'm not convinced anything needs to be
*added* to the language for ACCEPT/DISPLAY; the remaining piece is the
functionality of SET, as I see it, presuming the semantics of DISPLAY don't
work for that case.
-Chuck Stevens
| |
| Chuck Stevens 2006-05-26, 6:55 pm |
| "Chuck Stevens" <charles.stevens@unisys.com> wrote in message news:...[color=darkred]
>
> "William M. Klein" <wmklein@nospam.netcom.com> wrote in message
> news:%KGdg.14295$sY5.9484@fe10.news.easynews.com...
>
I'm no IBM expert, but getting input from what sure looks like something
that belongs in the output-only class seems decidedly counterintuitive to me
....
Kind of reminds me of something like
Select ... assign to paper-tape-punch
organization is indexed record key ...
Ummm... I for one would have some difficulty visualizing that ...
Could you perhaps have meant SysIN? ;=)
Our default, by the way, is the equivalent of the IBM DOS "ACCEPT ... FROM
CONSOLE".
Our COBOL74 allows "ACCEPT ... FROM SPO" (would you believe SPO is a
mnemonic for "Supervisory Print Out" from B5000 days?) and "ACCEPT FROM ODT"
(where ODT is "operator display terminal" when we finally got away from
KSR33's), and it allows mnemonics "equated" to those terms in SPECIAL-NAMES.
Our COBOL85 is stricter; it requires a mnemonic for ODT or date/time
specifier after FROM and doesn't allow SPO as a mnemonic.
Neither one allows the (implicit, in the case of COBOL74, or explicit for
either one) mnemonic to refer to anything but the ODT.
-Chuck Stevens
| |
| William M. Klein 2006-05-26, 6:55 pm |
| I wondered who would notice that. My mistake. "Common" IBM usage is:
Accept whatever from Sysin
or
Display whatever upon Sysout
(There are a long list of "valid" things that can be used for Accept/Display -
e.g. CONSOLE, SYSIPT, etc)
--
Bill Klein
wmklein <at> ix.netcom.com
"Chuck Stevens" <charles.stevens@unisys.com> wrote in message
news:e57k7r$1cb5$1@si05.rsvl.unisys.com...
> "Chuck Stevens" <charles.stevens@unisys.com> wrote in message news:...
>
> I'm no IBM expert, but getting input from what sure looks like something that
> belongs in the output-only class seems decidedly counterintuitive to me ...
>
> Kind of reminds me of something like
> Select ... assign to paper-tape-punch
> organization is indexed record key ...
>
> Ummm... I for one would have some difficulty visualizing that ...
>
> Could you perhaps have meant SysIN? ;=)
>
> Our default, by the way, is the equivalent of the IBM DOS "ACCEPT ... FROM
> CONSOLE".
>
> Our COBOL74 allows "ACCEPT ... FROM SPO" (would you believe SPO is a mnemonic
> for "Supervisory Print Out" from B5000 days?) and "ACCEPT FROM ODT" (where ODT
> is "operator display terminal" when we finally got away from KSR33's), and it
> allows mnemonics "equated" to those terms in SPECIAL-NAMES.
>
> Our COBOL85 is stricter; it requires a mnemonic for ODT or date/time specifier
> after FROM and doesn't allow SPO as a mnemonic.
>
> Neither one allows the (implicit, in the case of COBOL74, or explicit for
> either one) mnemonic to refer to anything but the ODT.
>
> -Chuck Stevens
>
>
| |
| Peter Lacey 2006-05-26, 6:55 pm |
| Chuck Stevens wrote:
>
> "Chuck Stevens" <charles.stevens@unisys.com> wrote in message news:...
>
> I'm no IBM expert, but getting input from what sure looks like something
> that belongs in the output-only class seems decidedly counterintuitive to me
> ...
>
> Kind of reminds me of something like
> Select ... assign to paper-tape-punch
> organization is indexed record key ...
>
> Ummm... I for one would have some difficulty visualizing that ...
>
> Could you perhaps have meant SysIN? ;=)
Try this on for size, then: once upon a time when 32k was a big machine,
we were doing a Honeywell --> Univac conversion when we came upon the
phrase "rewind the printer". Quite simple really; did you ever
encounter it?
PL
| |
| Chuck Stevens 2006-05-26, 6:55 pm |
| No, can't say I have, although I can envision "CLOSE with NO REWIND" on a
printer, for a variety of historical (hysterical?) reasons ...
-Chuck Stevens
"Peter Lacey" <lacey@mts.net> wrote in message
news:44776731.ACF4997C@mts.net...
> Chuck Stevens wrote:
>
>
> Try this on for size, then: once upon a time when 32k was a big machine,
> we were doing a Honeywell --> Univac conversion when we came upon the
> phrase "rewind the printer". Quite simple really; did you ever
> encounter it?
>
> PL
| |
| Frank Swarbrick 2006-05-26, 6:55 pm |
| COBOL for VSE
accept data-area from console
display data-area upon console
accept data-area from sysipt
accept data-area from sysin
display data-area upon syslst
display data-area upon syslist
display data-area upon sysout
display data-area upon syspch
display data-area upon syspunch
And somewhat related, for WRITE ADVANCING:
special-names.
C01 IS C01
CSP IS CSP
AFP-5A IS AFP-5A.
write fd-rec after advancing C01 *> skip to printer "channel 1"
write fd-rec after advancing CSP *> suppress spacing
and my personal favorite
write fd-rec after advancing AFP-5A >* special controls for Advanced
Function Printing(tm)
I don't really understand the point of special-names here. We do generally
have it more like:
C01 IS CHANNEL-1
CSP IS SUPRESS-SPACE
AFP-5A IS AFP-CONTROL.
write fd-rec after advancing CHANNEL-1
write fd-rec after advancing SUPPRESS-SPACE
and my personal favorite
write fd-rec after advancing AFP-CONTROL
So I suppose the requirement to use special-names does make things a bit
more readible, but I don't really see why one cannot use the names
"directly", without utilizing special-names.
Ah well...
One thing I've never done is
special-names.
console IS cnsl.
display 'something' upon cnsl
It works, but it never occured to me I might want to do that, when
display 'something' upon console
seems (to me) to be quite obvious...
I suppose the special-names paragraph would be useful if I were converting
from COBOL/VSE to some other COBOL. Then I could do something like...
special-names.
sysout is syslst
sysout is syspch
sysin is sysipt.
(Actually, that does not work because I've assigned two mnemonic names to
the same environment name. Huh. Seems like that should work...)
Frank
---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
I wondered who would notice that. My mistake. "Common" IBM usage is:
Accept whatever from Sysin
or
Display whatever upon Sysout
(There are a long list of "valid" things that can be used for Accept/Display
-
e.g. CONSOLE, SYSIPT, etc)
--
Bill Klein
wmklein <at> ix.netcom.com
"Chuck Stevens" <charles.stevens@unisys.com> wrote in message
news:e57k7r$1cb5$1@si05.rsvl.unisys.com...[color=darkred]
> "Chuck Stevens" <charles.stevens@unisys.com> wrote in message news:...
mnemonic-name,[color=darkred]
>
> I'm no IBM expert, but getting input from what sure looks like something
that
> belongs in the output-only class seems decidedly counterintuitive to me
....
>
> Kind of reminds me of something like
> Select ... assign to paper-tape-punch
> organization is indexed record key ...
>
> Ummm... I for one would have some difficulty visualizing that ...
>
> Could you perhaps have meant SysIN? ;=)
>
> Our default, by the way, is the equivalent of the IBM DOS "ACCEPT ... FROM
> CONSOLE".
>
> Our COBOL74 allows "ACCEPT ... FROM SPO" (would you believe SPO is a
mnemonic
> for "Supervisory Print Out" from B5000 days?) and "ACCEPT FROM ODT" (where
ODT
> is "operator display terminal" when we finally got away from KSR33's), and
it
> allows mnemonics "equated" to those terms in SPECIAL-NAMES.
>
> Our COBOL85 is stricter; it requires a mnemonic for ODT or date/time
specifier
> after FROM and doesn't allow SPO as a mnemonic.
>
> Neither one allows the (implicit, in the case of COBOL74, or explicit for
> either one) mnemonic to refer to anything but the ODT.
>
> -Chuck Stevens
>
>
| |
| William M. Klein 2006-05-26, 9:55 pm |
| The "rationale" for requiring the Special-Names and mnemonic is that it means
that "device-names" (e.g. SYSOUT, SYSIPT, CONSOLE, etc) need NOT be restricted
from use as "user-defined words". However, for implementations (such as IBM's)
they prohibit these words from being used as user-defined names.
--
Bill Klein
wmklein <at> ix.netcom.com
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:4dpinuF1arrshU1@individual.net...
> COBOL for VSE
>
> accept data-area from console
> display data-area upon console
> accept data-area from sysipt
> accept data-area from sysin
> display data-area upon syslst
> display data-area upon syslist
> display data-area upon sysout
> display data-area upon syspch
> display data-area upon syspunch
>
>
> And somewhat related, for WRITE ADVANCING:
> special-names.
> C01 IS C01
> CSP IS CSP
> AFP-5A IS AFP-5A.
> write fd-rec after advancing C01 *> skip to printer "channel 1"
> write fd-rec after advancing CSP *> suppress spacing
> and my personal favorite
> write fd-rec after advancing AFP-5A >* special controls for Advanced
> Function Printing(tm)
>
> I don't really understand the point of special-names here. We do generally
> have it more like:
> C01 IS CHANNEL-1
> CSP IS SUPRESS-SPACE
> AFP-5A IS AFP-CONTROL.
> write fd-rec after advancing CHANNEL-1
> write fd-rec after advancing SUPPRESS-SPACE
> and my personal favorite
> write fd-rec after advancing AFP-CONTROL
>
> So I suppose the requirement to use special-names does make things a bit
> more readible, but I don't really see why one cannot use the names
> "directly", without utilizing special-names.
> Ah well...
>
> One thing I've never done is
> special-names.
> console IS cnsl.
>
> display 'something' upon cnsl
>
> It works, but it never occured to me I might want to do that, when
> display 'something' upon console
> seems (to me) to be quite obvious...
>
> I suppose the special-names paragraph would be useful if I were converting
> from COBOL/VSE to some other COBOL. Then I could do something like...
>
> special-names.
> sysout is syslst
> sysout is syspch
> sysin is sysipt.
>
> (Actually, that does not work because I've assigned two mnemonic names to
> the same environment name. Huh. Seems like that should work...)
>
> Frank
>
> ---
> Frank Swarbrick
> Senior Developer/Analyst - Mainframe Applications
> FirstBank Data Corporation - Lakewood, CO USA
>
> I wondered who would notice that. My mistake. "Common" IBM usage is:
>
> Accept whatever from Sysin
> or
> Display whatever upon Sysout
>
> (There are a long list of "valid" things that can be used for Accept/Display
> -
> e.g. CONSOLE, SYSIPT, etc)
>
> --
> Bill Klein
> wmklein <at> ix.netcom.com
> "Chuck Stevens" <charles.stevens@unisys.com> wrote in message
> news:e57k7r$1cb5$1@si05.rsvl.unisys.com...
> mnemonic-name,
> that
> ...
>
> mnemonic
> ODT
> it
> specifier
>
>
>
>
>
| |
| Chuck Stevens 2006-05-31, 6:55 pm |
|
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:4dpinuF1arrshU1@individual.net...
> COBOL for VSE
>
> accept data-area from console
> display data-area upon console
> accept data-area from sysipt
> accept data-area from sysin
> display data-area upon syslst
> display data-area upon syslist
> display data-area upon sysout
> display data-area upon syspch
> display data-area upon syspunch
>
>
> And somewhat related, for WRITE ADVANCING:
> special-names.
> C01 IS C01
> CSP IS CSP
> AFP-5A IS AFP-5A.
> write fd-rec after advancing C01 *> skip to printer "channel 1"
> write fd-rec after advancing CSP *> suppress spacing
> and my personal favorite
> write fd-rec after advancing AFP-5A >* special controls for Advanced
> Function Printing(tm)
>
> I don't really understand the point of special-names here. We do
> generally
> have it more like:
> C01 IS CHANNEL-1
> CSP IS SUPRESS-SPACE
> AFP-5A IS AFP-CONTROL.
> write fd-rec after advancing CHANNEL-1
> write fd-rec after advancing SUPPRESS-SPACE
> and my personal favorite
> write fd-rec after advancing AFP-CONTROL
>
> So I suppose the requirement to use special-names does make things a bit
> more readible, but I don't really see why one cannot use the names
> "directly", without utilizing special-names.
> Ah well...
>
> One thing I've never done is
> special-names.
> console IS cnsl.
>
> display 'something' upon cnsl
>
> It works, but it never occured to me I might want to do that, when
> display 'something' upon console
> seems (to me) to be quite obvious...
>
> I suppose the special-names paragraph would be useful if I were converting
> from COBOL/VSE to some other COBOL. Then I could do something like...
>
> special-names.
> sysout is syslst
> sysout is syspch
> sysin is sysipt.
>
> (Actually, that does not work because I've assigned two mnemonic names to
> the same environment name. Huh. Seems like that should work...)
>
> Frank
>
> ---
> Frank Swarbrick
> Senior Developer/Analyst - Mainframe Applications
> FirstBank Data Corporation - Lakewood, CO USA
>
> I wondered who would notice that. My mistake. "Common" IBM usage is:
>
> Accept whatever from Sysin
> or
> Display whatever upon Sysout
>
> (There are a long list of "valid" things that can be used for
> Accept/Display
> -
> e.g. CONSOLE, SYSIPT, etc)
>
> --
> Bill Klein
> wmklein <at> ix.netcom.com
> "Chuck Stevens" <charles.stevens@unisys.com> wrote in message
> news:e57k7r$1cb5$1@si05.rsvl.unisys.com...
> mnemonic-name,
> that
> ...
>
> mnemonic
> ODT
> it
> specifier
>
>
>
>
>
| |
| Chuck Stevens 2006-05-31, 6:55 pm |
|
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:4dpinuF1arrshU1@individual.net...
> I don't really understand the point of special-names here. We do
> generally
> have it more like:
> C01 IS CHANNEL-1
> CSP IS SUPRESS-SPACE
> AFP-5A IS AFP-CONTROL.
> write fd-rec after advancing CHANNEL-1
> write fd-rec after advancing SUPPRESS-SPACE
> and my personal favorite
> write fd-rec after advancing AFP-CONTROL
>
> So I suppose the requirement to use special-names does make things a bit
> more readible, but I don't really see why one cannot use the names
> "directly", without utilizing special-names.
> Ah well...
For the WRITE ... ADVANCING <mnemonic-name> case, whatever feature-names the
implementor chooses to use in the particular environment are defined by the
implementor. I haven't a clue what AFP-5A means in the Unisys MCP
environment. The implementor also defines switch-names and device-names.
What is SYSIN in one environment may be READER in another, and I'm not
convinced the standard should support one over another. Should all
conforming implementations of COBOL be required to provide syntax for
testing and setting the bits in the UPSI byte -- and be limited to no more
than eight switches -- whether or not there is any direct or indirect analog
to the UPSI byte (by that name or any other) in the implementation? Same
sort of thing applies to the likes of "ADVANCING C01".
-Chuck Stevens
|
|
|
|
|