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
 
Store the Comp-3 value to Readable format in COBOL

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

New User


Joined: 27 Nov 2008
Posts: 37
Location: Cochin

PostPosted: Fri Mar 20, 2009 9:15 am    Post subject: Store the Comp-3 value to Readable format in COBOL
Reply with quote

Hi

I have a query.

My input file contains a field of size PIC 9(4) COMP-3 of length 3.

I need to display this field in zoned decimal / readable format in the cobol program

Below is field structure in the input file
01 sample pic 9(4) comp-3

In the cobol program i declared a temporary field as below

01 sample-disp pic x(3) usage value is display.

In procedure division i gave following move statement to move the comp-3 value to the temp declared valye,

move sample to samp-disp.

Note that after the above process if the value in the input value is '0501' (hex fomat), after the move it is displaying as '050'.

Let me know if there is any issue in the above cobol declartion variable.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Mar 20, 2009 3:08 pm    Post subject:
Reply with quote

try 01 sample-disp pic 9(4).
Back to top
View user's profile Send private message
sumueng

New User


Joined: 27 Nov 2008
Posts: 37
Location: Cochin

PostPosted: Fri Mar 20, 2009 3:21 pm    Post subject: Reply to: Store the Comp-3 value to Readable format in COBOL
Reply with quote

Thanks for the tip
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 COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
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

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