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

Converting packed decimal Positive value to negative in sort


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

New User


Joined: 24 Aug 2007
Posts: 24
Location: bangalore

PostPosted: Mon Jun 29, 2009 6:03 pm
Reply with quote

HI,

I have a file which contains amount field in packed decimal format. I want to convert all the values present in amount field to negative. Could you please guide me to accomplish this.

The file format is as follows

pos 1:51 characters
pos 52:57 packed decimal (amount field)
pos 58:83 character

Code:
ex pos                                                                               52      58
01112001I00         3595980041606200916062009200916    Ân    170
FFFFFFFFCFF444444444FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0006910003FFF
01112001900000000000359598004160620091606200920091600025C001C170
----------------------------------------------------------------
01112001I00         3595980071606200916062009200916     *    170
FFFFFFFFCFF444444444FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000250002FFF
01112001900000000000359598007160620091606200920091600094C000C170

.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jun 29, 2009 9:01 pm
Reply with quote

raghavendra P k,

Try this JCL

Code:

//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD DSN=Your input file,DISP=SHR
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
  OPTION COPY,SZERO                       
  INREC IFTHEN=(WHEN=(52,6,PD,GE,+0),     
  OVERLAY=(52:-1,MUL,52,6,PD,PD,LENGTH=6))
/*
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top