suppose oza017.myorg.emp has 100 records ,oza018.myorg.staff has 200 records but 50 are the common records in both files copy all the common records into oza017.myorg.xyz dataset?



suppose oza017.myorg.emp has 100 records ,oza018.myorg.staff has 200 records but 50 are the common r..

Answer / Anshuman Verma

To copy the common records from oza018.myorg.staff to oza017.myorg.xyz, you can use a MERGE operation in IBM MainFrame SQL. Here's an example:
```sql
MERGE INTO oza017.myorg.emp s USING oza018.myorg.staff t
ON (s.ssn = t.ssn) AND (NOT EXISTS (SELECT * FROM oza017.myorg.emp e WHERE e.ssn = t.ssn))
WHEN MATCHED THEN UPDATE SET ...
WHEN NOT MATCHED THEN INSERT (ssn, ...) VALUES (t.ssn, ...);
```
Replace `...` with the columns you want to copy and update.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More IBM MainFrame AllOther Interview Questions

Explain foreign keys?

1 Answers  


Name and explain the type of locks?

1 Answers  


difference between MSGSFL AND SFL?

1 Answers  


which of the following is not true about search verb A) every search stmt must contain the AT END clause B) any no of WHEN clause can be used with this verb C) this verb can only applied to a table which is defined with the OCCURS clause and INDEXED phases. D) WHEN condition is satisfied

2 Answers   Accenture,


how can we describe comp sync?

1 Answers   IBM,


What are the different types of PL/1 files?

1 Answers   IBM,


How long have you been working on mainframes?

1 Answers  


01 T1. 02 month-day pic x(30) value ?jan,31, feb,28, mar,31, apr,30, may,31, june, 30? 02 new-day redefines month-day occurs 6 times 03 A pic xxx. 03 B pic 99. What are the content of A(3) and B(2) respectively A)mar,31 B) Feb,28 C) 28, Mar E)Mar, 28

1 Answers   Accenture,


can you change the attribute in mapset? if so how?

1 Answers  


What is inspect?

1 Answers  


What do you mean by monitor block?

1 Answers  


Can any one tell me that how we go for the compare,unit testing after changing requirement as per client request. this is very helpful for me when u give suitable (coading) exmple.

1 Answers   TCS,


Categories