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.



I have a PS file and I would like to manually insert the binary values (like a COMP format) into t..

Answer / 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

More COBOL Interview Questions

Discuss about changing dataset name in proc.

0 Answers  


Hi All, Can anyone tell me how we can MOVE value of a X(19) variable to a S9(17) COMP-3 variable? Answer with an Example will be of great help.

6 Answers   EDS,


How can you submit a job from COBOL programs?

2 Answers   ITC Infotech,


File status must be checked both while opening and reading the file or only while reading the file?

2 Answers  


how do you reference the fixed unblock file formats from cobol programs

0 Answers  






In file1 have 80 records are like d1,d2,d3......D80. File2 have 1000records are like a1d1,a1d2,a3d3.....Etc. I want matching records in file3 ? Plse tell me the matching logic???I want answer only in cobol ?Not using any tool or jcl?

1 Answers   CSC,


How many variables can be declared in w-s section.?

2 Answers  


what is label record is standard or omitted in file description of data division?

3 Answers   IBM, TCS,


i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

0 Answers  


What guidelines should be followed to write a structured Cobol program?

1 Answers  


What is the default value of DISP parameter?

3 Answers   IBM,


What will happen if you code GO BACK instead of STOP RUN in a stand alone COBOL program ?

8 Answers   Arigo Infotech, IBM,


Categories