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

Reply via email to