Vignesh Sid
New User
Joined: 04 Sep 2017 Posts: 43 Location: India
|
|
|
|
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! |
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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. |
|