View previous topic :: View next topic
|
Author |
Message |
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
Hi,
I have two datasets and below are the details:
Datset1:
Record lenght: 2119
Dataset2:
Record lenght:10
I want to replace the contents of columns 22 to 31 of Dataset1 with Dataset2's data.Remaining data in the Dataset1 should remain same.Can you please let me know how to achieve this with DFSORT/ICETOOL? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
How many records on Dataset2?
If more than one, how do they match to Dataset1?
We assume Fixed-length records? |
|
Back to top |
|
|
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
Hi Bill,
Record count of both datasets is same and they are Fixed-lenght.I don't have any matching records that is the problem here.I just want to replace the columns 22 to 31 of Dataset1 with 1-10 columns of dataset2. |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
Hello pullaiah,
Here is the approach
1. Add sequence numbers to both the input files.
2. Use Joinkeys to match upon the sequence number and reformat the fields to include your column from file2 to file1. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
So you have a one-for-one relationship between the two files (no key stuff).
Whilst the sort wizards are having their tea/coffee and biscuits, why don't you look up the word "cartesian" in your sort manual. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
try this,
Code: |
//JOINS EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=DATASET1-LRECL2119,DISP=SHR
//IN2 DD DSN=DATASET2-LRECL10,DISP=SHR
//SORTOUT DD DSN=OUTPUT-DATASET,DISP=OLD
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(2120,8,A),SORTED,NOSEQCK
JOINKEYS F2=IN2,FIELDS=(11,8,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,21,F2:1,10,F1:32,2088)
OPTION COPY
/*
//JNF1CNTL DD *
INREC OVERLAY=(2120:SEQNUM,8,BI)
/*
//JNF2CNTL DD *
INREC OVERLAY=(11:SEQNUM,8,BI)
/* |
P.S Tested with 80 LRECL datasets. |
|
Back to top |
|
|
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
Hi Vasanth,
I have used the given code but below error
JOINKEYS STATEMENT: SYNTAX ERROR
JOINKEYS STATEMENT: SYNTAX ERROR
Please check once |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
as usual you forgot to tell ..
what <SORT> product You are using and it' s <level> (version/release)
run this job and POST the results
Code: |
****** ***************************** Top of Data ******************************
000001 //SORTLEVL JOB NOTIFY=&SYSUID,
000002 // MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X
000003 //*
000004 //S1 EXEC PGM=SORT
000005 //SYSOUT DD SYSOUT=*
000006 //SORTIN DD *
000007 DUMMY
000008 //SORTOUT DD SYSOUT=*,
000009 // DCB=(RECFM=FB,LRECL=80)
000010 //SYSIN DD *
000011 OPTION COPY
****** **************************** Bottom of Data ****************************
|
so that people willing to help might post a solution compatible wit Your sort <level>
if Your <level> of <SORT> does not provide JOINKEY functionality
search the forums. there are solution using ICETOOL and SPLICE |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
or is possibly syncsort |
|
Back to top |
|
|
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
We are using SYNCSORT FOR Z/OS 1.3.2.1R in our shop, I ran many jobs with JOINKEYS option and didn't find any difficulty earleir.Amy I getting above error only bacause of SORT version? Please calrify. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
why don' t You check Yourself ???
Quote: |
Amy I getting above error only bacause of SORT version? Please calrify. |
we have nothing to clarify
You asked a question, You were given a good answer.
You whined that id did not work without giving any other explanation
since many of the question related to JOINKEY are due to the sort <level>
asking about it is the fastest way to avoid wasting time
You are getting the error because...
how in h311 could we know
the reason is that you made some error in implementing the suggestion given amen
if You want good answers learn to post good questions |
|
Back to top |
|
|
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
Code:
Code: |
//STEP01 EXEC PGM=SORT
//IN1 DD DSN=TCORP01.BETA02.BETA.TRADE.G0003V00,DISP=SHR
//IN2 DD DSN=TCORP01.BETA.ACCOUNT.SORT.TEST6,DISP=SHR
//SORTOUT DD DSN=TCORP01.BETA02.BETA.TRADE(+1),
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=2119)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(2120,8,A),SORTED,NOSEQCK
JOINKEYS F2=IN2,FIELDS=(11,8,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,21,F2:1,10,F1:32,2088)
OPTION COPY
/*
//JNF1CNTL DD *
INREC OVERLAY=(2120:SEQNUM,8,BI)
/*
//JNF2CNTL DD *
INREC OVERLAY=(11:SEQNUM,8,BI)
/*
|
I have checked everything in my code and couldn't find any error.I don't what's wrong with the above code,that's why I asked your help to resolve it.Please help me on this. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
I ran many jobs with JOINKEYS option and didn't find any difficulty earleir |
hard to believe
if You had we would not be here wasting time
what about looking at one of the jobs You were using and investigate the differences
since You posted in the dfsort forum You were give a dfsort solution
while providing the same functionalities the two products differ in some keywords
so start doing a bit of the work You are getting paid for
search the forums for JOINKEYS and specify to search only the JCL forum
the answer is there waiting to be picked up,
I checked an the error is evident
no reason for You not to be able to do it Yourself
but naturally You are too <any adjective of Your choice> to try
edited to add ...
topic moved where it belongs |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
The solution vasanth provided is for DFSORT.
Since you are using SYNCSORT and it does not support JNF1CNTL, JNF2CNTL and NOSEQCK parameters. So you need to split the single step into three steps
1. Add sequence number to file1
2. Add sequence number to file 2
3. Match using the join keys and reformat the ouput
Similar kind of requirement is solved using syncsort here |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
why don't you look up the word "cartesian" in your sort manual. |
TS is not looking for a cartesian product. . . Just a one-for-one combination process. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Whoops...
Thanks Dick, mouth running-off at the shoulder (or point further south). |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Bill,
Not to worry . . .
I sometimes suffer from the same afflicton and am thankful whan someone lets me know.
d |
|
Back to top |
|
|
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
Hi kratos,
I got the required output by following your steps,thanks a lot.
Thank you all for your valuable suggestions and will keep this in mind when I post anything next time. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear you have something working - thank you for letting us know
Someone will be here when there are new questions. . .
d |
|
Back to top |
|
|
|