Egg of Columbus!
That means it is quite simple after someone explained this.

Thank you all, I appreciate it.
Just for curiosity: I checked every hint - all of them are valid.

Regards
--
Radoslaw Skorupka
Lodz, Poland




W dniu 03.07.2025 o 17:07, Radoslaw Skorupka pisze:
They say there are no stupid questions...


I have the following statement in REXX code (linkpgm):
some_parm = '00000100'x
That means 256 decimal.
However I want to replace '00000100' with some variable, a result of some calculations
Let's imagine, x=a+b-c

How to transform x to a proper format for some_parm?
Note: I have to keep the length of the variable, so '100' is not a solution.

I've tried the following:
x=a+b-c           /*let's say x=110+156-10 */
x2=d2x(x)      /*x2 is 100, no leading zero's*/
x3=RIGHT(x2,8,0)  /* now x3 is 00000100, but it is text string */
x4=x2c(x3)            /* x4 consist of 4 bytes, characters are unprintable, but it is '00000100'x */

It works, but isn't it reinventing the wheel? That means, am I missing some simpler way?


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to