Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

compare two files using SORT

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
anu.slaksh
Member


Joined: 13 Nov 2007
Posts: 11

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 13, 2007 2:19 pm    Post subject: compare two files using SORT Reply with quote

i need to compare two files using SORT.

Here is my requirement:
I have two input files
input 1: length 850
input 2: length 200

I need to compare the (9,9,ch) of both the files. this 9,9 indicates the account number starting from 9th position with length 9. For those accounts that has a match in the input file,the (114,3,ch) data has to be fetched from the input 2.
That is there is a label for each account in input 2. i need to fetch those labels for every match in account in both the files.
Regarding duplicates, there will be duplicates in both the files.
i want to ignore the duplicates.

How can this be done using a sort?? I cant use ICETOOL. Can my
requirements be done using SORT CARD??
_________________
anu
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 13, 2007 8:51 pm    Post subject: Reply with quote

Quote:
How can this be done using a sort?? I cant use ICETOOL. Can my
requirements be done using SORT CARD??


Why can't you use ICETOOL? If you can use DFSORT, you can use ICETOOL. ICETOOL has been available with DFSORT since 1991.

Please show an example of the records in each input file (relevant fields only) and what you expect for output.
_________________
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
anu.slaksh
Member


Joined: 13 Nov 2007
Posts: 11

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Nov 14, 2007 9:28 am    Post subject: Reply with quote

input 1:

colu 9
-------
111111111
111111111
222222222
333333333

INPUT2:

COL 9 COL144
----------- ----------


111111111 ABC
222222222 ABN
222222222 ABN
333333333 EGL

Output:
---------

ABC 111111111
ABN 222222222
EGL 333333333

Here is my sample input and output..
am fine with ICETOOL also..
_________________
anu
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
1 votes
Not an useful post
Greate Post!! Salute Author
4 salutes

PostPosted: Wed Nov 14, 2007 9:03 pm    Post subject: Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for.

Note: You said 114,3,CH in your first post, but showed COL144 in your last post. I assumed it's 144 - if it's 114, just change the job appropriately.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/850)
//IN2 DD DSN=...  input file2 (FB/200)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/13)
//TOOLIN DD *
SELECT FROM(IN2) TO(T1) ON(5,9,CH) FIRST USING(CTL2)
SELECT FROM(IN1) TO(T1) ON(5,9,CH) FIRST USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(5,9,CH) FIRSTDUP
/*
//CTL1CNTL DD *
  INREC BUILD=(5:9,9)
/*
//CTL2CNTL DD *
  INREC BUILD=(1:144,3,5:9,9)
/*

_________________
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
anu.slaksh
Member


Joined: 13 Nov 2007
Posts: 11

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Nov 15, 2007 9:06 am    Post subject: Reply with quote

its working perfectly..
thnks... Very Happy
_________________
anu
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 11:06 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-3035.html