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
 
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: 8165
Location: East Dubuque, Illinois, USA

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: 8165
Location: East Dubuque, Illinois, USA

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: 2504
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm

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