Discussion:
Hex-string in value assignment
(too old to reply)
Stefan3737
2016-08-24 21:36:01 UTC
Permalink
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
2016-08-25 01:19:07 UTC
Permalink
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)

On Wed, 24 Aug 2016 14:36:01 -0700 (PDT), Stefan3737
Post by Stefan3737
Hello everybody,
- data length in decimal is 40 (result from "length(data)")
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.
--
Remove del for email
Stefan3737
2016-08-25 05:26:32 UTC
Permalink
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
2016-08-25 16:31:59 UTC
Permalink
 | var = '00000028'X
If you need var in this format, use d2c(), not d2x()
Gideon Natanzon
2023-03-06 15:02:16 UTC
Permalink
Post by ErichSt
| var = '00000028'X
If you need var in this format, use d2c(), not d2x()
Loading...