I have a variable account-number declared as comp-3, s9(10)
comp-3 in a file. How do i find a particular account number
say 123456 in that file?

Answers were Sorted based on User's Feedback



I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a part..

Answer / manoj

there are few ways for that
1. Write a cobol program
if com3field = 123456
display 'record'
2. Open the file in HEX ON mode and read records one by one :)
3. else use sort utility in jcl
OPTION COPY
INCLUDE COND=(1,8,PD,EQ,123456)

Is This Answer Correct ?    0 Yes 0 No

I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a part..

Answer / vs kumar

By using File-aid we can see the comp-3 data item.

Please correct me if i am wrong.

Is This Answer Correct ?    0 Yes 1 No

I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a part..

Answer / balaji

Put HEX ON in the file and you can find the numbers
equivalent to the hexa decimal

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

Can 88 level variable be declared in FD section..?

1 Answers   Infosys,


How do u find the programs calling the given module, without having doing 3.13 on loadlib/source library?

2 Answers  


how can we fetch 3 records in cobol pgm any coding pls ?

3 Answers   CGI,


What is SDSF?

13 Answers   IBM,


How many maximum number of procedures can we write in one COBOL program?

5 Answers  






There is a production file which has millions of records in it.The program that uses it ends up with an SOC7 abend.It is sure that the abend is due to some invalid data in the file.Is there any way to debugg the SOC7 abend with out giving displays? I need the record which is cause for the abend.

8 Answers   Danske, iGate,


What is the difference between Global and External Variables?

0 Answers  


What is the difference between a subscript and an index in a table definition?

3 Answers   TCS,


consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP MOVE ZERO TO GROUP-ITEM ADD 50 TO AMOUNT-1 what will be the content of AMOUNT-1? a.50 b.100 c.0 d.unpredictable

10 Answers   TCS,


Can we dynamically increase the size of occurs clause? i.e In case I an not sure of the size of array and want to increase the size at run time.If yes , how?

1 Answers  


There are two flat files one having 10 records and other having 5 records. write a cobol pgm to find the duplicate records(matching records)from both files.

1 Answers   Mind Tree,


What should be the sorting order for SEARCH ALL?

5 Answers  


Categories