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
 

 

Changing negative packed decimal to positive packed decimal.

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

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Wed Aug 24, 2011 11:01 am    Post subject: Changing negative packed decimal to positive packed decimal.
Reply with quote

Hi,

I have got a query

How can we convert Negative packed Decimal number to Positive packed decimal number using JCL.

Thanks in Advance.

Regards
Mayank
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Aug 24, 2011 11:08 am    Post subject: Reply to: Changing negative packed decimal to positive packe
Reply with quote

Using JCL it is not possible.

You need a program/utility.

Why do you want to change -ve to +ve like that anyway? Data fix?
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Wed Aug 24, 2011 11:10 am    Post subject:
Reply with quote

You cannot do this with JCL.
Back to top
View user's profile Send private message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Wed Aug 24, 2011 11:22 am    Post subject:
Reply with quote

Then how exactly we can do it?

Regards
Mayank
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed Aug 24, 2011 12:06 pm    Post subject:
Reply with quote

Why do you want to change it anyway?

Basic mathematics: Multiplying the value with a -1 will convert it into positive. Using SORT you can achieve it. Check it yourself.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Aug 24, 2011 12:29 pm    Post subject: Reply to: Changing negative packed decimal to positive packe
Reply with quote

Multiplying by -1 will change any positives to negative.

Also, better to subtract from zero.

You need some program (like SORT, which one do you have). You need to test that the field in question is negative. Then do "whatever".

But you still haven't answered why you want to do this?
Back to top
View user's profile Send private message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Wed Aug 24, 2011 12:32 pm    Post subject:
Reply with quote

Its actually a temporary datafix that i need to make..

the file coming is having some reverse sign data that why for a while i need an idea to do this in JCL..

Regards
Mayank
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Aug 24, 2011 12:47 pm    Post subject: Reply to: Changing negative packed decimal to positive packe
Reply with quote

Has anybody already analysed the scale of the problem and the impacts? For instance, to people/companies whose data is held in your system?

If you just "fix" the data, where is your audit trail? Who knows that the total of "fixed" items, value and number, is correct? Are your accountants/internal auditors happy with your approach?

What about a nice program, that knows what it is doing, produces a report of what it is doing, and which can be run and signed-off by people with the authority to do so?

Just whacking it with "JCL" strikes me as the wrong way to do it, with consequences down the line.
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: Wed Aug 24, 2011 10:58 pm    Post subject:
Reply with quote

Mayank,

You could use a DFSORT statements like the following. For the example, I assumed your PD field is in positions 5-7.

Code:

   OPTION COPY
   INREC IFTHEN=(WHEN=(5,3,PD,LT,0),
      OVERLAY=(5:5,3,PD,MUL,-1,TO=PD,LENGTH=3))


Whether doing that is a good idea or not is up to you.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
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 Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts changing z/os unicode conversion service meykh2014 All Other Mainframe Topics 0 Tue Jul 12, 2016 10:49 am
No new posts Convert Decimal to hexadecimal Steve Ironmonger DFSORT/ICETOOL 5 Fri May 27, 2016 4:19 pm
This topic is locked: you cannot edit posts or make replies. JCL to convert float decimal into rea... polymathtarun JCL & VSAM 3 Sun May 15, 2016 9:57 pm
No new posts conversion from char to packed decimal Musab Ahmed DFSORT/ICETOOL 7 Fri Apr 08, 2016 1:12 pm


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