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
 

 

Moving Packed decimal to numeric and getting Garbage value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
paramita.barman

New User


Joined: 12 Oct 2006
Posts: 18

PostPosted: Tue Mar 20, 2007 4:54 pm    Post subject: Moving Packed decimal to numeric and getting Garbage value
Reply with quote

Hi all,

I have 3 packed decimal fields.I am doing a computation among the 1st 2 and storing it in the 3rd field(R).
The result(Suppose R) of the computation is producing some negative results.
Then I am moving the value of the result field to a field of an output file whose data type is numeric(Suppose F), as follows,

F=R

But in place of 'MINUS SIGN' of result(R), I am getting 'GARBAGE VALUE' in my file.

Could anyone tell me why it is happening and what should I do to rectify it?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Mar 20, 2007 5:19 pm    Post subject:
Reply with quote

What is the picture of the output field?
Back to top
View user's profile Send private message
paramita.barman

New User


Joined: 12 Oct 2006
Posts: 18

PostPosted: Tue Mar 20, 2007 5:26 pm    Post subject: Re: Moving Packed decimal to numeric and getting Garbage val
Reply with quote

@ William

Its PIC clause is Numeric(N).
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Mar 20, 2007 5:33 pm    Post subject:
Reply with quote

What language?
Back to top
View user's profile Send private message
paramita.barman

New User


Joined: 12 Oct 2006
Posts: 18

PostPosted: Tue Mar 20, 2007 5:47 pm    Post subject:
Reply with quote

@ William

Easytrieve.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Mar 20, 2007 5:57 pm    Post subject:
Reply with quote

Though 'N' is zoned decimal, the last digit is still carrying the sign. You need to define F with a mask that provides for the sign like
F W 7 N MASK('ZZ,ZZ9-')
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 -> ABENDS & Debugging 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 Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


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