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

Need help to compare 2 files and write the matched records
Goto page 1, 2  Next
 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
pgoe9
Member


Joined: 25 Mar 2011
Posts: 9

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

PostPosted: Fri Mar 25, 2011 6:36 pm    Post subject: Need help to compare 2 files and write the matched records Reply with quote

Hi,

I have 2 files. First file (Input1) having only 1 record is of 8 bytes containing the date in YYYYMMDD format. The second input file (Input2) having many records is of 107 bytes. This 2nd input file (Input2) contains the date from the column 100 to 107.

I need to compare both these files on the dates value and if the date matches then I need to copy all the contents from file 2 (input2) from column 1 to 99 in my output file.

For example: INPUT1
20110110

INPUT2
emp no1, name1, address,.........20110101
emp no2, name2, address,.........20110211
emp no3, name3, address,.........20110110

OUTPUT
emp no3, name3, address,.........

I was using ICETOOL utility but not able to code the parameters properly.
Can someone please help? Let me know if I have missed providing additional details.

Thanks,
Preeti
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: Fri Mar 25, 2011 10:44 pm    Post subject: Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/8)
//IN2 DD DSN=...  input file2 (FB/107)
//SORTOUT DD DSN=... output file (FB/99)
//SYSIN DD *
  JOINKEYS F1=IN2,FIELDS=(100,8,A)
  JOINKEYS F2=IN1,FIELDS=(1,8,A)
  REFORMAT FIELDS=(F1:1,99)
  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
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.
pgoe9
Member


Joined: 25 Mar 2011
Posts: 9

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

PostPosted: Mon Mar 28, 2011 11:54 am    Post subject: Reply with quote

Thanks Frank. I did try your option, but its giving the following error in sysout:

1 SYNCSORT 3.7BR TPF1 US PATENTS: 4210961,5117495, OTHER PAT. PEND. (C) 1998 61,5117495, OTHER PAT. PEND. (C) 1998 SYNCSORT INC. DATE=2011/087 TIME=02.40.32
z/OS 1.0.0 CPU MODEL 2097
SYSIN :
JOINKEYS F1=IN2,FIELDS=(100,8,A)
*
JOINKEYS F2=IN1,FIELDS=(1,8,A)
*
REFORMAT FIELDS=(F1:1,99)
*
SORT FIELDS=COPY
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000

Is it that DFSORT utility is not supported on my mainframe application?
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.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

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

PostPosted: Mon Mar 28, 2011 1:55 pm    Post subject: Reply with quote

SYSOUT mesages from your failed Job says - that you are using SYNCSORT, on the LPAR you execute this Job, so what Frank has posted might/might-not work with the SyncSort Shop but would work witha DFSort Shop for sure.

On the other hand, JOINKEYS are available with your release of SyncSort - though they use little differnt Syntax for them. Suggest you look in to the manuals and see what interface SyncSort needs for the JOINKEYs application.

Hint: For an Apllication developer, it's just the different DDnames...
_________________
Regards,
Anuj
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.
pgoe9
Member


Joined: 25 Mar 2011
Posts: 9

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

PostPosted: Mon Mar 28, 2011 2:09 pm    Post subject: Reply with quote

Yes you are right. The job is using SYNCSORT. As far as I know, this utility somehow does not work in our jobs.

Can the same job be converted using ICETOOL that will perform the same functionality? If yes, then please help me.
ICETOOL works quite well in my other mainframe jobs.
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.
pgoe9
Member


Joined: 25 Mar 2011
Posts: 9

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

PostPosted: Tue Mar 29, 2011 9:40 am    Post subject: Reply with quote

Hello,

Can someone please help me with this query? Frank, if you can help with the job using ICETOOL and splice statements, it will be great. Unfortunately joinkeys is not working in my mainframe job... Sad
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.
hparthas
Member


Joined: 21 Oct 2010
Posts: 43

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

PostPosted: Tue Mar 29, 2011 4:10 pm    Post subject: Need help to compare 2 files and write the matched records Reply with quote

Hi Preeti,

Here is the SORT Card which will work in SYNCSORT !!!!

Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/8)
//IN2 DD DSN=...  input file2 (FB/107)
//SORTOUT DD DSN=... output file (FB/99)
//SYSIN    DD  *                                     
  JOINKEYS FILE=F1,FIELDS=(1,8,A)                     
  JOINKEYS FILE=F2,FIELDS=(100,8,A)                   
  JOIN UNPAIRED                                       
  REFORMAT FIELDS=(F1:1,8,F2:1,107),FILL=X'FF'       
  SORT FIELDS=COPY                                   
  OUTFIL FILES=01,                                   
    INCLUDE=(9,2,BI,NE,X'FFFF',AND,1,2,BI,NE,X'FFFF'),
     OUTREC=(9,99)                                     
/*
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.
pgoe9
Member


Joined: 25 Mar 2011
Posts: 9

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

PostPosted: Tue Mar 29, 2011 5:16 pm    Post subject: Reply with quote

Its still not working Crying or Very sad The same error pops up again...

SYNCSORT 3.7BR TPF1 US PATENTS: 4210961,5117495, OTHER PAT. PEND. (C) 1998 S61,5117495, OTHER PAT. PEND. (C) 1998 SYNCSORT INC. DATE=2011/088 TIME=08.08.42
z/OS 1.0.0 CPU MODEL 2097

SYSIN :
JOINKEYS FILE=F1,FIELDS=(1,8,A)
*
JOINKEYS FILE=F2,FIELDS=(100,8,A)
*
JOIN UNPAIRED
*
REFORMAT FIELDS=(F1:1,8,F2:1,107),FILL=X'FF'
*
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(9,2,BI,NE,X'FFFF',AND,1,2,BI,NE,X'FFFF'),
OUTREC=(9,99)
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000


Its urgent. Will I be able to achieve the desired output??
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.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

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

PostPosted: Tue Mar 29, 2011 6:14 pm    Post subject: Reply with quote

Try this:
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=...  input file1 (FB/8)
//SORTJNF2 DD DSN=...  input file2 (FB/107)
//SORTOUT DD DSN=... output file (FB/99)
//SYSIN DD *
  JOINKEYS FILES=F1,FIELDS=(100,8,A)
  JOINKEYS FILES=F2,FIELDS=(1,8,A)
  REFORMAT FIELDS=(F1:1,99)
  OPTION COPY
/*

_________________
Regards,
Anuj
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 Mar 29, 2011 10:23 pm    Post subject: Reply with quote

Quote:
Frank, if you can help with the job using ICETOOL and splice statements, it will be great.


Since you are using Syncsort, you are actually using Syncsort's SYNCTOOL, not DFSORT's ICETOOL. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
_________________
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.
pgoe9
Member


Joined: 25 Mar 2011
Posts: 9

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

PostPosted: Wed Mar 30, 2011 10:26 am    Post subject: Reply with quote

Well, this is what I've been writing from the beginning. I requested your help on the ICETOOL utility because syncsort doesn't work in my mainframe job. I'm not asking any questions on Syncsort.

Please let me know how can I achieve the result using ICETOOL since you are an expert in that field, Frank.

I'm losing time... I have to submit the results very soon.
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.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

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

PostPosted: Wed Mar 30, 2011 2:02 pm    Post subject: Reply with quote

pgoe9 wrote:
Well, this is what I've been writing from the beginning. I requested your help on the ICETOOL utility because syncsort doesn't work in my mainframe job. I'm not asking any questions on Syncsort.

Please let me know how can I achieve the result using ICETOOL since you are an expert in that field, Frank.

I'm losing time... I have to submit the results very soon.
You need to understand what Frank has told you. When your site is a SyncSort site-- even if in your Job, you write PGM=ICETOOL, it's not going to invoke DFSORT's ICETOOL, it will invoke SYNCTOOL, a product from SyncSort.

Well, had you had a chance to have a look at what I posted in an earlier post?
_________________
Regards,
Anuj


Last edited by Anuj Dhawan on Thu Mar 31, 2011 1:15 pm; edited 1 time in total
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.
pgoe9
Member


Joined: 25 Mar 2011
Posts: 9

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

PostPosted: Wed Mar 30, 2011 2:49 pm    Post subject: Reply with quote

Ok Anuj, I got what you and Frank are saying. So even if I code ICETOOL utility its going to invoke Synctool.

I know you suggested me to look in to the manuals and see what interface SyncSort needs for the JOINKEYs application. Unfortunately I don't have access to such manuals.

I tried your code too, but it gives the same error.
My code is as follows:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=Input 1,DISP=SHR
//SORTJNF2 DD DSN=Input 2,DISP=SHR
//SORTOUT DD DSN=Output,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(230,4),RLSE),
// DCB=(RECFM=FB,LRECL=99,BLKSIZE=990)
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(100,8,A)
JOINKEYS FILES=F2,FIELDS=(1,8,A)
REFORMAT FIELDS=(F1:1,99)
OPTION COPY
/*

The error is as follows:

SYSIN :
JOINKEYS FILES=F1,FIELDS=(100,8,A)
*
JOINKEYS FILES=F2,FIELDS=(1,8,A)
*
REFORMAT FIELDS=(F1:1,99)
*
OPTION COPY
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000

Do you have any other suggestion?
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.
pgoe9
Member


Joined: 25 Mar 2011
Posts: 9

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

PostPosted: Wed Mar 30, 2011 5:16 pm    Post subject: Reply with quote

By the way, I also tried using PGM=SYNCTOOL but it failed with RC 0020.
I know this forum is mainly for DFSORT but if anyone is having info whether joinkeys utility can work on Syncsort for z/OS 1.0.0.

What I mean is, am I trying to use Joinkeys on the OS not upgraded to use this facility?
If anyone can help me in some direction...
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.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

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

PostPosted: Thu Mar 31, 2011 1:20 pm    Post subject: Reply with quote

Quote:
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
Where did you start the JOINKEYS SYSIN statements? Do you leave 2-blank spaces before these statements? Show your Job using BBcode next time, as showed by Frank and me in some of the posts.
_________________
Regards,
Anuj
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.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Goto page 1, 2  Next
Page 1 of 2



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