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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am


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