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: 6968
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 Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 8 Wed Aug 23, 2017 9:59 pm

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