Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Numerics to packed data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
new2cobol

Active User


Joined: 04 Jan 2006
Posts: 70

PostPosted: Fri Feb 17, 2006 1:53 am    Post subject: Numerics to packed data
Reply with quote

Hey is there a way in REXX in which I can convert numerics (cobol 9(n) variables) to packed variables (s9(n) COMP)?

Please help...
Back to top
View user's profile Send private message
References
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3318
Location: Charlotte,NC USA

PostPosted: Fri Feb 17, 2006 12:31 pm    Post subject: Re: Numerics to packed data
Reply with quote

Try this procedure:
Code:

/* rexx */
d2p: procedure
/* rexx  convert number to packed decimal  */
arg number
if datatype(number) ^= 'NUM' then return ''
if number < 0 then
  interpret "number_p = '"abs(number)"D'x"
else
  interpret "number_p = '"number"C'x"
return number_p
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1