On Apr 20, 8:20 am, Captain Paralytic wrote:
> Suppose I have a file with a list of keys and I want to extract
> records from another file where the keys match.
>
> Is it possible to do this using DFSORT?
>
> If so, can anyone give me a clue how??
> E.G.
>
> Key file:
> ABC1
> DEF2
> GHI3
>
> Record File:
> 11111LKJ8JKL
> 22222ABC1POI
> 33333RTY009
> 44444DEF2YUI
> 55555GHI3RTT
>
> Output to be:
> 22222ABC1POI
> 44444DEF2YUI
> 55555GHI3RTT

Here's a DFSORT/ICETOOL job that will do what you asked for:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=...  input file2
//    DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//OUT DD DSN=...  output file
//TOOLIN   DD    *
COPY FROM(IN1) TO(T1) USING(CTL1)
SELECT FROM(CON) TO(OUT) ON(6,4,CH) FIRSTDUP
/*
//CTL1CNTL DD *
  INREC OVERLAY=(6:1,4)
/*

Frank Yaeger - DFSORT Team (IBM) - [EMAIL PROTECTED]
Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to