Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - Need to write Unmatched records into another file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
KrishnaChaitanya

New User


Joined: 15 May 2007
Posts: 2
Location: chennai

PostPosted: Fri Jun 06, 2008 2:23 pm    Post subject: Syncsort - Need to write Unmatched records into another file
Reply with quote

Hi folks,
I have an input file say FILE1. I need to write matching records in one file (FILE2) and unmatched into another file(FILE3).
I want to use only SYNCSORT.

FILE1:

A1234B1111C1111
A2345B2343C4563
A5678B3234C2346
V2342G2342T2343
Y1343H2343U4554


FILE2 (Based on the INCLUDE condition that I have) will contain :
(include 1,1,EQ,CH'A',AND,6,1,,EQ,CH'B',AND,11,1,EQ,CH'C')
A1234B1111C1111
A2345B2343C4563
A5678B3234C2346

FILE3 SHUD CONTAIN
V2342G2342T2343
Y1343H2343U4554

Please help me out in this
Thanks in advance
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 06, 2008 8:33 pm    Post subject:
Reply with quote

Hello KrishnaChaitanya and welcome to the forums,

You should be able to do what you want using Syncsort JOIN and/or JOINKEYS.

There are several examples in the manual. There are also some topics in the JCL section of the forum (Syncsort topics are part of JCL - DFSORT is in the DFSORT section of the forum).
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Fri Jun 06, 2008 9:13 pm    Post subject:
Reply with quote

JOIN is used when you want matched/unmatched records from 2 separate input files. If I understand the OP, there is only 1 input file. Please correct me if I am wrong.

Based on the sample input records and the required output, it looks like this can be done with 2 simple outfils:
Code:

//STEP1  EXEC  PGM=SORT
//SORTIN DD *                                                       
A1234B1111C1111                                                     
A2345B2343C4563                                                     
A5678B3234C2346                                                     
V2342G2342T2343                                                     
Y1343H2343U4554                                                     
//SORTOF01 DD DSN=MATCHED
//SORTOF02 DD DSN=UNMATCHD                                       
//SYSOUT DD SYSOUT=*                                               
//SYSIN DD *                                                       
    SORT FIELDS=COPY                                               
    OUTFIL FILES=01,                                               
     INCLUDE=(1,1,CH,EQ,C'A',AND,6,1,CH,EQ,C'B',AND,11,1,CH,EQ,C'C')
    OUTFIL FILES=02,SAVE
/*

Please let me know if this does not give you the output you need.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Fri Jun 06, 2008 9:18 pm    Post subject:
Reply with quote

If you are running SyncSort for z/OS 1.3, you can simplify the INCLUDE statement as follows:
Code:
INCLUDE=(1,1,CH,EQ,L(C'A',C'B',C'C'))
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jun 07, 2008 2:52 am    Post subject: Reply to: Syncsort - Need to write Unmatched records into an
Reply with quote

Hi Alissa,

Good catch - i believe i mis-read what was needed icon_redface.gif

Have a great weekend icon_smile.gif

d
Back to top
View user's profile Send private message
KrishnaChaitanya

New User


Joined: 15 May 2007
Posts: 2
Location: chennai

PostPosted: Sun Jun 08, 2008 12:03 pm    Post subject: Thanks
Reply with quote

Thanks Alissa... Actually I found many posts with two input files and matchd and unmatchd output files, but not with one input and multiple output files.

Thanks again Alissa.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Wed Jun 11, 2008 5:13 pm    Post subject:
Reply with quote

Alissa,

Quote:
If you are running SyncSort for z/OS 1.3, you can simplify the INCLUDE statement as follows:
Code:

INCLUDE=(1,1,CH,EQ,L(C'A',C'B',C'C'))


I have a doubt here. In the above requirement, 'A', 'B' & 'C' are checked in 3 different positions and not in the same position - 1,1,CH.

How can we use the above simplified statement in this case?

Thanks,
Arun
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Jun 11, 2008 8:59 pm    Post subject:
Reply with quote

arcvns wrote:
Quote:
If you are running SyncSort for z/OS 1.3, you can simplify the INCLUDE statement as follows:
Code:

INCLUDE=(1,1,CH,EQ,L(C'A',C'B',C'C'))


I have a doubt here. In the above requirement, 'A', 'B' & 'C' are checked in 3 different positions and not in the same position - 1,1,CH.

How can we use the above simplified statement in this case?

I missed that. You are correct - I did a quick glance and assumed they were all 1,1. Please disregard my simplified INCLUDE statement.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us