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
 

 

Converting packed decimal Positive value to negative in sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Converting packed decimal Positive value to negative in sort
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    Post subject: Reply to: Converting packed decimal Positive value to negati
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL 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 change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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