View previous topic :: View next topic
Author
Message
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hi There,
I have two files lets Take file A & B. I want to put match record of these two file in third file let take the name C & Unmatch record in File D.
Length of fileA & B is 80 Bytes
File A
aaa123bbbbbb
aaa222bbbbbb
aaa333ccccccc
File B
aaa111bbbbbb
aaa222bbbbbb
aaa333ccccccc
File C
aaa222bbbbbb
aaa333ccccccc
File D
aaa123bbbbbb
Hope I explain it clearly.-
Back to top
subhasis_50 Moderator Joined: 09 Mar 2005Posts: 363 Location: Earth
Hi,
We are using DFSORT, so i am not sure it will work or not. Can you try once by changing the ICETOOL as SYNCTOOL in the following code.
Code:
//STEP0100 EXEC PGM=ICETOOL
//*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
AAA123BBBBBB
AAA222BBBBBB
AAA333CCCCCCC
/*
//IN2 DD *
AAA111BBBBBB
AAA222BBBBBB
AAA333CCCCCCC
/*
//T1 DD DSN=&T1,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS)
//T2 DD DSN=&T2,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS)
//INT DD DSN=*.T1,DISP=(OLD,PASS),VOL=REF=*.T1
// DD DSN=*.T2,DISP=(OLD,PASS),VOL=REF=*.T2
//FILEA DD SYSOUT=*
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
SORT FROM(INT) USING(CTL3)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,OUTREC=(1,80,C'1')
/*
//CTL2CNTL DD *
OUTFIL FNAMES=T2,OUTREC=(1,80,C'2')
/*
//CTL3CNTL DD *
OPTION EQUALS
SORT FIELDS=(1,13,CH,A)
SUM FIELDS=(81,1,ZD)
OUTFIL FNAMES=OUT,INCLUDE=(81,1,ZD,EQ,3),OUTREC=(1,80)
OUTFIL FNAMES=FILEA,INCLUDE=(81,1,CH,EQ,C'1'),OUTREC=(1,80)
/*
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hey Subhasis ,
It wont work.
Please give me the solution in Syncsort.
Thanks for ur time
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hi All,
Would please any one give the solution using SYNCSORT?
Back to top
Rajen New User Joined: 05 May 2005Posts: 61
Hi try this one.
First merge both input files.
Then use SUM FIELDS = (NONE),XSUM
With this all your matching records would in the file with DD name SORTXSUM and not matching(unique from both the file) would in the file with DD name SORTOUT
Structure of JCL is :-
//SORTIN DD DSN // This is ur merged input file
//SORTOUT DD DSN= // This file contains unique record.
//SORTXSUM DD DSN= // This dataset contains duplicate rec.
Let me know if it worked or not.
Thanks,
Rajen.
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hey Rajen,
I cant use the solution because file lay out are different.
Means fileA contain field1& 2 & 3
and FileB Contain field 1&2 &4
Back to top
Rajen New User Joined: 05 May 2005Posts: 61
Hi Guptae,
Try this one.
Its with SYNCSORT.
//STEP04 EXEC PGM=SYNCSORT
//SORTLIB DD DSN=SORTLIB,DISP=SHR
//SRTMSG DD SYSOUT=*
//SORTJNF1 DD *
aaa123bbbbbb
aaa222bbbbbb
aaa333ccccccc
//SORTJNF2 DD *
aaa111bbbbbb
aaa222bbbbbb
aaa333ccccccc
//SORTOUT DD DSN=MATCHED.DATASET,
// SPACE=(CYL,(30,30),RLSE),DISP=(,CATLG,CATLG)
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,12,A)
JOINKEYS FILES=F2,FIELDS=(1,12,A)
REFORMAT FIELDS=(F1:1,22,F2:1,12)
SORT FIELDS=(1,12,CH,A)
//
Here i have assumed that key for sorting start with 1st position and ends at 12th position. You can change the position of keys accordingly.
Let me know if it worked or not.
Thanks,
Rajen.
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hey Rajen,
Its not working
Code:
JOINKEYS FILES=F1,FIELDS=(1,12,A)
*
JOINKEYS FILES=F2,FIELDS=(1,12,A)
*
REFORMAT FIELDS=(F1:1,22,F2:1,12)
*
SORT FIELDS=(1,12,CH,A)
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Would u please elaborate REFORMAT FIELDS=(F1:1,22,F2:1,12)
Back to top
Rajen New User Joined: 05 May 2005Posts: 61
Hi Ekta,
I tried below jcl.
//STEP01 EXEC PGM=SYNCSORT
//SORTLIB DD DSN=YOUR.SORTLIB,DISP=SHR
//SRTMSG DD SYSOUT=*
//SORTJNF1 DD *
AAA123BBBBBB
AAA222BBBBBB
AAA333CCCCCCC
//SORTJNF2 DD *
AAA111BBBBBB
AAA222BBBBBB
AAA333CCCCCCC
//SORTOUT DD DSN=MYID000.MATCHED,DISP=OLD
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,6,A)
JOINKEYS FILES=F2,FIELDS=(1,6,A)
REFORMAT FIELDS=(F1:1,6,F2:1,6)
SORT FIELDS=(1,6,CH,A)
//
The output is as below:-
AAA222AAA222
AAA333AAA333
I guess earlier by mistake i had given you field from 1st position to 12th position and now its 1st position to 6th position (this will make ur key).
Let me know if it worked or not.
Thanks,
Rajen Patel.
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hi Rajen,
I am getting same eror message. I think its not able to recognize JOINKEYS verb.
Back to top
William Thompson Global Moderator Joined: 18 Nov 2006Posts: 3156 Location: Tucson AZ
Could the three error messages be related to the three "*" lines?
Back to top
acevedo Active User Joined: 11 May 2005Posts: 344 Location: Spain
just start the sysin card in column 2
Back to top
acevedo Active User Joined: 11 May 2005Posts: 344 Location: Spain
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000014 //SYSIN DD *
000015 JOINKEYS FILES=F1,FIELDS=(1,12,A)
000016 JOINKEYS FILES=F2,FIELDS=(1,12,A)
000017 REFORMAT FIELDS=(F1:1,22,F2:1,12)
000018 SORT FIELDS=(1,12,CH,A)
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hi acevedo,
I put like that only but its not working.
Back to top
acevedo Active User Joined: 11 May 2005Posts: 344 Location: Spain
which version of Syncsort is installed in your shop? search for it once you run the job... you should see something like SYNCSORT FOR Z/OS... or ask your systemers...
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hi acevedo,
Its showing SYNCSORT FOR Z/OS
Back to top
Rajen New User Joined: 05 May 2005Posts: 61
Hi Ekta,
It should be
Code:
SYNCSORT FOR Z/OS 1.2.0.1R
I dont know where you checked but i check in the SYSOUT of the job which uses SYNCSORT and it displayed me above line.
Can you please check once again and confirm?
Thanks,
Rajen Patel.
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hi Rajen ,
Its showing
Code:
SYNCSORT FOR Z/OS 1.4.0
Back to top
Rajen New User Joined: 05 May 2005Posts: 61
Hey Ekta,
In this the SYNCSORT which i have suggested should work.
Code:
//STEP01 EXEC PGM=SYNCSORT
//SORTLIB DD DSN=YOUR.SORTLIB,DISP=SHR
//SRTMSG DD SYSOUT=*
//SORTJNF1 DD *
AAA123BBBBBB
AAA222BBBBBB
AAA333CCCCCCC
//SORTJNF2 DD *
AAA111BBBBBB
AAA222BBBBBB
AAA333CCCCCCC
//SORTOUT DD DSN=MYID000.MATCHED,DISP=OLD
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,6,A)
JOINKEYS FILES=F2,FIELDS=(1,6,A)
REFORMAT FIELDS=(F1:1,6,F2:1,6)
SORT FIELDS=(1,6,CH,A)
//
Can you please try copy and paste the code i have given above.
I know its the same SYNCSORT i gave you earlier but this time i have given input in second column.
You just need to change SORTLIB name and SORTOUT dataset name(Replace MYID000 with your mainframe ID).
IT SHOULD WORK!!!! :-)
Thanks,
Rajen Patel.
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hi Rajen,
I told u thats not working .
Back to top
Varun R New User Joined: 20 Dec 2006Posts: 3 Location: Mumbai
Hi Even i am facing the same problem of no keywords found. My SYNCSORT does say
"SYNCSORT FOR Z/OS 1.2.1.0R U.S. PATENTS: 4210961, 5117495 "
So someone pls help as to how to do this merge. Even i have a similar assignment and i am comfused.
Back to top
William Thompson Global Moderator Joined: 18 Nov 2006Posts: 3156 Location: Tucson AZ
Varun R wrote:
My SYNCSORT does say
"SYNCSORT FOR Z/OS 1.2.1.0R U.S. PATENTS: 4210961, 5117495 "
My Syncsort manual has JOINKEYS and REFORMAT documented and the manual is for release 1.2
Back to top
Varun R New User Joined: 20 Dec 2006Posts: 3 Location: Mumbai
hey all
so sorry. Like someone said, i changed the control statements to the second column and things worked.
Thanks a lot
Back to top
acevedo Active User Joined: 11 May 2005Posts: 344 Location: Spain
yes, someone
acevedo wrote:
just start the sysin card in column 2
on the other hand... Varun R = guptae?
Back to top
acevedo Active User Joined: 11 May 2005Posts: 344 Location: Spain
just curiosity... I keep wondering about Varun R = guptae?
Back to top
Please enable JavaScript!