MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Syncsort Joinkeys

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
PaulPeplinski
Beginner


Joined: 17 Feb 2006
Posts: 11
Topics: 3

PostPosted: Wed May 23, 2007 4:44 pm    Post subject: Syncsort Joinkeys Reply with quote

I have two files with a one to many relationship where JOINKEYS inner join seems to be the ticket - except that two one-byte fields need to be set with constant values indicated with the "?" below. In this case I need "22" at location 53 of the output record and 2's are not in either record.

I imagine I could do the joinkeys first and then OUTREC them in (what is likely) a second pass. If that's the case I am probably defeating the purpose of trying to improve the performance of the current COBOL implementation (both CPU and runtime).

In this case each file is over 80 million records.

I assume this function needs the SORT FIELDS statement.

Code:
 JOINKEYS FILE=F1,FIELDS=(1,37,A),SORTED                           
 JOINKEYS FILE=F2,FIELDS=(1,37,A),SORTED                           
 REFORMAT FIELDS=(F2:41,9,F1:340,5,F2:54,5,F2:50,4,F2:1,9,F2:22,4,
    F2:26,7,F2:10,5,F2:15,2,F2:17,1,F1:202:1,?,?,F2:33,5)         
 SORT FIELDS=COPY                                                 


Paul
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Thu May 24, 2007 5:46 am    Post subject: Reply with quote

Quote:

In this case each file is over 80 million records.

PaulPeplinski,

Go with the cobol program.

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dz
Beginner


Joined: 02 Apr 2006
Posts: 26
Topics: 0

PostPosted: Thu May 24, 2007 8:50 am    Post subject: Reply with quote

You can do OUTREC in the same step, after the REFORMAT.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Thu May 24, 2007 8:52 am    Post subject: Reply with quote

Quote:

You can do OUTREC in the same step, after the REFORMAT.

dz,

Paul does not want another pass of the data.

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Thu May 24, 2007 10:58 am    Post subject: Reply with quote

Quote:

I imagine I could do the joinkeys first and then OUTREC them in (what is likely) a second pass.

PaulPeplinski,

This can be done with JOINKEYS and either INREC or OUTREC, and requires only a single pass of the data.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Thu May 24, 2007 11:42 am    Post subject: Reply with quote

Quote:

This can be done with JOINKEYS and either INREC or OUTREC, and requires only a single pass of the data.


INREC is supported with JOINKEYS? which version of syncsort supports it? I.e Can i have a seperate INREC statement for SORTJNF1 and another INREC statement for SORTJNF2 dd? Do you have an example?

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Thu May 24, 2007 12:38 pm    Post subject: Reply with quote

Kolusu,

SyncSort for z/OS 1.2 supports JOIN. JOIN processing logically replaces the reading of the SORTIN datasets. Other Phase 1 features, like INREC, INCLUDE, OMIT, and STOPAFT still can be used. While INCLUDE/OMIT can be specified on the JOINKEYS statement as well as a traditional INCLUDE/OMIT statement, INREC can modify a record created by the JOIN processing.

Here is the example you requested:
Code:
SYSIN :
   JOINKEYS FILES=F1,FIELDS=(1,5,A) 
   JOINKEYS FILES=F2,FIELDS=(1,5,A)
   REFORMAT FIELDS=(F1:1,20,F2:1,20)
   INREC FIELDS=(C'SAMPLE INREC',1,40)
   SORT FIELDS=COPY

_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Thu May 24, 2007 1:01 pm    Post subject: Reply with quote

amargulies,

I am aware of the INREC statement , but my question was to use seperate inrec for each SORTJNF DD.

something like this

Code:

   JOINKEYS FILES=F1,FIELDS=(1,5,21,8,A) 
   INREC F1=(1,20,SEQNUM,8,ZD,RESTART=(1,5),C'FILE1 FIELD')
   JOINKEYS FILES=F1,FIELDS=(6,5,21,8,A) 
   INREC F2=(1,20,SEQNUM,8,ZD,RESTART=(6,5),C'FIEL2 FIELD')


That is the simplest example. I wanted to use IFTHEN structures also

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Thu May 24, 2007 1:16 pm    Post subject: Reply with quote

Quote:
my question was to use seperate inrec for each SORTJNF DD
No... this is not possible now but anyting is possible in the future.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
PaulPeplinski
Beginner


Joined: 17 Feb 2006
Posts: 11
Topics: 3

PostPosted: Thu May 24, 2007 3:38 pm    Post subject: Reply with quote

Thank you. The job is set to go with the following control

Code:
JOINKEYS FILE=F1,FIELDS=(1,37,A),SORTED                           
JOINKEYS FILE=F2,FIELDS=(1,37,A),SORTED                           
REFORMAT FIELDS=(F2:41,9,F1:340,5,F2:54,5,F2:50,4,F2:1,9,F2:22,4,
   F2:26,7,F2:10,5,F2:15,2,F2:17,1,F1:202,1,F2:33,5)             
INREC FIELDS=(1,52,C'22',55,5,                                   
      C'                                            ')           
SORT FIELDS=COPY                                                 


REFORMAT grabs the fields I need in the output record, INREC formats it with the constant '22' in the middle and pads it with the 43 bytes of FILLER.
Test run looked right, except it gives

WER238I POTENTIALLY INEFFICIENT USE OF INREC

where I am trying to gain efficiency.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu May 24, 2007 3:42 pm    Post subject: Reply with quote

Thats nothing....Sort products gives you a warning when you try to increase the LRECL of the input file using INREC - bcas it has to process a much larger file than actual. That message is just an indication to use OUTREC or OUTFIL OUTREC to reformat records (whenever you can).

Thanks,
Phantom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group