I have a PS file and I would like to manually insert the
binary values (like a COMP format) into the file. How can i
do that? the way do in COMP-3 format.. suppose i want to
insert -12345 in to file in comp-3 format. simply we can
open a file in edit mode and do HEX-ON and insert the
value .
SEE BELOW--
135
24D

in 3 bytes - this will be COMP-3 presenatation of -12345.

Answer Posted / harsha

Create a layout(copybook) of your PS file. This layout
will have fields defined in COMP-3/COMP format etc...

Open the file in EDIT mode in File Manager/File Aid and
start inserting records.
Suppose first field on your PS file is defined as S9(5)COMP-
3. Now open the file in File Manager/File Aid, and insert
appropriate value. e.g. -12345. Save and close file.
Now open the file again in CHAR MOD(i.e. simply browse the
file) and put HEX ON, you will see the value below.
135
24D
It will occupy only three byte.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the various section in data division and briefly explain them.

700


How to use the same COBOL program in Batch and CICS on lines? explain with an example

1914


Explain how you can characterize tables in cobol?

643


here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

6839


Why would you use find and get rather than to obtain?

692






What is the utilization of copybook in cobol? Could we utilize a similar copybook?

721


Why did you choose to work with ibm mainframe cobol programming?

631


Write down the divisions of cobol program?

672


When is inspect verb is used in cobol?

679


what is the use of outrecord?

1774


What kind of error is trapped by on size error option?

745


For rewrite, why is it mandatory that file needs to be opened?

623


What are declaratives and what are their uses in cobol?

714


What is difference between static and dynamic call in cobol?

780


What is length is cobol?

652