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 Need an info to store Hexadecimal val... SENTHIL MURUGAAN DB2 2 Wed Jun 13, 2018 12:18 pm
This topic is locked: you cannot edit posts or make replies. Issue in suppressing leading zeros &a... Vijay_Sirisha COBOL Programming 21 Thu Jun 07, 2018 8:01 pm
No new posts VBS to VB in COBOL and JCL srajendran2 COBOL Programming 12 Fri Jun 01, 2018 3:04 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm

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