× 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.



&MSGDTA is from QSH0005. Return code is set by execution of QSH command. On
success, return code is reported as numeric '0'. But, since the program was
testing for *EQ 0 and later *NE 0, I learned that the value returned is NOT
EBCDIC 0 - which is x'F0 or 240. Adding the 240 now causes the test for *EQ 0
to be correct. Value >could< be x'30 which is ASCII 0, also *NE 0, since a 0
is presumed to be an EBCDIC 0 or x'F0.

Before I added 240, &RC shows on the dump as 4040404040.


John McKee


Quoting rob@xxxxxxxxx:

CRTBNDCL
STRDBG
Display Module Source
1- PGM
100- DCL VAR(&RETURNCODE) TYPE(*DEC) LEN(5 0)
200- DCL VAR(&RC) TYPE(*CHAR) LEN(5)
300- /* CHGVAR VAR(&RETURNCODE) +
400 VALUE(%BIN(&MSGDTA 1 4)) */
500- CHGVAR VAR(&RETURNCODE) +
600 VALUE(&RETURNCODE + 240)
700- CHGVAR VAR(&RC) VALUE(&RETURNCODE)
800- DMPCLPGM
900- ENDPGM

Step to DMPCLPGM
EVAL &RC :X
F0F0F2F4 F0...... ........ ........ - 00240

EVAL &RETURNCODE :X
00240F

From the dump

Variable Type Length

&RC *CHAR 5
&RETURNCODE *DEC 5 0

Value Value in Hexadecimal
*...+....1....+....2....+ * . . . + . . . . 1
'00240' F0F0F2F4F0
240

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From:
John McKee <jmmckee@xxxxxxxxxxxxxx>
To:
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date:
04/14/2009 03:15 PM
Subject:
CL type conversion error
Sent by:
midrange-l-bounces@xxxxxxxxxxxx



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))
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?

Thanks for the extra eyes.

John McKee

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.