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

conversion of comp-3 data


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

New User


Joined: 10 Mar 2011
Posts: 45
Location: india

PostPosted: Tue Feb 11, 2014 6:12 pm
Reply with quote

I am having date value in the below comp-3 format

101
413
(y/m/d)

when i move the value to 01 ws-a pic 9(6) .
I am getting the output as
output : 14011

the value "3" is not displaying.

Could you please let me how to achieve this.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Tue Feb 11, 2014 6:27 pm
Reply with quote

That is not PACKED-DECIMAL/COMP-3, that is a BCD field (like packed, but with no sign nybble).

Code:
01  deal-with-bcd.
    05  your-field-in PIC X(3).
    05  FILLER COMP-3 PIC V9 VALUE ZERO.
01  FILLER REDEFINES  deal-with-bcd.
    05  your-fieldout COMP-3 PIC 9(6)V9.


Define your source field as PIC XXX/X(3), do the two obvious MOVEs, ending with the value you want.
Back to top
View user's profile Send private message
dharmaraok

New User


Joined: 10 Mar 2011
Posts: 45
Location: india

PostPosted: Mon Feb 17, 2014 2:26 pm
Reply with quote

Thanks !! its Working
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 View GDG data which is copied from a ... JCL & VSAM 2
No new posts JCL (SET) variables in input stream data JCL & VSAM 0
No new posts How to add 2 digits to COMP-3 file? DFSORT/ICETOOL 11
No new posts Issues with outrec overlay while extr... SYNCSORT 7
No new posts compare two file to find position/dat... SYNCSORT 2
Search our Forums:

Back to Top