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

What R 2 of the common forms of the EVALUATE STATEMENT ?

1 Answers   Cap Gemini,


Scenario: I have 3 Input Files.Read the first i/p file and depending on certain business logic, I want to read wither i/p file-2 or i/p file-3.Now, depending on certain business logic applied to the record read from either file-2 or file-3, I decide to write them to either output file-2 or output file-2. Question: How many job steps are necessary to implement a solution for the above.

2 Answers   TCS,


what are decleratives in cobol?

0 Answers   GGG, Satyam,


Under which scenario you would go for a static call as opposed to dynamic call?

5 Answers   TCS,


In COBOL, what is the different between index and subscript?

0 Answers   TryTechnicals Pvt Ltd,






what is search and searchall?what is the diffrence between them?give an best example?

3 Answers   BirlaSoft,


wht is packed decimal in cobol

2 Answers  


What compiler option would you use for dynamic linking?

2 Answers  


how we rectify soc7 and soc4 errors in project?

1 Answers   Anaxis, TCS,


) How do u handle errors in BMS macro

0 Answers   IBM,


how can we code index in an array of cobol pgm?

1 Answers   Wipro,


01 MOVE 10 TO N 05 PERFOM PARA1 TIMES STOP RUN WAT WILL HAPPEN?? WILL IT RUN INFINITELY OR AN ERROR WIL BE THER BECAUSE NO OF TIMES IS NOT GIVEN??

1 Answers  


Categories