I am new user on this community and needs your help for one issue.
I need to fetch some fields from a PS which are defined as COMP but REXX exec is not able to show them in readable format. I know that i must have to convert them first in displayable format. Unfortunately i couldn't find any code snippet or any solution in REXX itself to get those fields in displayable format.
If anybody having such code of conversion or any idea about this issue, Please let me know.
If input values are negative, then i want those values with their signs also.
Probably I should have explained my problem in much better way. The code given by SUPERK unpacks a COMP-3 fields into displayable format. I have an doubt if the same code can convert COMP variable also in readable format.
So My input file have these two fields defined in COMP. File-Aid shows values of these fields as belows:
And i used the following code to convert the second field:
val = substr(input.1,261,8)
HEX = C2X(val)
RES = LEFT(HEX,LENGTH(HEX)-1)
IF RIGHT(HEX,1) = 'D' THEN
but i am getting some HEX values like 0C0012456789300 but my expected results was -8345734506.16
So i think that code given by SUPERK doesn't work with COMP fields.. Is there any other solution for COMP fields or am i doing any mistake..
Joined: 18 Jul 2007 Posts: 2150 Location: At my coffee table
OK, but how about X2D('81') -> 129 where the hexidecimal 81 is actually comp representation for a decimal 129....
Manuals are good and a link to the above one, TSO/E REXX Reference, is avaliable on the forum's manual page.
Please note, I do know nothing about REXX, but I do know where the manuals are and I know how to read them....