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


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@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

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

Frank Yaeger
Moderator


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

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
anu.slaksh
Member


Joined: 13 Nov 2007
Posts: 11

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
Frank Yaeger
Moderator


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

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
anu.slaksh
Member


Joined: 13 Nov 2007
Posts: 11

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
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

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts two reports to compare , both different format - URGENT 1 ar3 1493 Wed Jul 15, 2009 7:57 pm
Frank Yaeger View latest post
No new posts If both the JOBCAT & STEPCAT statements are coded in a s 1 Krishna 2095 Tue May 12, 2009 6:43 pm
Krishna View latest post
No new posts Commit both in DB2 and MQ 3 jackie 2824 Fri Jul 27, 2007 3:52 pm
dbzTHEdinosauer View latest post
No new posts How to use both lower and upper case letters in cobol? 1 Divya 4885 Fri Mar 09, 2007 10:27 pm
Veera View latest post
No new posts Stop Run in both called and calling programs !!! 2 arrbee 4480 Fri Mar 10, 2006 12:13 pm
jaydeeppal View latest post
 



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

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