0

I Have 3 files. The customer file has customers who never ordered or had an invoice. We want to remove those customers from the customer file. I have 2 rpg programs one for each (orders, invoice) files. They create 2 temp outfiles which have those records that we want to Purge.

I want to merge these 2 files. There are duplicates in this sense:

Customer number     Suffix
123456              000
123456              001
123456              002
567890              000

Suffix can be there if the customer contacted us a second time, etc.

SO both outfiles can have these dupes.

I would like to have a final file that only has the customer number.

BUt I want to do this automatically, in a CL.

Can this be done in a CL, rather than a ad hoc SQL?

4

1 回答 1

1

一般来说,CL 不是数据库语言。将 ad hoc SQL 放入源成员中并使用 CL 命令RUNSQLSTM执行它。要在 CL 程序中获得更多动态 SQL,请使用RUNSQL

如果我记得,这个应用程序正在创建一些存档文件,这是最后一步。创建存档文件时,也很容易创建“重复”文件。我认为这是一条更好的路线,因为您可以更轻松地创建报告或电子表格或网页或您将要清除的客户的其他一些记录。

于 2013-08-21T14:42:08.863 回答