HP3000-L Archives

February 2005, Week 4

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:
Mike Hornsby <[log in to unmask]>
Reply To:
Mike Hornsby <[log in to unmask]>
Date:
Fri, 25 Feb 2005 10:01:42 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (45 lines)
Craig Lalley wrote: after Robert Browett  wrote:

>>I have a programmer using COBOL who wants to know the binary/hex value of
>>TAB. He is trying to read a TAB delimted file with a COBOL program
>>I know that carriage return is x'015' and a quote is x'177' but does anyone
>>know what TAB is??
>>
>>
This would definitely be a case for FCOPY to verify the tabs in the data
file:

:fcopy from=tabdata;to;char;hex
HP31900A.05.04 FILE COPIER (C) HEWLETT-PACKARD CO. 1999
TABDATA RECORD 0 (%0, #0)
0000: 6161 0962 6209 6363 0964 6420 2020 2020 aa.bb.cc.dd
...

We see the HEX value of  '09' does indeed separate the data values. Next
we need a
method to get this value into a COBOL program. One could use the old
octal method.

01 TAB PIC X VALUE %11.

But as seen in the mixed phrasing of the original posting this can only
lead to confusion
and if this program ever needs to be ported, someone down the road will
not be amused.

IMHO, the best method is to use the ENVIRONMENT DIVISION statement:

SYMBOLIC CHARACTERS TAB IS 10.

A character table index is used, so one must add 1 to the decimal value
of the desired character. docs.hp.com/en/424/31500-90014.pdf

TGIF,
Mike Hornsby
Beechglen Development Inc.
www.beechglen.com
513-922-0509

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

ATOM RSS1 RSS2