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
 

 

doubt in comp to numeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
vijay000

New User


Joined: 26 Jun 2006
Posts: 4

PostPosted: Wed Dec 31, 2008 3:45 am    Post subject: doubt in comp to numeric
Reply with quote

Hi Guys,
I am trying to move a data (423ec4c9) ( 1111409865) s(9) comp to 9(10).
But sometimes most significiant digit i.e (1 here) is getting spaced out and it reaching the target variable as 111408865.

Any explanations?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7997
Location: Bellevue, IA

PostPosted: Wed Dec 31, 2008 3:47 am    Post subject:
Reply with quote

Well, show us some variables definitions and code, and we'll have some explanations. From what you've posted, no explanation is possible.
Back to top
View user's profile Send private message
vijay000

New User


Joined: 26 Jun 2006
Posts: 4

PostPosted: Wed Dec 31, 2008 3:55 am    Post subject:
Reply with quote

Rob,

I am trying to move like

value-a PIC S9(9) USAGE COMP to value-b PIC 9(10) .

and teh most significant byte(first one) is getting spaced out.

needa some more info
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7997
Location: Bellevue, IA

PostPosted: Wed Dec 31, 2008 5:01 am    Post subject:
Reply with quote

Nope. PIC 9(10) values don't allow for spaces. Your value is not getting turned into spaces, no matter what you think. It could have a zero in front but not a space. When you compile the program, what is the TRUNC option value?
Back to top
View user's profile Send private message
vijay000

New User


Joined: 26 Jun 2006
Posts: 4

PostPosted: Wed Dec 31, 2008 5:25 am    Post subject:
Reply with quote

man,
Its TRUNC(BIN)
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Dec 31, 2008 5:39 am    Post subject: Re: doubt in comp to numeric
Reply with quote

Click on the below LINK -

http://ibmmainframes.com/viewtopic.php?p=167796&highlight=#167796

Regards,

Bill
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


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