Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Matching and non-matching records using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 59
Location: hyderabad

PostPosted: Fri Jul 26, 2013 5:24 pm    Post subject: Matching and non-matching records using SYNCSORT
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

Moderator


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

PostPosted: Fri Jul 26, 2013 5:26 pm    Post subject:
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: 59
Location: hyderabad

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

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 26, 2013 5:39 pm    Post subject:
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: 1717
Location: UK

PostPosted: Fri Jul 26, 2013 5:59 pm    Post subject:
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: 59
Location: hyderabad

PostPosted: Fri Jul 26, 2013 7:05 pm    Post subject:
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: 685
Location: Earth

PostPosted: Fri Jul 26, 2013 7:37 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Jul 26, 2013 7:38 pm    Post subject: Reply to: Matching and non-matching records using SYNCSORT
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: 59
Location: hyderabad

PostPosted: Fri Jul 26, 2013 11:37 pm    Post subject:
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: 685
Location: Earth

PostPosted: Fri Jul 26, 2013 11:59 pm    Post subject:
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: 59
Location: hyderabad

PostPosted: Sat Jul 27, 2013 12:28 am    Post subject:
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

Site Director


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

PostPosted: Sat Jul 27, 2013 12:38 am    Post subject:
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: 685
Location: Earth

PostPosted: Sat Jul 27, 2013 12:47 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Matching with Key at different postions. rajatbagga DFSORT/ICETOOL 12 Wed Nov 09, 2016 10:58 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us