But if we use HEX data directly to write into file it's working fine
Case(b)

name = '52414A41'X
QUEUE name.

Output to the file: RAJA

Issue: In case(a) when the string was converted into HEX using C2X, it returns a HEX data string not a HEX data. But in case(b) as HEX data was written to file. My question is how to let REXX interpreter know that the variable 'name' in case(a) has HEX data and to be written it as HEX. Hope i made the issue clear. Lemme tread towards a solution.

I don't see how FRFAFJFA is hex? Hexadecimal system doesn't have Rs or Js!
–
AzizDec 25 '09 at 5:37

'FRFAFJFA' is the HEX form of a string 'RAJA'. Only decimal HEX representation will have 0-9, a-f, A-F values only.. There is difference between converting a string/decimal to HEX. Hope made you clear.
–
Raja ReddyDec 25 '09 at 8:34

in case(a), C2X(name) give you 52414A41, not FRFAFJFA. I still don't understand how you got that.
–
AzizDec 25 '09 at 10:46

Yes I agree. Let the HEX value be as you given. Now the issue has been updated ;). Still, the issue exists. how to let REXX interpreter know that the variable 'name' in case(a) has HEX data and to be written it as HEX.. Hope made you clear!
–
Raja ReddyDec 26 '09 at 2:49

Finally, I could resolve MYSELF issue described top. There is built-in function in REXX called 'INTERPRET', which helps us in building dynamic REXX commands. Here is the single statement, made me run the module successfully:

INTERPRET name_hex "= '" || name || "'X"

It dynamically creates a REXX statement:

name_hex = 'name'X

which will tell REXX interpreter the string in 'name' as HEX data.

Awesome right! Hope I made you clear.. Do get back to me with your questions..

I don't think you have a strong grasp of what you are trying to do here... Run the following REXX program and then figure out why it displays what it does. Once you have managed that, you can probably come up with a better solution to your hex/character problem.

NealB, you might feel that the variable 'name' has same value in every step. But each time the type of data changes. C2X gives a HEX string, but not the HEX value. My problem was writing this HEX string into a file as HEX value. I know it's confusing.. Writing string '52414A41' is different from writing '52414A41'X. For better understanding use a numeric data as example.
–
Raja ReddyJan 9 '10 at 10:45

Quote from the REXX manual: A hexadecimal string is not a representation of a number. It is an escape mechanism that lets a user describe a character in terms of its encoding, so of course '52414A41' and '52414A41'x are different! I don't think I've understood or understand what you really mean by "HEX string" vs "HEX value". Let's just call it a day and move on.
–
NealBJan 11 '10 at 17:00