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:
Connie Sellitto <[log in to unmask]>
Reply To:
Connie Sellitto <[log in to unmask]>
Date:
Fri, 25 Feb 2005 10:15:44 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (69 lines)
For a very simple approach -

Here's what I do, when I want to refer to the 'Tab' character.  In
the COBOL code, I key in the carat symbol (one could use any unique
character that would not appear in your data), and then use the
editor (I use QUAD) to change all '^' to <hit the Tab key> within
single quotes. This works just fine, although the screen and printed
listing look strange.   These codes could be incorporated into a
small COPYLIB file with similar results.

In order to test for tabs within a data string, I text in the file,
replace all <tab> with the carat ^ to make them readable.

Connie


>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 *


--
Connie Sellitto
Programmer/Analyst
732-528-9797 ext 18

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

ATOM RSS1 RSS2