Comparing 2 sequential files with diff lrecl

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
mukesh1228
Member
Posts: 1
Joined: Tue Jan 12, 2010 3:12 pm
Location: Bangalore

Comparing 2 sequential files with diff lrecl

Post by mukesh1228 » Tue Jan 12, 2010 3:22 pm

Hi,

I want to compare 2 sequential file,
both are having diff record lenght and diff layouts,
but both files have few fields which are same (say employee names are in both files and having the same length)
now i want to do a comparison of these 2 files based on the common fields, and if the records with the same employee name exist in both the file and i need to copy that complete records into the 3rd file

1st file - lrecl = 300 (1,10,CH is the employee name)
2nd file - lrecl = 500 (15,25,CH is the employee name)

basically i need to see if the same employee name records exist in file1, then i need to write that record into the 3rd file with 500 lrecl.
just i need to see if file2 records are present in file1 or not. if Yes, then need to write those records in 3rd file,

Thanks in advance,
your help is greatly appriciated,
Regards,
Mukesh
Bangalore

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

Post by Frank Yaeger » Tue Jan 12, 2010 9:36 pm

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example so I can see what level of DFSORT you have.

Also, please run this job and show the //SYSOUT messages you receive:

Code: Select all

//S1    EXEC  PGM=SORT  
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *           
RECORD                  
//SORTOUT DD DUMMY      
//SYSIN    DD    *      
  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