IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT Seperating Matched & Unmatched Records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 12:49 pm
Reply with quote

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
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 363
Location: Earth

PostPosted: Wed Nov 29, 2006 6:22 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 7:39 pm
Reply with quote

Hey Subhasis ,

It wont work.
Please give me the solution in Syncsort.
Thanks for ur time
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Wed Dec 13, 2006 12:46 pm
Reply with quote

Hi All,

Would please any one give the solution using SYNCSORT?
Back to top
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Wed Dec 13, 2006 1:47 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Wed Dec 13, 2006 1:57 pm
Reply with quote

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
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Wed Dec 13, 2006 2:52 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Wed Dec 13, 2006 3:59 pm
Reply with quote

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
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Wed Dec 13, 2006 5:01 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Wed Dec 13, 2006 5:44 pm
Reply with quote

Hi Rajen,

I am getting same eror message. I think its not able to recognize JOINKEYS verb.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Dec 13, 2006 6:15 pm
Reply with quote

Could the three error messages be related to the three "*" lines?
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Wed Dec 13, 2006 6:35 pm
Reply with quote

just start the sysin card in column 2
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Wed Dec 13, 2006 6:38 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Thu Dec 14, 2006 10:22 am
Reply with quote

Hi acevedo,

I put like that only but its not working.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Dec 14, 2006 12:42 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Thu Dec 14, 2006 2:28 pm
Reply with quote

Hi acevedo,

Its showing SYNCSORT FOR Z/OS
Back to top
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Thu Dec 14, 2006 2:35 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Thu Dec 14, 2006 2:42 pm
Reply with quote

Hi Rajen ,

Its showing

Code:
SYNCSORT FOR Z/OS  1.4.0
Back to top
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Thu Dec 14, 2006 2:47 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1207
Location: Bangalore,India

PostPosted: Thu Dec 14, 2006 3:16 pm
Reply with quote

Hi Rajen,

I told u thats not working .
Back to top
View user's profile Send private message
Varun R

New User


Joined: 20 Dec 2006
Posts: 3
Location: Mumbai

PostPosted: Wed Dec 20, 2006 1:27 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Dec 20, 2006 6:34 pm
Reply with quote

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
View user's profile Send private message
Varun R

New User


Joined: 20 Dec 2006
Posts: 3
Location: Mumbai

PostPosted: Wed Dec 20, 2006 6:40 pm
Reply with quote

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
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Dec 28, 2006 7:20 pm
Reply with quote

yes, someone

acevedo wrote:
just start the sysin card in column 2



on the other hand... Varun R = guptae?
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Jan 02, 2007 1:37 pm
Reply with quote

just curiosity... I keep wondering about Varun R = guptae?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts how to keep unpaired records with REPRO. JCL & VSAM 9
No new posts Dataset size increase on adding 1 byt... DFSORT/ICETOOL 8
No new posts Removal of date value records DFSORT/ICETOOL 12
No new posts Concurrent writing records to VSAM fr... JCL & VSAM 9
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
Search our Forums:

Back to Top