Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Comp fields to Displayable format conversion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Comp fields to Displayable format conversion
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: 2150
Location: At my coffee table

PostPosted: Mon May 11, 2009 12:58 am    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Mon May 11, 2009 2:08 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us