Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us