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
 
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: 6970
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 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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm

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