Thanks, this looks very good;
the header on page 14 describes exactly what I had in mind:

Join fields from two files on a key
In this section, we show some tricks for joining fields from two files in different ways using the JOINKEYS
function of DFSORT

Radoslaw will sure be able to do the rest for his specific situation

Kind regards

Bernd


Am 07.09.2021 um 00:46 schrieb Joe Monk:
I would suggest using DFSORT with JOINKEYS.

See the example on page 15 here:
https://www.ibm.com/support/pages/system/files/inline-files/$FILE/sorttrck.pdf

Joe


On Mon, Sep 6, 2021 at 4:24 PM Bernd Oppolzer <bernd.oppol...@t-online.de>
wrote:

Hi Radoslaw,

I am not a DFSORT wizard, but:

this is similar to a INNER JOIN SQL query;
if I had a DB2 system at hand, I would load the SUM and ABC records into
two different
DB2 tables and do a SELECT statement involving an inner join, this would
give the desired result.

Maybe the same can be done using a clever MERGE statement using DFSORT,
but I don't know the control file syntax for this;
I can imagine building the two extracts (SUM and ABC, giving two work
files),
but then a third MERGE-SORT should combine the two input files and
produce output records
only, when certain keys in the input files match.
Maybe another person knows how to do this with DFSORT;
I am almost sure that this is possible.

Kind regards

Bernd


Am 06.09.2021 um 21:41 schrieb Radoslaw Skorupka:
I have the following task to do:

PS file, VB records, different types.
Two types are in scope of interest:
SUMeeeeeeeNAME123456eeeeeeeeeee...
ABCeeeeeeeeeeeeeeeeeNAME123456eeeee

SUM and ABC are record identifiers.
NAME123456 is 10-char field I need to analyze
eeeee is irrelevant content.


The goal is to get list of NAMEs from ABC record, but only if exist
SUM record with same NAME value.
Example:
input file
SUM       JOHN123456
SUM       BILL123456
ABC                              JOHN123456 anything
ABC                              JOHN123456 anythin2
XYZ irrelevant record
ABC                              MARIA23456 eeeeeee
WW$ another irrelevant record
ABC                              JOHN123456 anythin3
...
NAME in SUM is (10,10) - (offset,lentgh)
NAME in ABC is (92,10)
RECFM=VB  => add 4 to offset

desired output:
ABC                              JOHN123456 anything
ABC                              JOHN123456 anythin2
ABC                              JOHN123456 anythin3

MARIA and BILL are excluded


The only idea which come to my mind is to prepare two extracts and
then use REXX script, which is far from efficient.

Any clue?


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to