× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



John McKee wrote:

This is so dumb. I have done type conversions in CL before and not encountered
this. First time with CLLE, though.

Given this:

DCL VAR(&RETURNCODE) TYPE(*DEC) LEN(5 0)
DCL VAR(&RC) TYPE(*CHAR) LEN(5)
.
CHGVAR VAR(&RETURNCODE) +
VALUE(%BIN(&MSGDTA 1 4))

John:

I don't get that part unless this is pre-V5R3 CL. Why not make &RETURNCODE an *INT instead of *DEC? Just grab the integer value and use it.

I assume that you're trying to extract a binary (integer) value from a MSGDTA() data structure.

Tom Liotta


CHGVAR VAR(&RETURNCODE) +
VALUE(&RETURNCODE + 240)
CHGVAR VAR(&RC) VALUE(&RETURNCODE)


A DMPCLPGM produces this for the two variables:

&RC *CHAR 5 ' '
&RETURNCODE *DEC 5 0 0

The HEX code for &RC is 4040404040
There is no HEX code for &RETURNCODE

I am trying to get the return code from a QSH session into a printable form, for
a message. From previous attempts, I learned that in order to compare
&RETURNCODE to a numeric zero, I had to add 240, to make it F0. That works
now. But, why is &RC still blanks?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.