Hi,

I have a requirement

File A : I have 6 records out of which 4 are same.

File B: I have 8 records out of 6 records are same.

The 4 records in FILEA and 6 records in FILE B are same. If
we substract we will get two records, I need these two
records in output file


This is because to remove the duplicates from the database.

Through easytrieve we can compare but for that there should
not duplicates, but in my file I have duplicates.

Thanks in advance!!

Answers were Sorted based on User's Feedback



Hi, I have a requirement File A : I have 6 records out of which 4 are same. File B: I ha..

Answer / vijay

It is simple, you no need to code ezt pgm for eliminating
the duplicate records. Try these 2 steps to eliminate the
duplicates.

Step-1: Use sort on file 1 and use sumfields=none on the
key field, then you can get only 2 records in the output
file.

Step-1: Follow the above procedure for the file 2.

Is This Answer Correct ?    8 Yes 1 No

Hi, I have a requirement File A : I have 6 records out of which 4 are same. File B: I ha..

Answer / sreejith

read file-1
1-a
2-b
3-c
4-d
5-e
6-f
also move record in to table1 that is decalred in ws with
legth 14 until read all the record from file-1
then
read file-2
move each record into table1 and variables g,h....up to for
8 records
now the table contain 16 item
then use legth variable l
then compare each variable from table for each matching
incriment the variabe length. after searching all item from
table
compare the legth with 1
if it is greater than one eliminate
other wise write it to the output file-3
ok

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

how you can direct the data to spool using SYSOUT option?

0 Answers  


What do you understand by the term “keyword” with respect to jcl and what is the opposite of the term?

0 Answers  


ihave ten flatfile in that iwant to concatinate all the files except file 5,6 into output file by uing jcl? how to do this? give me detail yntax for tis?

4 Answers   IBM,


What is a JCL Command statement ?

1 Answers   IBM,


How can we increment subscript and index?

1 Answers   CTS, IBM,






If a job has 3 steps and step 1 and step 3 should get executed and step 2 should not get executed irrespective of the return code from the previous steps. How can it be done?

5 Answers   TCS,


what if any ,is the syntax 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.

1 Answers  


How would I code JCL to copy a gdg data set G001v00 and create a gdg Data set G001v01

2 Answers  


i have a jcl containing header body and trailer .in header i have viswa body 2 6 1 9 7 trailer reddy .now i need to sort only body in either asecending or descending order how can i do it

1 Answers   L&T,


What happens if both JOBLIB & STEPLIB is specified ?

0 Answers  


do we need to mention the location of catalogued procedure for each it's call in a single job?

1 Answers  


What is the function of the steplib dd statement?

0 Answers  


Categories