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

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


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dp33770

New User


Joined: 04 Jul 2007
Posts: 91
Location: Hyderabad

PostPosted: Tue Feb 15, 2011 12:31 pm
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
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: 91
Location: Hyderabad

PostPosted: Tue Feb 15, 2011 2:16 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top