View previous topic :: View next topic
|
Author |
Message |
ArunkumarGanesan
New User
Joined: 09 Jan 2020 Posts: 8 Location: USA
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Line 5 of your control statements has a positional error. |
|
Back to top |
|
|
ArunkumarGanesan
New User
Joined: 09 Jan 2020 Posts: 8 Location: USA
|
|
|
|
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 |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 418 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1222 Location: Bamberg, Germany
|
|
|
|
Nic Clouston wrote: |
Line 5 of your control statements has a positional error. |
It has been fixed now. Output is as requested:
|
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1222 Location: Bamberg, Germany
|
|
|
|
It seems impossible for the TS to provide any Code that was tried or if the issue has been solved to provide a solution. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Nowadays you cannot tell if they are just being rude or are under lockdown and unable to get to work. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1222 Location: Bamberg, Germany
|
|
|
|
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:
|
|
Back to top |
|
|
|
|