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

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

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: 1348
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

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

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 Merging more than two records DFSORT/ICETOOL 15
No new posts Matching and non matching records usi... DFSORT/ICETOOL 11
No new posts REMOVE DUPLICATE RECORDS BASED ON A S... DFSORT/ICETOOL 4
No new posts Using sort on VB records based on off... DFSORT/ICETOOL 6
No new posts Inserting records into the empty segm... IMS DB/DC 1
Search our Forums:

Back to Top