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 DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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