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

Matching and unmatched records!!


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

New User


Joined: 04 Sep 2017
Posts: 43
Location: India

PostPosted: Thu Nov 09, 2017 11:22 am
Reply with quote

Hi all,

I have two input files of FB. Syncsort is the product I use.

I need to write the matched and unmatched records in file 2 in different files.

I used the below code:

Code:
//S1     EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTJFN1 DD DSN=Input.File1
//SORTJNF2 DD DSN=Input.File2
//SORTOF01 DD DSN=Matched.Records
//SORTOF02 DD DSN=Unmatched.Records
//SYSIN    DD *
  JOINKEYS FILE=F1,FIELDS=(9,6,A,1,7,A)
  JOINKEYS FILE=F2,FIELDS=(1,6,A,7,7,A)
  JOIN UNPAIRED,F2                     
  REFORMAT FIELDS=(F2:1,80,F1:1,13)             
  SORT FIELDS=COPY
  OUTFIL FILES=01,INCLUDE=(81,13,CH,NE,C' '),BUILD=(1,80)
  OUTFIL FILES=02,SAVE,BUILD=(1,80)
/*


I got the desired output but I need to add a condition in the matched record file that it should include only records with "ACTION" starting from second position.

Is there any solution to acheive this?

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

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Thu Nov 09, 2017 6:15 pm
Reply with quote

Vignesh Sid wrote:

Is there any solution to acheive this?

Yes, definitely there are many solutions, if you RTFM.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Nov 09, 2017 6:57 pm
Reply with quote

Vignesh Sid wrote:
I need to add a condition in the matched record file that it should include only records with "ACTION" starting from second position.

You already have a condition to include only records with a value in pos 81-93 (matched records that are really matched?),
can't you just add another condition ?

if RTFM is too difficult*, google for "smart dfsort tricks" and download the pdf file.
It does not explain all the options but is filled with working examples for various specific purposes (like files with matching and non-matching records).
Most DFSORT commands and options work the same way in SYNCSORT (including ICETOOL and SYNCTOOL)

* No offense intended. The Programmer's Guide has more than 700 pages and it's really not easy to find the right page there.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Thu Nov 09, 2017 9:14 pm
Reply with quote

Marso wrote:
* No offense intended. The Programmer's Guide has more than 700 pages and it's really not easy to find the right page there.

There is "FIND" option in any manual reading tool. Unless you have a printed version of it! icon_lol.gif
Since approx. end of 1980s, or beginning of 1990s I did not read any manual from top to bottom. icon_kidra.gif
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 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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
Search our Forums:

Back to Top