HP3000-L Archives

January 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:
Wirt Atmar <[log in to unmask]>
Reply To:
Date:
Sun, 23 Jan 2005 22:07:03 EST
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
Brian asks:

> When I do a DBGET I immediately do a :
>
>  MOVE FUNCTION UPPER-CASE(DB-BUFFER) TO DB-BUFFER.
>
>  It upshifts all the lower-case characters in the buffer correctly as I want
>  it to do.
>
>  However, after having a closer look at it, I have seen that a J2 field in
>  the DB buffer has been changed!
>
>  The value in the DB record = 609, but when I display the value in the
>  program after the fact it has mysteriously become 577.
>
>  Any ideas why this function is trashing the J2 fields ?

I don't know anything more about COBOL than other how to spell it, but bits
are bits and computer operations are computer operations. Your code implies
that you believe your database buffer to be text. An upshift operation scans down
the buffer and finds all of the "characters" that are between little-a and
little-z and subtracts decimal 32 from them.

Because you're not differentiating what part of the buffer is legimately text
and what part are binary encodings, the upshift operation is being applied
against every byte that falls in the decimal range 97 ("a") to 122 ("z"), thus
you're also transmogrifying your binary-encoded COBOL-integer values.

Wirt Atmar

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

ATOM RSS1 RSS2