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
 

 

pic S9(4)v9(2) comp-3 to pic x(4) conevrtion

 
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: Tue Feb 15, 2011 12:31 pm    Post subject: pic S9(4)v9(2) comp-3 to pic x(4) conevrtion
Reply with quote

Hi All,
I have requirement as below.
WS-PRICE pic s9(5)V(4) comp-3
WS-UNIT pic x(5)
WS-CENT pic x(4)

if ws-price is 15.02 i want Ws-Unit as 00015 and WS-CENT as 02
Could you please let me know how to achive this

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

dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Feb 15, 2011 1:15 pm    Post subject:
Reply with quote

use an edit mask.
Code:

05  edit-mask                    pic 9(5).9(4).
05 
    redefines edit-mask.
    10  ws-unit-portion          pic x(5).
    10                           pic x(1).
    10  ws-cent-portion          pic x(4).

then
move ws-price             to edit-mask
move ws-unit-portion      to ws-unit
move ws-cent-portion      to ws-cent.
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Tue Feb 15, 2011 2:16 pm    Post subject:
Reply with quote

Thanks a Lot Dick Brenholtz

It worked
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts SIGNED DECIMAL TO COMP-3 using cobol ... ram_vizag COBOL Programming 1 Tue Mar 01, 2016 11:32 pm


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