Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

'9C'x in a variable

22 views
Skip to first unread message

Swifty

unread,
Apr 5, 2012, 7:08:24 AM4/5/12
to
I have what I think is a decimal number in a variable. The results are
as follows:

Say D /* 4290.62 */
Say '"'D'"' /* "4290.62" */

So, it's pretty clear that D contains 4290.62

However, it won't insert into a DB2 DECIMAL column, so a little extra
investigation reveals:

say c2x('4290.62') /* 343239302E3632 */
say c2x(D) /* 9C343239302E3632 */

... so there is an '9C'x character at the beginning of the value in D.

Shouldn't something have appeared in place of that '9C'x character? It
was invisible in the trace, invisible in say, and only appeared when I
converted the value to hex...

This is with Open Object REXX, by the way.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

Dave Saville

unread,
Apr 5, 2012, 7:51:31 AM4/5/12
to
On Thu, 5 Apr 2012 11:08:24 UTC, Swifty <steve....@gmail.com>
wrote:

> I have what I think is a decimal number in a variable. The results are
> as follows:
>
> Say D /* 4290.62 */
> Say '"'D'"' /* "4290.62" */
>
> So, it's pretty clear that D contains 4290.62
>
> However, it won't insert into a DB2 DECIMAL column, so a little extra
> investigation reveals:
>
> say c2x('4290.62') /* 343239302E3632 */
> say c2x(D) /* 9C343239302E3632 */
>
> ... so there is an '9C'x character at the beginning of the value in D.
>
> Shouldn't something have appeared in place of that '9C'x character? It
> was invisible in the trace, invisible in say, and only appeared when I
> converted the value to hex...
>
> This is with Open Object REXX, by the way.
>

Classic Rexx:

D=4290.62
................................................ REXXTRY.CMD on OS/2
say D
4290.62
................................................ REXXTRY.CMD on OS/2
Say '"'D'"'
"4290.62"
................................................ REXXTRY.CMD on OS/2
say c2x('4290.62')
343239302E3632
................................................ REXXTRY.CMD on OS/2
say c2x(D)
343239302E3632
................................................ REXXTRY.CMD on OS/2



--
Regards
Dave Saville

Rony

unread,
Apr 5, 2012, 7:52:13 AM4/5/12
to
On 05.04.2012 13:08, Swifty wrote:
> I have what I think is a decimal number in a variable. The results are
> as follows:
>
> Say D /* 4290.62 */
> Say '"'D'"' /* "4290.62" */
>
> So, it's pretty clear that D contains 4290.62
>
> However, it won't insert into a DB2 DECIMAL column, so a little extra
> investigation reveals:
>
> say c2x('4290.62') /* 343239302E3632 */
> say c2x(D) /* 9C343239302E3632 */
>
> ... so there is an '9C'x character at the beginning of the value in D.
>
> Shouldn't something have appeared in place of that '9C'x character? It
> was invisible in the trace, invisible in say, and only appeared when I
> converted the value to hex...
>
> This is with Open Object REXX, by the way.

Running on CP850 on windows doing:

say "9C343239302E3632"x

yields:

£4290.62

Now, you are in GB AFAIK so maybe your variable D gets the pound symbol prepended before the "say d"
in your case?

---rony

Swifty

unread,
Apr 5, 2012, 8:07:37 AM4/5/12
to
On Thu, 05 Apr 2012 13:52:13 +0200, Rony
<rony.fl...@wu-wien.ac.at> wrote:

> say "9C343239302E3632"x
>
>yields:
>
> £4290.62

Ah, but in the UK:

say x2c('£')

yields:

A3

So this explains the difficulty.

Swifty

unread,
Apr 5, 2012, 8:08:22 AM4/5/12
to
On Thu, 5 Apr 2012 11:51:31 +0000 (UTC), "Dave Saville"
<da...@invalid.invalid> wrote:

>say c2x(D)
>343239302E3632

I'd be interested in:

Say x2c('9C343239302E3632')

Dave Saville

unread,
Apr 5, 2012, 8:14:37 AM4/5/12
to
On Thu, 5 Apr 2012 12:08:22 UTC, Swifty <steve....@gmail.com>
wrote:

> On Thu, 5 Apr 2012 11:51:31 +0000 (UTC), "Dave Saville"
> <da...@invalid.invalid> wrote:
>
> >say c2x(D)
> >343239302E3632
>
> I'd be interested in:
>
> Say x2c('9C343239302E3632')
>

Say x2c('9C343239302E3632')
ś4290.62

Swifty

unread,
Apr 5, 2012, 8:16:04 AM4/5/12
to
On Thu, 5 Apr 2012 12:14:37 +0000 (UTC), "Dave Saville"
<da...@invalid.invalid> wrote:

>Say x2c('9C343239302E3632')
>ś4290.62

Thanks Dave; I feel an oorexx bug report coming on.

Swifty

unread,
Apr 5, 2012, 8:24:47 AM4/5/12
to
On Thu, 5 Apr 2012 12:14:37 +0000 (UTC), "Dave Saville"
<da...@invalid.invalid> wrote:

>Say x2c('9C343239302E3632')
>ś4290.62

Bug 3515158

Rony

unread,
Apr 5, 2012, 1:01:12 PM4/5/12
to
On 05.04.2012 14:24, Swifty wrote:
> On Thu, 5 Apr 2012 12:14:37 +0000 (UTC), "Dave Saville"
> <da...@invalid.invalid> wrote:
>
>> Say x2c('9C343239302E3632')
>> œ4290.62
>
> Bug 3515158

Just saw that David Ashley flagged the report as "invalid" for Linux and unfortunately has closed
the issue in a way that no further comments can be given (which is a default of Sourceforge it seems).

So just for your information: I ran the program

a="9c34"
say "a:" a
say "a~x2c:" a~x2c

and get as output:

9c34
?4

where "?" is actually a diamond standing on one edge in which the question mark is displayed.

This is running ooRexx 4.1.0 on 64-Bit Ubuntu.

In order to see whether the latest 4.1.1 beta exhibits your reported problem, I installed rev. 7594
(beta 2) and re-ran the program and the same character (i.e. "C9"x as defined for Linux) as above
does get shown.

So, this character is shown on Linux as well in both, the 4.1.0 GA and the latest available 4.1.1 beta.

HTH,

---rony

Swifty

unread,
Apr 5, 2012, 2:04:24 PM4/5/12
to
On Thu, 05 Apr 2012 19:01:12 +0200, Rony
<rony.fl...@wu-wien.ac.at> wrote:

>So, this character is shown on Linux as well in both, the 4.1.0 GA and the latest available 4.1.1 beta.

This was getting very perplexing, but then I realised that all the
output from REXX was being displayed on my PC through a putty session.

So, I logged on again and executed the statement:

Say '"' || '9C'x || '"'

With the result: ""

So, it is putty that is failing to display anything from a '9C'x
character.

Same problem, but a different battle.

Shmuel Metz

unread,
Apr 5, 2012, 4:25:42 PM4/5/12
to
In <tl2rn7p9c5qnjrmm9...@4ax.com>, on 04/05/2012
at 01:07 PM, Swifty <steve....@gmail.com> said:

>Ah, but in the UK:

> say x2c('£')

>yields:

> A3

That depends very much on the code page you're using.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spam...@library.lspace.org

0 new messages