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

Hex-string in value assignment

92 views
Skip to first unread message

Stefan3737

unread,
Aug 24, 2016, 5:36:02 PM8/24/16
to
Hello everybody,

i have a little problem here with the value assignment by hex-strings, e.g:

- data length in decimal is 40 (result from "length(data)")
- assignment to a variable:
var = '00000028'X

works perfect in this case

Now i am searching for an expression like

var = d2x(length(data),8)

but it doesn't work. Can someone tell me why? How can I solve this?

Thanks in advance,

Stefan.

Barry Schwarz

unread,
Aug 24, 2016, 9:19:10 PM8/24/16
to
It works fine on my system.

What does "doesn't work" mean? Do you get a syntax error? A wrong
value?

What happens if you try
var = length(data)
var = d2x(var,8)
--
Remove del for email

Stefan3737

unread,
Aug 25, 2016, 1:26:33 AM8/25/16
to
Hello & thanks for your answer!

The code:

data = 'This is just a message for internal use.'
x = d2x(length(data))
say x

text_length = x

/* Text_length is one of a few parameters used to call CSNBOWH from ICSF to
calculate MD5 */

address linkpgm 'CSNBOWH',
'ex_rc',
'ex_rs',
'exit_data_length',
'exit_data',
'rule_array_count',
'rule_array',
'text_length',
'text',
'chain_vector_len',
'chaining_vector',
'hash_length',
'hash'


************************************

Result:

Running CSNBOWH to calculate MD5

Data = This is just a message for internal use.
Data length = 40

text_length 28
DATATYPE 28
CSNBOWH FAILed : RC = 00000008
RS = 00002AF8
************************************************






ErichSt

unread,
Aug 25, 2016, 12:32:00 PM8/25/16
to
 | var = '00000028'X
If you need var in this format, use d2c(), not d2x()

Gideon Natanzon

unread,
Mar 6, 2023, 10:02:18 AM3/6/23
to
0 new messages