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
 

 

SYNCSORT Seperating Matched & Unmatched Records
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
guptae

Moderator


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

PostPosted: Wed Nov 29, 2006 12:49 pm    Post subject: SYNCSORT Seperating Matched & Unmatched Records
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    Post subject: Re: SYNCSORT Seperating Matched & Unmatched Records
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: 1187
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 7:39 pm    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Wed Dec 13, 2006 12:46 pm    Post subject:
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    Post subject: Re: SYNCSORT Seperating Matched & Unmatched Records
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: 1187
Location: Bangalore,India

PostPosted: Wed Dec 13, 2006 1:57 pm    Post subject:
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    Post subject: Re: SYNCSORT Seperating Matched & Unmatched Records
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: 1187
Location: Bangalore,India

PostPosted: Wed Dec 13, 2006 3:59 pm    Post subject:
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    Post subject: Re: SYNCSORT Seperating Matched & Unmatched Records
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: 1187
Location: Bangalore,India

PostPosted: Wed Dec 13, 2006 5:44 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Dec 13, 2006 6:15 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Thu Dec 14, 2006 10:22 am    Post subject:
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Thu Dec 14, 2006 2:28 pm    Post subject:
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    Post subject: Re: SYNCSORT Seperating Matched & Unmatched Records
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: 1187
Location: Bangalore,India

PostPosted: Thu Dec 14, 2006 2:42 pm    Post subject:
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    Post subject: Re: SYNCSORT Seperating Matched & Unmatched Records
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: 1187
Location: Bangalore,India

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

Hi Rajen,

I told u thats not working .
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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