> The goal is to get list of NAMEs from ABC record, but only if exist SUM > record with same NAME value.
Radoslaw, It is quite simple to compare two records using JOINKEYS feature of DFSORT. Here is a JCL which will give you the desired results. //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //INA DD DISP=SHR,DSN=Your Input VB file //INB DD DISP=SHR,DSN=Your Same Input VB file //SORTOUT DD SYSOUT=* //SYSIN DD * OPTION COPY JOINKEYS F1=INA,FIELDS=(96,10,A) JOINKEYS F2=INB,FIELDS=(14,10,A) REFORMAT FIELDS=(F1:1,4,5) /* //JNF1CNTL DD * INCLUDE COND=(5,3,SS,EQ,C'ABC') /* //JNF2CNTL DD * INCLUDE COND=(5,3,SS,EQ,C'SUM') SUM FIELDS=NONE /* Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN