IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comp fields to Displayable format conversion


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
acs_amit

New User


Joined: 30 Apr 2009
Posts: 14
Location: Noida

PostPosted: Mon May 11, 2009 12:32 am
Reply with quote

Hi

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.

Any help !
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 11, 2009 12:58 am
Reply with quote

Welocome to the forums.
One thing you might want to explore is the forum search function.
I did a search for "comp" and "display" in the CLIST & REXX forum and came up with How to convert comp variables into numberic in REXX. Check out superk's posting.
Back to top
View user's profile Send private message
acs_amit

New User


Joined: 30 Apr 2009
Posts: 14
Location: Noida

PostPosted: Mon May 11, 2009 1:45 am
Reply with quote

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:

15 RS957PF-ALLOC-PCT 2/BI 1.234
15 RS957PF-VEST-AMT 8/BI -8345734506.16


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
say '-'RES
ELSE
SAY RES
EXIT 0

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..

Plz guide me
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 11, 2009 2:08 am
Reply with quote

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.... icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top