Can anyone please help me with this query..I am new to all this utilities ..Can you please help me with example of code.
I have two input file each of FB and Record length of 80 as below
File 1
11111111
file 2
ASJGHJLHJHTR11111111AHSKLGFJL
I want to comapre the record in file 1 starting at 1 with the record in file2 starting at 12 and if both are equal then send that record to output file. So in this case the output file should be
Output file
ASJGHJLHJHTR11111111AHSKLGFJL
How can I get this done in batch command.
Can i use compare if yes how??
please help me I really need this code.
Thanks in advance
comapring two files
Moderators: Anuj Dhawan, Moderator Group
-
- Member
- Posts: 2
- Joined: Tue Mar 03, 2009 8:36 am
Hi,
File-AID/MVS has got a very powerful Compare function built-in. You can actually use you record layouts (COBOL or PL/1) and tell File-AID to compare specific fields. For example, if the 1111111 that you mentioned was a customer-id field in one file and a cust-id field in the other file, you can tell File-AID to compare the two fields, even if they are at different offsets within their respective record layouts.
The output criteria allows you to copy the entire record (from any of the input files) to another file. You are able to extract records based on whether the records matched, were deleted, were inserted or simply changed.
Once you use this compare you will never want to use the ISPF compare utility.
Good luck.
File-AID/MVS has got a very powerful Compare function built-in. You can actually use you record layouts (COBOL or PL/1) and tell File-AID to compare specific fields. For example, if the 1111111 that you mentioned was a customer-id field in one file and a cust-id field in the other file, you can tell File-AID to compare the two fields, even if they are at different offsets within their respective record layouts.
The output criteria allows you to copy the entire record (from any of the input files) to another file. You are able to extract records based on whether the records matched, were deleted, were inserted or simply changed.
Once you use this compare you will never want to use the ISPF compare utility.
Good luck.
Dave E
Software Engineer
Software Engineer
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page