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: 8214
Location: Dubuque, Iowa, 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: 8214
Location: Dubuque, Iowa, 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 COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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