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
 

 

Joinkeys to find matching and unmatching records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
maki_psg

New User


Joined: 28 Jan 2010
Posts: 47
Location: India

PostPosted: Mon Apr 01, 2013 4:58 pm    Post subject: Joinkeys to find matching and unmatching records
Reply with quote

Hi,

I would like to identify the matching and non-matching recs of an input file against the master file. I had written a sort card to get the results. However, I will have to include another logic to filter the matching recs based on a value.

For e.g. See below the sample content of the files

Master file -F1
Code:

PABBBBBBTM000AE1111110010100
PABBB66GBQ000AE1111110010100
PAMEAAAAAA000AE1111110010100
PAMEBBBBBB000AE1111110010100

INPUT - F2
Code:

BBBBBBTM AE1111110010100
BBB66GBQ AE1111110010100
MEAAAAAA AE1111110010100
MERRRRRR AE1111110010110

Sort Card
Code:

JOINKEYS FILE=F1,FIELDS=(3,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A)
  JOIN UNPAIRED,F2
  REFORMAT FIELDS=(F2:1,55,F1:30,5)
  SORT FIELDS=(1,8,CH,A,34,10,CH,A,44,10,CH,A)
  OUTFIL FNAMES=SORTOF01,INCLUDE=(56,1,CH,NE,C' '),
                         BUILD=(1,55,56:56,5,PD,ZD,66:15X)
  OUTFIL FNAMES=SORTOF02,SAVE,BUILD=(1,59,21X)


Here, I got the below results.

Matching File
Code:

BBBBBBTM AE1111110010100
BBB66GBQ AE1111110010100
MEAAAAAA AE1111110010100

Non matching File

Code:

MERRRRRR AE1111110010110

However, I would like to write only the matching recs, which has the 1st two chars in matching key as 'ME' into matching file, else, I will have to write it into non-matching file.

Expected Matching File
Code:

MEAAAAAA AE1111110010100

Expected Non Matching File
Code:

BBBBBBTM AE1111110010100
BBB66GBQ AE1111110010100
MERRRRRR AE1111110010110


I will have to consider given 8 bytes as the key field.

I can use IFTHEN=, however, the non matched will not be written into non matching file, if I use this logic. Please provide some suggestions to get the desired matching/non matching file.

Thanks
Back to top
View user's profile Send private message

Pandora-Box

Moderator


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

PostPosted: Mon Apr 01, 2013 5:26 pm    Post subject:
Reply with quote

What is your DFSORT version?

You can run this job to see the ICE201I message:


Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*
 
Back to top
View user's profile Send private message
maki_psg

New User


Joined: 28 Jan 2010
Posts: 47
Location: India

PostPosted: Mon Apr 01, 2013 5:52 pm    Post subject:
Reply with quote

Pandora-Box wrote:
What is your DFSORT version?

You can run this job to see the ICE201I message:


Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*
 


Hi,

I am currently using SYNCSORT FOR Z/OS 1.4.1.0R.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Apr 01, 2013 6:24 pm    Post subject: Reply to: Joinkeys to find matching and unmatching records
Reply with quote

So the topic has been moved to the JCL part of the forum, where SyncSort topics live.
Code:

  OUTFIL FNAMES=SORTOF01,INCLUDE=(56,1,CH,NE,C' ',
                                 AND,1,2,CH,EQ,C'ME'),
                         BUILD=(1,55,56:56,5,PD,ZD,66:15X)


Looking quickly, don't you just need to do something like the above?
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


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