Hello! I have a question that I hope the DFSORT gurus can answer. I am trying 
to do a 2-file match, but there is a twist here that I am not sure I can reach 
with the Sort JOINKEYS process. From what I have read, I can show matched items 
or unmatched items, but not items greater than a key, while skipping those less 
than or equal. I can do this programmatically, but I am already using SORT to 
create the two files, so if we can stay with the theme here, that would be 
great.

Maybe an example will help. My first file (F1) from a customer contains a list 
of load modules with the latest maintenance APAR applied. it looks something 
like this (sorry, I don't know how to use fixed-width fonts here!):

....+....10...+....20
DBCFMPR  151 LU00071
DBCL1PR  151 LU01081
DBCMPPR  151
DBCNSPR  151 LU01224
DBDMPPR  151
DBDSMPR  151 LU02807

Then, my "Master List" of APARS (F2) looks like this (there are 1 to n entries 
for each module, and a lot more of these than shown)

----+----1----+----2----+----3----+---
DBCFMPR  151 RO90903  20160707 2016189
DBCFMPR  151 RO91404  20160808 2016221
DBCFMPR  151 RO94085  20170127 2017027
DBCFMPR  151 RO94783  20170329 2017088
DBCFMPR  151 RO95548  20170414 2017104
DBCFMPR  151 RO95719  20170531 2017151
DBCFMPR  151 RO99532  20171214 2017348
DBCFMPR  151 RO99997  20180308 2018067
DBCFMPR  151 SO09143  20190715 2019196
DBCFMPR  151 SO09510  20190809 2019221
DBCFMPR  151 LU00071  20210128 2021028
DBCFMPR  151 LU07865  20221115 2022319
DBCFMPR  151 LU09582  20230412 2023102
DBCGSPR  151 SO12776  20200428 2020119
DBCGSPR  151 LU00053  20210121 2021021
DBCLKPR  151 RO91115  20160726 2016208
DBCL1PR  151 SO15660  20210407 2021097
DBCL1PR  151 LU01081  20210622 2021173
DBCL1PR  151 LU04745  20220415 2022105
DBCL1PR  151 LU05861  20220727 2022208
DBCL1PR  151 LU07115  20221011 2022284
DBCNSPR  151 LU01224  20210518 2021138
DBDMPPR  151 LU07309  20221207 2022341
DBDSMPR  151 LU02338  20210913 2021256
DBDSMPR  151 LU02807  20210921 2021264
DBDSMPR  151 LU09582  20230412 2023102

Now the first list from F1 will be the driver for the process, and there are a 
few scenarios:
1. F1 member/APAR is found as the latest (last, here) entry in F2;
2. F1 member/APAR is found in the list, but there are other entries later 
(lower) in F2;
3. F1 member has no APAR (DBCMPPR and DBDMPPR) and there are no entries for the 
member in F2;
4. F1 member has no APAR (DBCMPPR and DBDMPPR) and there are one or more 
entries for the member in F2;

What I would like to see for output is:

1. Member, Version (151), APAR, "CURRENT"
2. Member, Version, APAR,  "MISSING", 1st newer APAR from F2, then on 
subsequent lines, each newer APAR (Member, Version, and APAR are optional on 
2nd + lines)
3. Member, Version, "BASE", "CURRENT"
4. Member, Version, "BASE" , then as #2 with all missing APARs

Given F1 above, it would look like this:

----+----1----+----2----+----3----+----4
DBCFMPR  151 LU00071  MISSING LU07865
                      MISSING LU09582
DBCL1PR  151 LU01081  MISSING LU04745
                      MISSING LU05861
                      MISSING LU07115
DBCMPPR  151 BASE     CURRENT   
DBCNSPR  151 LU01224  CURRENT        
DBDMPPR  151 BASE     MISSING LU07309   
DBDSMPR  151 LU02807  MISSING LU09582

I am not married to this output style, so if there is another way to get this 
detail, we can do that. I might want to add the dates of the missing LPARs, 
too, for additional clarity.

As I said, I am not sure that SORT can do this, even though it can do an awful 
lot of cool things. Let me know what you think.

Thanks for your guidance and assistance!

Don Johnson

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to