Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REXX to convert Packed Signed Decimal to Decimal or Integer 1

Status
Not open for further replies.

techtip07

Programmer
Feb 22, 2006
5
US
Hello everybody,

I have a fixed length dataset file in Mainframes having a few thousands of records,where some of the fields are integers and others are PACKED SIGNED DECIMALs. How could I convert these PACKED DECIMALs to INTEGER or DECIMAL ?
Could someone help me with a REXX program to do this ?

Thank you.
 
The REXX builtin function C2X wil convert a string into its hexadecimal characters. If you were to
Code:
C2X(some_4_byte_packed_field)
you might receive in response "0002156C" (that is, +2156).

You would want to snip the low-order character ("C" in this case) and add "0". This has the effect of trimming leading zeroes; there are other ways to do this, too.


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Hi Frank,

Thank you,.I got that function,could u help me in writing the REXX as I am not familiar with it.
A template would do.

thank you
 

No, that would be a conflict-of-interest since my employer pays me to do exactly that.

REXX is actually very easy to write -- very intuitive. Try it. You'll probably have no trouble.


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top