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 if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

5 Answers   TCS,


where will u code file status ?

2 Answers   TCS,


i need a small 3d program using inline and outline.

0 Answers  


What is sqlca and why is it needed in any cobol-db2 program?

1 Answers  


Can we move X(9) to 9(9). If yes what are the ways for doing this?

3 Answers  


What is 77 level used for ?

12 Answers   IBM, iGate,


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

0 Answers   IBM,


Where the Plan is located in CICS-DB2

2 Answers   IBM,


how will u pass dadta to cobol+db2 program...?

4 Answers   IBM,


can we print comp 3 stmts how ?

3 Answers   Accenture, TCS,


why we are using set in searchall?

4 Answers   IBM,


Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?

3 Answers   Microsoft,


Categories