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

convert packed decimal into signed digit


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
j_rymbei

New User


Joined: 22 Aug 2006
Posts: 17
Location: India Kolkata

PostPosted: Thu Jan 04, 2007 12:29 am
Reply with quote

Hi,
How to convert a signed packed decimal into signed digit. Say if the packed decimal value is negative I want to see the output showing minus
sign at the begining of the number.

Thanks,
Jwell
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jan 04, 2007 2:31 am
Reply with quote

You didn't give any details so it's hard to be specific. Let's assume you have a 3-byte PD field in positions 21-23 that you want to display. You could use a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC FIELDS=(21,3,PD,M26)
/*


SORTOUT might have:

Code:

-12345 
+00001 
-00001


If you want the output in a different form, you could use a different edit mask.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
Search our Forums:

Back to Top