IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

doubt in comp to numeric


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 31, 2008 3:47 am
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 31, 2008 5:01 am
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Dec 31, 2008 5:39 am
Reply with quote

Click on the below LINK -

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Convert HEX to Numeric DB2 3
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Find a record count/numeric is multip... COBOL Programming 1
Search our Forums:

Back to Top