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

Compare Two datasets and get the 1st unmatched record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ArunkumarGanesan

New User


Joined: 09 Jan 2020
Posts: 8
Location: USA

PostPosted: Fri Mar 27, 2020 2:00 am
Reply with quote

Hi,

I am having a requirement to compare two datasets and get the 1st unmatched after the matched record and last unmatched record from 1st file alone.

Input1: Recfm: FB LRECL:80
Key: 1,8,ZD
20200209
20200312
20200414
20200516

Input2: Recfm: FB LRECL:80
Key:4,8,ZD
MAY20200209INITIAL

Expected Output:
20200312 20200516

I tried using joinkeys. I am getting all unmatched records in the unmatched file.
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 Mar 27, 2020 2:50 am
Reply with quote

Line 5 of your control statements has a positional error.
Back to top
View user's profile Send private message
ArunkumarGanesan

New User


Joined: 09 Jan 2020
Posts: 8
Location: USA

PostPosted: Fri Mar 27, 2020 2:59 am
Reply with quote

Nic Clouston wrote:
Line 5 of your control statements has a positional error.


Nic. I'm so sorry i didn't get your advice. Can you please explain me
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 319
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Fri Mar 27, 2020 4:14 am
Reply with quote

Nic's humorous comment was alerting you to the fact that you failed to include your control statements in your original post.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 452
Location: Bamberg, Germany

PostPosted: Fri Mar 27, 2020 10:12 am
Reply with quote

Nic Clouston wrote:
Line 5 of your control statements has a positional error.

It has been fixed now. Output is as requested:
Code:
20200312 20200516
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 452
Location: Bamberg, Germany

PostPosted: Thu Apr 02, 2020 10:58 am
Reply with quote

It seems impossible for the TS to provide any Code that was tried or if the issue has been solved to provide a solution. icon_evil.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Thu Apr 02, 2020 2:06 pm
Reply with quote

Nowadays you cannot tell if they are just being rude or are under lockdown and unable to get to work.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 452
Location: Bamberg, Germany

PostPosted: Fri Apr 03, 2020 10:05 am
Reply with quote

Code:
//THEEND   EXEC PGM=ICEMAN
//F1       DD *                                                       
20200209 
20200312 
20200414 
20200516 
/*                                                                   
//F2       DD *
JUN20200209INITIAL                                                   
/*                                                                   
//SORTOUT  DD SYSOUT=*                                               
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  JOINKEYS F1=F1,FIELDS=(1,8,A),SORTED                               
  JOINKEYS F2=F2,FIELDS=(4,8,A),SORTED,NOSEQCK                       
  JOIN UNPAIRED,F1                                                   
  REFORMAT FIELDS=(F1:1,8,F2:4,8,?)                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(18:+0,ZD,LENGTH=8)),               
    IFTHEN=(WHEN=GROUP,BEGIN=(17,1,CH,EQ,C'B'),PUSH=(18:SEQ=8)),     
    IFTHEN=(WHEN=GROUP,BEGIN=(18,8,ZD,EQ,+2),PUSH=(9:1,8))           
  SORT FIELDS=(18,8,ZD,D)                                             
  OUTFIL FNAMES=(SORTOUT),                                           
    INCLUDE=(18,8,ZD,GT,+1),                                         
    ACCEPT=1,NULLOFL=RC4,                                             
    BUILD=(9,8,X,1,8)                                                 
  END                                                                 
/*

Output:
Code:
20200312 20200516
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Unable to retrieve Datasets Names usi... CLIST & REXX 18
No new posts REXX allocated datasets in JCL CLIST & REXX 9
No new posts Copying large number of datasets to m... JCL & VSAM 17
No new posts fetch the record number from FMNMAIN ... CLIST & REXX 10
No new posts exclude the 5 first lines for compare... TSO/ISPF 2
Search our Forums:

Back to Top