Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 6966
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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us