IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Matching and non-matching records using SYNCSORT


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Fri Jul 26, 2013 5:24 pm
Reply with quote

Hi all..
I read and tried almost all the syncsort tips here to filter out matching and non-matching recordsm but still facing some issues. Can u please help.
This is what i am trying to do.
Compare the list of unique records(input-fil1) with the corresponding field on “input file 2” and write the matching records to one output file and non- matching records to a second output file.

I am using SYNCSORT FOR Z/OS 1.2.3.1R
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Jul 26, 2013 5:26 pm
Reply with quote

What all you tried??

Did you look at JOINKEYS
Back to top
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Fri Jul 26, 2013 5:30 pm
Reply with quote

Yes..
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jul 26, 2013 5:39 pm
Reply with quote

Please post the code that you have tried with the results and we might be able to help you.
What are the issues that you are facing. You know, but we do not.

Unfortunately psychic day was Wednesday this week, so you are going to have to give us a whole load more information than you have so far.

DSORG, RECFM and LRECL of both files.
Position, length and format of the keys that you are comparing - from both files.
Are there duplicate key values in either of the files. If yes, what needs to be done to handle this situation.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Jul 26, 2013 5:59 pm
Reply with quote

Also, are ALL the on-matching records to go to the SAME output file?
Back to top
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Fri Jul 26, 2013 7:05 pm
Reply with quote

Code:
//SORTJFN1 DD DSN=TEST.SORT.INPUT2,DISP=SHR
//SORTJFN2 DD DSN=TEST.SORT.INPUT3,DISP=SHR
//SORTOF01 DD DSN=TEST.SORT.OUTPUNT,
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
//            SPACE=(TRK,(350,200),RLSE)
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
      JOINKEYS FILES=F1,FIELDS=(1,5,A)
      JOINKEYS FILES=F2,FIELDS=(1,5,A)
      JOIN UNPAIRED,F1,ONLY
      REFORMAT FIELDS=(F1:1,6)
      SORT FIELDS=COPY
/*

here i am trying to write the unmatched records.
However I want to comapre INPUT2 with INPUT3 and write matching data in one file and non-matching in other file.
input files are LRECL 80 record lenthg 5.
--
spool shows :
A SORTJNF1 OR SORTJNF2 DD STATEMENT IS MISSING; BOTH ARE REQUIRED
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Jul 26, 2013 7:37 pm
Reply with quote

Code:
//SORTJFN1 DD DSN=TEST.SORT.INPUT2,DISP=SHR
//SORTJFN2 DD DSN=TEST.SORT.INPUT3,DISP=SHR


Typo in DD Name?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 26, 2013 7:38 pm
Reply with quote

You have three possible situations: F1 not on F2; F2 not on F1; Match.

What do you want to do in each situation?

Are their duplicate keys on either/both file(s)?

Are the input files already in key order?

If your LRECL is 5, why do you have 1,6 in your REFORMAT?

For the message, post the JCL from the spool for that step, and all the messages from the sysout for the step.
Back to top
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Fri Jul 26, 2013 11:37 pm
Reply with quote

yes, the keys will be ordered.
Input file 1 (of lrecl 80) will a have list of numeric records of length 5
Input file 2 (of lrecl 80) will a have list of numeric records of length 5
(all the records in input file 2 will be unique)
This i am tryng to achieve:
Compare the list of unique records in f1 with the corresponding field on f2. and write the matching records to one output file and non- matching records to a second output file.
SYSOUT MESSAGES:
WER276B SYSDIAG= 103476, 381175, 381175, 463458
WER164B 102,424K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 16K BYTES RESERVE REQUESTED, 1,004K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER478A A SORTJNF1 OR SORTJNF2 DD STATEMENT IS MISSING; BOTH ARE REQUIRED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Jul 26, 2013 11:59 pm
Reply with quote

Quote:
WER478A A SORTJNF1 OR SORTJNF2 DD STATEMENT IS MISSING; BOTH ARE REQUIRED

Again, the message clearly states that the required DDNAMEs are SORTJNFx and not SORTJFNx
Back to top
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Sat Jul 27, 2013 12:28 am
Reply with quote

Ya..i saw that.. but then i got this one
WER224A SORTOUT NOT DEFINED
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Jul 27, 2013 12:38 am
Reply with quote

Hello,

So, why do you not have a SORTOUT DD ?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Sat Jul 27, 2013 12:47 am
Reply with quote

What does that error message tell you? If you don't apply yourself, nobody here will be able to help you.

If you really need to direct your output to SORTOF01, add this at the bottom of your control card.

Code:
OUTFIL FILES=01,BUILD=(1,6)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top