View previous topic :: View next topic
|
Author |
Message |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
try 01 sample-disp pic 9(4). |
|
Back to top |
|
|
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Thanks for the tip |
|
Back to top |
|
|
|