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


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

Joinkeys using ICETOOL

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


Joined: 21 Feb 2013
Posts: 2

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

PostPosted: Thu Feb 21, 2013 8:30 am    Post subject: Joinkeys using ICETOOL Reply with quote

Hi

I have three files. I need to compare infile1 with infile2 write into outfile1 and compare infile1 again with infile3 write into outfile2. Can I do it using JOINKEYS and ICETOOL ? If yes, please let me know how.

infile1
====
65109 data1 data2 data3
65110 data4 data5 data6
65111 data7 data8 data9
65201 1data 2data 3data
65202 4data 5data 6data
65203 7data 8data 9data

infile2
====
65109
65110
65111

infile3
====
65201
65202
65203

outfile1 should be
============
65109 data1 data2 data3
65110 data4 data5 data6
65111 data7 data8 data9

outfile2 should be
============
65201 1data 2data 3data
65202 4data 5data 6data
65203 7data 8data 9data

Key to compare with infile1 is first 5 digit bytes of code in infile2 and infile3.

Thanks in Advance
dxg1739
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.

William Collins
Active Member


Joined: 24 May 2012
Posts: 714

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

PostPosted: Thu Feb 21, 2013 12:17 pm    Post subject: Reply with quote

Which particular ICETOOL function do you fancy using? Unless you have one in mind, and a reason for it, you can easily stick to plain Sort.

I would, assuming there is no trailer on infile2, make one, concatenate infile2, dummy trailer, infile3, include a byte to indicate the source of the infile2/3, use JOINKEYS, use OUTFIL to direct the output to one file dependent on added byte and use SAVE on the other.
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.
dxg1739
Member


Joined: 21 Feb 2013
Posts: 2

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

PostPosted: Thu Feb 21, 2013 7:45 pm    Post subject: Reply with quote

Thanks for your input!

I have not used ICETOOL extensively so any function which can make it work will do.

There is one byte of trailer indicator in infile2 and infile3. Can you please be more specific on what you explained below?
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.
William Collins
Active Member


Joined: 24 May 2012
Posts: 714

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

PostPosted: Fri Feb 22, 2013 5:26 am    Post subject: Reply with quote

Firstly, forget ICETOOL for now. What you want is SORT.

The thing you want in SORT is JOINKEYS.

JOINKEYS matches two input files.

You have a data file and two "key" files.

If you concatenate the "key" files, you only have one JOINKEYS process to run.

If you have a trailer on (at least) your first input file, you will be able to put "a value" as an extension on data from the first "key" file, and "another value" in the same place on the record for data from the second "key" file.

You then do the JOINKEYS as normal. In a COPY operation after the JOINKEYS (still part of the same thing) you can use two OUTFIL statements, which output data to output 1 or output 2 depending on the value of the position populated by "a value"/"another value".

So, find some examples of JOINKEYS. Read in the manual on JOINKEYS. Do some experiments. If you have problems, let us know, with full information. If you get it to work, let us know, with the control cards, as it may help someone with a similar requirement in the future.
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.
The Last Gunslinger
Member


Joined: 17 Apr 2013
Posts: 1
Location: UK

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

PostPosted: Wed Apr 17, 2013 7:16 pm    Post subject: This will also give you the required results Reply with quote

//TOOLIN DD *
COPY JKFROM TO(X1) USING(CTL1)
COPY JKFROM TO(X2) USING(CTL2)
//CTL1CNTL DD * *
JOINKEYS F1=IN1,FIELDS=(1,4,A)
JOINKEYS F2=IN2,FIELDS=(1,4,A)
REFORMAT FIELDS=(F1:1,80)
//CTL2CNTL DD * *
JOINKEYS F1=IN1,FIELDS=(1,4,A)
JOINKEYS F2=IN3,FIELDS=(1,4,A)
REFORMAT FIELDS=(F1:1,80)
//

note
IN1
IN2
IN3
are the 3 input files
X1
X2
are the 2 output files
_________________
Monkeys & Money ! I'd rather devolve
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 Feb 01, 2016 1:35 am    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

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts EZtrv+ - Is there a way to suppress ez-code from printing... 5 seagreg 11386 Mon Feb 01, 2016 1:39 am
academyindia4 View latest post
No new posts Reg DFSORT utility. 5 ursvmg 18134 Mon Feb 01, 2016 1:38 am
academyindia4 View latest post
No new posts test datase empty 8 nick.mamone 16632 Mon Feb 01, 2016 1:38 am
academyindia4 View latest post
No new posts Xpeditor use in batch process 4 nanda_cse 15743 Wed Jan 27, 2016 8:56 pm
academyindia4 View latest post
No new posts thanks 0 chintu 5726 Wed Oct 24, 2007 7:06 pm
chintu View latest post
 


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-7033.html