Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I have the requirement to compare the two files and pick up
the matching records.
File 1. file2

23 32
32 13
34 15
35 36
36 35
43

Get the matching records from this 2 files to out file. how
you will do this in cobol program?

Answer Posted / ajay kumar ande

OPEN INPUT FILE1
OPEN INPUT FILE2
OPEN OUTPUT FILE3

MOVE 'N' TO EOF
PERFORM UNTIL EOF='S'
READ FILE1 AT END MOVE 'S' TO EOF
READ FILE2 AT END MOVE 'S' TO EOF

IF EMPNO1 = EMPNO2
MOVE
REC2 TO REC3
WRITE REC3
END-PERFORM.

CLOSE FILE1, FILE2, FILE3.

Is This Answer Correct ?    10 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

2593


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

1356


I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue

2558


can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

2435


I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

2440


What rules are followed by the search verb.

1127


What type of SDLC u followed? Why?

2002


what is difference between cobol and cobol/400

22933


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

9110


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

1177


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

1249


Write a program to enter and display the names of students in a class using the occurs clause.

1215


What is a SSRANGE and NOSSRANGE?

1477


how to convert the recors form vsam file to db2 table tru file aid

3270


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17886