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
 

 

getting three output files out of JOINKEYs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
migusd

New User


Joined: 08 Aug 2014
Posts: 18
Location: USA

PostPosted: Mon Jun 05, 2017 11:30 pm    Post subject: getting three output files out of JOINKEYs
Reply with quote

Hello guys,
I have a couple of files that I am using as input for this small process.
Not sure it is important but the files have different record length and the key is positioned at different record location.
I would like to get three output files out of this sort.
however, I have not understood basically the JOIN statement.
I would like to get three output files
1) Unpaired records from infile 1.
2) Unpaired records from infile 2.
3) Paired records

So, the question is what should I change in Join Statement to create this three files?
here is what I got thus far. It is working fine creating the first two files.

Code:

  JOINKEYS FILE=F1,FIELDS=(10,07,A)           
  JOINKEYS FILE=F2,FIELDS=(07,07,A)           
  JOIN UNPAIRED,ONLY                         
  REFORMAT FIELDS=(F1:1,80,F2:1,25),FILL=X'FF'
  SORT FIELDS=COPY                           
  OUTFIL FILES=1,                             
   INCLUDE(81,1,BI,EQ,X'FF'),                 
   OUTREC=(1:1,80)                           
  OUTFIL FILES=2,                             
   INCLUDE(1,1,BI,EQ,X'FF'),                 
   OUTREC=(1:81,25)                           
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1737
Location: NY,USA

PostPosted: Tue Jun 06, 2017 12:33 am    Post subject:
Reply with quote

You could research it yourself next time.
Example 6 - Paired and unpaired F1/F2 records
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 18
Location: USA

PostPosted: Tue Jun 06, 2017 1:10 am    Post subject:
Reply with quote

and am I suppose to know I can apply DFSORT and SYNCSORT examples interchangeably, too?
Thanks anyway Rohit
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1737
Location: NY,USA

PostPosted: Tue Jun 06, 2017 1:13 am    Post subject:
Reply with quote

Quote:
and am I suppose to know I can apply DFSORT and SYNCSORT examples interchangeably, too?
yes because your site should give you a manual to look for and if they don't give you then you can give try as it hardly takes 1 minute to know if it supports or not and if you hit any issues then post it back for other solutions but usually SYNCSORT supports most of the DFSORT features and you will know that only if you do little research and try.
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 18
Location: USA

PostPosted: Tue Jun 06, 2017 1:24 am    Post subject:
Reply with quote

thank you for taking the time to respond, Rohit.
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 111
Location: Maryland

PostPosted: Wed Jul 12, 2017 1:46 am    Post subject:
Reply with quote

Since that time when the mentioned example was introduced an improvement has been done to SORT utility. So, that example can be simplified for clarity as follows.
Code:
* Control statements for JOINKEYS application
  JOINKEYS F1=INFILE1,           refer to the first DDNAME
           FIELDS=(1,10,A),
           SORTED,NOSEQCK
  JOINKEYS F2=INFILE2,           refer to the second DDNAME
           FIELDS=(7,10,A),
           SORTED,NOSEQCK
  JOIN UNPAIRED,F1,F2
  REFORMAT FIELDS=(F1:1,14,
                   F2:1,20,
                   ?)            indicator: '1', '2', or 'B'
* Control statements for main task (joined records)
  OPTION COPY
  OUTFIL FNAMES=F1ONLY,
         INCLUDE=(35,1,CH,EQ,C'1'),
         BUILD=(1,14)
  OUTFIL FNAMES=F2ONLY,
         INCLUDE=(35,1,CH,EQ,C'2'),
         BUILD=(15,20)
  OUTFIL FNAMES=BOTH,
         SAVE,                   everything not selected above yet
         BUILD=(1,14,
              /,15,20)
 END
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Jul 12, 2017 7:42 pm    Post subject:
Reply with quote

migusd wrote:
So, the question is what should I change in Join Statement to create this three files?
JOIN UNPAIRED,ONLY gives only the non-matching records from both the input data sets. If you change it to 'JOIN UNPAIRED' OR 'JOIN UNPAIRED,F1,F2', it would give you the matching records as well, besides the non-matching records.

As pointed out already, the match marker (?) is a better way of identifying if there is a match or not.

Use 'SORTED' in the JOINKEYS if you know for sure that the input data sets are already in sorted order of the keys. Use 'NOSEQCK' in the JOINKEYS if you don't want the sort product to validate the key sequence for you.

Good luck.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1232
Location: Israel

PostPosted: Thu Jul 13, 2017 12:31 pm    Post subject:
Reply with quote

Incidentally, SYNCTOOL ships with SYNCSORT, and most ICETOOL commands work there.
(Which is a good thing because there is no documentation for SyncTool)
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 7 Thu Jun 29, 2017 1:41 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am


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