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
 

 

moving PICX(10) to PIC 9(4).9(5)

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

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Thu Feb 12, 2009 6:32 pm    Post subject: moving PICX(10) to PIC 9(4).9(5)
Reply with quote

Hello,
My requirement is I have a varibale INV PIC X(10)
And I need to move it OUTV PIC 9(4)V9(5)

Ex :
INV = 1.0000
OUTV= 0001.00000

INV = 1.045
OUTV=0001.04500

Can anyone help me in this.
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Feb 12, 2009 6:54 pm    Post subject:
Reply with quote

Does the data in INV contain an actual decimal "." point, do you want an actual decimal in OUTV?
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Thu Feb 12, 2009 7:01 pm    Post subject:
Reply with quote

Yes The data in INV contains an actual decimal ".".
I want that decimal in my output .
as if the INV is 25.678 i want my OUTV as 0025.67800
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Thu Feb 12, 2009 7:13 pm    Post subject:
Reply with quote

UNTESTED:


OUTV must be defined as PIC 9(4).9(5)

requires a new field TEMPV PIC 9(4)V9(5).


COMPUTE TEMPV = NUMVAL(INV)

MOVE TEMPV TO OUTV
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Feb 12, 2009 8:05 pm    Post subject:
Reply with quote

Hey Dick, wouldn't MOVE NUMVAL(INV) TO OUTV work too?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Thu Feb 12, 2009 8:43 pm    Post subject:
Reply with quote

It has to be a COMPUTE.
The receiving field can be defined with COMP-3 if you want:
Code:
01  NUMVAL-AREA.                                     
    03 NUMVAL-FROM                PIC X(17).           
    03 NUMVAL-TO                  PIC S9(13)V99 COMP-3.

    MOVE '   +987.65' TO NUMVAL-FROM                 
    DISPLAY 'FROM = {' NUMVAL-FROM '}'               
    COMPUTE NUMVAL-TO = FUNCTION NUMVAL (NUMVAL-FROM)
    DISPLAY '  TO = {' NUMVAL-TO '}'
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Thu Feb 12, 2009 8:45 pm    Post subject:
Reply with quote

CICS Guy,

directly to OUTV (the edit mask) will work. My enterprise compiler does not like the MOVE, but will allow COMPUTE FUNCTION NUMVAL.
.......... I always use compute when I want to move numerics. my thing.
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Mon Feb 16, 2009 3:03 pm    Post subject:
Reply with quote

Thanks all
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 Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
No new posts Moving character data to smallint in db2 rikdeb DB2 5 Thu Jul 14, 2016 12:38 am
No new posts MOVING COMP-3 into binary akodakka COBOL Programming 2 Tue Dec 01, 2015 5:02 pm
No new posts CICS- Moving to High availability vicky10001 CICS 8 Fri Oct 23, 2015 7:49 pm
No new posts What is the best way for moving from ... Hooman24 All Other Mainframe Topics 0 Sun Apr 26, 2015 6:36 pm


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