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

I have PS flat file with 14 records. I want to read from 4th to 9th record and want to write those 6 records (4th record to 9th record) to another PS file (output file). there is no key defined in the input file. I just want read a certain Consecutive records. can any one please give me the procedure division Coding for this. I have coded the below coding but the READ-PARA is performing only 1 time even though I have 14 records in my input file (i.e FILE-1): PROCEDURE DIVISION. A000-SECTION. MOVE 0 TO I. OPEN INPUT FILE-1. IF CHECK-KEY1 > 0 DISPLAY "OPEN ERROR FOR FILE-1, CODE IS:" CHECK-KEY1 END-IF. OPEN EXTEND NEWFILE-1 IF CHECK-KEY3 > 0 DISPLAY "OPEN ERROR FOR NEWFILE-1 COD IS" CHECK-KEY3 END-IF. PERFORM READ-PARA THRU EXIT-PARA UNTIL EOF-REC = 'YES'. DISPLAY " FINALLY OUT OF LOOP" CLOSE FILE-1 CLOSE NEWFILE-1 STOP RUN. READ-PARA. ADD 1 TO I READ FILE-1 AT END MOVE 'YES' TO EOF-REC IF I > 3 AND < 10 PERFORM WRITE-PARA ELSE DISPLAY "NOT IN RANGE" END-IF. EXIT-PARA. EXIT. WRITE-PARA. WRITE NEW-REC FROM FILE1-REC.

8 Answers   IBM,


what is S04E error in jcl?

11 Answers   IBM, L&T,


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

0 Answers  


what is the minimum number of lines a Cobol program should have to successfully compile and run

11 Answers   ABC, Societe Generale,


Write some characteristics of cobol as means of business language.

0 Answers  






How to covert given string into ASCII value in COBOL/MF COBOL

3 Answers   CTS, IBM, iFlex,


i need the code for this program in cobol. 2 + 1 = 3 4+3=7 6+5=11 8+7=15 10+9=19

2 Answers  


What is the difference between Structured COBOL Programming and Object Oriented COBOL ?

1 Answers  


Name the divisions, which are available in a cobol program?

0 Answers  


what is the basic concept of mainframe? what knowledge is needed for learn this mainframe?

4 Answers   CSE, TCS, Wipro,


What does MAXCC 3 means? It is used in one my codes.

2 Answers   Wipro,


What are decleratives in COBOL ?

1 Answers   Xansa,


Categories