HP3000-L Archives

February 2003, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Michael Berkowitz <[log in to unmask]>
Reply To:
Michael Berkowitz <[log in to unmask]>
Date:
Fri, 14 Feb 2003 08:16:37 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (61 lines)
Ray Shahan writes


Hi all,

I don't understand what's going on with a simple accept statement:


01  KC-CONTRACT              PIC X(02)  VALUE SPACES.

PERFORM UNTIL (KC-CONTRACT <> SPACES)
;   DISPLAY "Enter KAD contract to process or 'E' to Exit: "
;        WITH NO ADVANCING
;
;   ACCEPT KC-CONTRACT FREE
END-PERFORM.


One contract value is #7, and if I try that value, it's treated as spaces,
and so is just the single value of #.  I can't find where/why the pound sign
symbal is converted/treated as spaces in the *&^%$ hp WEB on-line COBOL
manual, so any help would be appreciated.
--------------------------------------------------------------------
Looking right at the online docs at http://docs.hp.com/cgi-bin/doc3k/B3150090013.11820/70
I see the following in the fourth paragraph indicating # is the end of data.  In paragraph six is how to overcome this.

The FREE and INPUT ERROR phrases are HP extensions to the 1985 ANSI COBOL
standard.

The FREE phrase allows you to use free-field format to enter data. 

The INPUT ERROR phrases may also be used if the FREE phrase has been
specified.  They may not, however, be specified if the FREE phrase is
not.  This is the distinction between formats 1 and 2 of the ACCEPT
statement. 

Free-field format uses the pound sign (#) to indicate the end of data.
The ampersand (&), if used as the last nonblank character in a record,
indicates a continuation of data from one record or line to another.  An
ampersand takes precedence over the pound sign. 

If the ACCEPT statement is issued against a terminal (operator's console
or otherwise), the pound sign is not required to terminate data.  The
pound sign need only be used to indicate the end of data on a terminal
when the last nonblank character of data to be read is an ampersand.
Otherwise, simply pressing the RETURN key on the terminal indicates the
end of data.

If you want to enter a pound sign as part of your data, you must use two
consecutive pound signs, in which case, your program takes a single pound
sign as a data character.  Thus, for example, if you enter the
characters, ABC##&, a single pound sign is treated as part of the data,
and the ampersand is assumed to indicate a continuation of the data to
the next line.

Mike Berkowitz
Guess? Inc.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2