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
 

 

Need to convert X(10) to S9(6)V9(2)

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

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Thu Oct 25, 2012 1:11 pm    Post subject: Need to convert X(10) to S9(6)V9(2)
Reply with quote

Need some help in converting

X(10) to S9(6)V9(2) format.

Input Field will be something like this -123456.10

last 3 number will always be deimal and two decimal digits.



Thanks
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Oct 25, 2012 1:33 pm    Post subject: Reply to: Need to convert X(10) to S9(6)V9(2)
Reply with quote

If you data will always be valid, look at NUMVAL in the manual.
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Thu Oct 25, 2012 2:29 pm    Post subject: Reply to: Need to convert X(10) to S9(6)V9(2)
Reply with quote

Its not working.

My data looks like this

Code:

01  WS-FIELD-A  PIC X(11) VALUE     '-3456.78'.
01  WS-FIELD-C  PIC S9(6)V9(2)  COMP-3 . 

COMPUTE WS-FIELD-C = FUNCTION NUMVAL(WS-FIELD-A). 



Output looks like this
Code:
0034567Q     
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Oct 25, 2012 2:35 pm    Post subject:
Reply with quote

What was your expectation for the result with those WS-definitions?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Oct 25, 2012 2:43 pm    Post subject: Reply to: Need to convert X(10) to S9(6)V9(2)
Reply with quote

Have a look at this one and tell us why you think your value is not correct.
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Thu Oct 25, 2012 3:42 pm    Post subject: Reply to: Need to convert X(10) to S9(6)V9(2)
Reply with quote

Thanks I understand the output.

This field is one the field in part of copybook layout. When I am trying to move it layput its throwing error of incompatbility.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Oct 25, 2012 3:53 pm    Post subject: Reply to: Need to convert X(10) to S9(6)V9(2)
Reply with quote

Are you saying it is still a problem? If so, show how.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Oct 25, 2012 4:20 pm    Post subject:
Reply with quote

Quote:
This field is one the field in part of copybook layout. When I am trying to move it layput its throwing error of incompatbility.
Instead of telling us what the message says, SHOW US THE MESSAGE! (Cut and paste the EXACT message.) And show us the line(s) of code for which you are getting the message.
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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts help: convert C'00AB' to X'00AB' alan_gu DFSORT/ICETOOL 1 Thu Sep 29, 2016 12:22 pm


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