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
 

 

How a change a sign of a packed decimal value in a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rohit_raajin

New User


Joined: 10 May 2005
Posts: 10
Location: india

PostPosted: Tue May 06, 2008 12:35 pm    Post subject: How a change a sign of a packed decimal value in a dataset
Reply with quote

I have a requiremnt as to change the sign of a packed decimal S9(7)V99 where it can have values like -100.23. I need to change the sign of this value to '+100.23'
I have these in a dataset and there are more than 1000 records in it.

Can anyone suggest me how to do this? It would be preferable if we can do this through JCL.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue May 06, 2008 1:32 pm    Post subject:
Reply with quote

Hello,

Quote:
I have a requiremnt as to change the sign of a packed decimal S9(7)V99 where it can have values like -100.23
If the data actually contains "-100.23", it is not packed decimal. . .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue May 06, 2008 10:07 pm    Post subject:
Reply with quote

rohit_raajin,

S9(7)V99 is a 4-byte PD value (it does NOT contain the decimal point internally). If you want to change all minus values to plus values, you can use these DFSORT control statements where p is the starting position of the 4-byte PD field:

Code:

    OPTION COPY
    INREC IFTHEN=(WHEN=(p,4,PD,LT,0),
       OVERLAY=(p:p,4,PD,MUL,-1,TO=PD,LENGTH=4))
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 -> JCL & VSAM 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 Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm


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