DFSort

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
juhi
Member
Posts: 2
Joined: Mon Apr 30, 2012 10:05 am

DFSort

Post by juhi » Mon Apr 30, 2012 10:15 am

Hi can anyone help me on below query as:

I need to searh a bill id (which is to be picked from one file) and search in the whole input file. If that bill id is found in input file then all the records with thta bil id should be removed from input files.


File 1: recfm =VB ,lrec=621
SCH000370561000704
NMM000370561M24.10.1982
MEM000370561N
NMM000370561F23.12.1985
MEM000370561N
MEM000370561NTK10057794
MEM000370561NTK10141897
SCH000369465000404
NMM000369465M13.10.1984
MEM000369465N
NMM000369465M30.05.1972
MEM000369465N
MEM000369465NTK91955419
MEM000369465NTK10127458
SCH000373796000404
NMM000373796M04.12.1954Area Sales Manager
MEM000373796N



File 2: recfm =VB ,lrec=621


000370561
000369465

Output file :recfm =VB ,lrec=621


SCH000373796000404
NMM000373796M04.12.1954Area Sales Manager
MEM000373796N

That means i need to remove all the records from the input file1 which is in file2.

eg:watever records conatin 000370561 from 4th position (9 digit) i need to eliminate from input and rest of the records must be in output file.
All the files have RECFM= VB and LRECL= 621.

File 2: can have many reocrds like this ,not only one or two.
I am using SORT

Can anybody help me on this.
Juhi

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Apr 30, 2012 12:22 pm

Look at joinkeys in the DFSort manual and how then to write out unpaired records from file 1.
Regards
Nic

juhi
Member
Posts: 2
Joined: Mon Apr 30, 2012 10:05 am

Post by juhi » Mon Apr 30, 2012 12:35 pm

Tried with joinkeys but that is not working.
Juhi

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Apr 30, 2012 10:30 pm

I don't know what you tried with JOINKEYS that "didn't work", but here's a DFSORT JOINKEYS job that does what you asked for:

Code: Select all

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file1 (VB/621)
//IN2 DD DSN=...  input file2 (VB/621)
//SORTOUT DD DSN=...  output file (VB/621)
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(8,9,A)
  JOINKEYS F2=IN2,FIELDS=(5,9,A)
  JOIN UNPAIRED,F1,ONLY
  OPTION COPY
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others