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 

To retrieve records which is common in both files

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


Joined: 26 May 2004
Posts: 16
Topics: 6

PostPosted: Fri Dec 03, 2004 5:06 am    Post subject: To retrieve records which is common in both files Reply with quote

Hi,

I have two files. The structure of the file is

1st file:

AAA 00 12.00
AAA 01 13.00
BBB 00 11.00
CCC 04 01.00
AAA 02 23.00
BBB 02 12.00

2nd file:

AAA
CCC
DDD


and the output file should have the records of first file, whose key should match with second file.

output file:

AAA 00 12.00
AAA 01 13.00
AAA 02 23.00
CCC 04 01.00

I tried in syncsort, but could not acheive the desired result.
Help needed.
_________________
Thanks,
Zelwaa

-what matters most is how u c urself!!!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Dec 03, 2004 6:07 am    Post subject: Reply with quote

Selvakumar,

Please search before posting. This has been discussed earlier. check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=11&highlight=match

Hope this helps...

Cheers

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


Joined: 26 May 2004
Posts: 16
Topics: 6

PostPosted: Fri Dec 03, 2004 6:46 am    Post subject: Reply with quote

Kolusu,

The above link does not help for this condition.

See the input file. The key is not unique in the first file. So it will not give the desired output as shown.

We can do that using cobol/sas.

But i want to know whether there is any option to do using syncsort/fileaid.
_________________
Thanks,
Zelwaa

-what matters most is how u c urself!!!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


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

PostPosted: Fri Dec 03, 2004 8:43 am    Post subject: Reply with quote

Selva,

The following link contains solutions for different types of input data. The one which contains no dups & the one which has dups.

http://www.mvsforums.com/helpboards/viewtopic.php?t=3121&highlight=match

Again, as kolusu said I just searched on the keyword "Match". Pls try to search. There are tons of questions especially on Matching records.

Hope this helps,

Thanks,
Phantom
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: Fri Dec 03, 2004 8:44 am    Post subject: Reply with quote

I just forgot to update something. The solutions posted in the link will work only for DFSORT or latest version of Syncsort. What version of syncsort do you have ?

Thanks,
Phantom
Back to top
View user's profile Send private message
Selvakumar
Beginner


Joined: 26 May 2004
Posts: 16
Topics: 6

PostPosted: Fri Dec 03, 2004 9:14 am    Post subject: Reply with quote

I dont have splice operator in the DFSORT utility. It is the old version.
How to find the version of the syncsort?
_________________
Thanks,
Zelwaa

-what matters most is how u c urself!!!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Dec 03, 2004 9:16 am    Post subject: Reply with quote

Selvakumar,

Run this job and look at the sysout of this job
Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD *         
TEST                     
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *         
   SORT FIELDS=COPY       
/*                       


The first line sysout tells you the version for syncsort

Hope this helps...

Cheers

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


Joined: 26 May 2004
Posts: 16
Topics: 6

PostPosted: Fri Dec 03, 2004 9:24 am    Post subject: Reply with quote

The first line shows
SYNCSORT FOR Z/OS 1.1DN TPF3A

is 1.1DN is the version?
_________________
Thanks,
Zelwaa

-what matters most is how u c urself!!!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Dec 03, 2004 10:01 am    Post subject: Reply with quote

Selvakumar,

You have the latest version of syncsort and it supports SPLICE operator. I assumed that your input file LRECL is 80 bytes and is of FB format.

Code:

//STEP0100 EXEC PGM=SYNCTOOL       
//TOOLMSG  DD SYSOUT=*             
//DFSMSG   DD SYSOUT=*             
//IN1      DD *                     
AAA                                 
CCC                                 
DDD                                 
//IN2      DD *                     
AAA 00 12.00                       
AAA 01 13.00                       
BBB 00 11.00                       
CCC 04 01.00                       
AAA 02 23.00                       
BBB 02 12.00                       
//T1       DD DSN=&T1,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(X,Y),RLSE)
//T2       DD DSN=&T2,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(X,Y),RLSE)
//T3       DD DSN=&T3,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(X,Y),RLSE)
//CON      DD DSN=&T1,VOL=REF=*.T1,DISP=(OLD,DELETE)           
//         DD DSN=&T2,VOL=REF=*.T2,DISP=(OLD,DELETE)           
//         DD DSN=&T3,VOL=REF=*.T3,DISP=(OLD,DELETE)           
//OUT      DD SYSOUT=*
//TOOLIN   DD *                                           
  COPY FROM(IN1) USING(CTL1)                               
  SELECT FROM(IN1) TO(T2) ON(1,3,CH) FIRSTDUP USING(CTL2) 
  COPY FROM(IN2) USING(CTL3)                               
  SPLICE FROM(CON) TO(OUT) ON(1,3,CH) WITHALL WITH(1,81) -
  USING(CTL4) KEEPNODUPS                                   
//CTL1CNTL DD *                                           
  OUTFIL FNAMES=T1,OUTREC=(1,80,C'22')                     
//CTL2CNTL DD *                                           
  OUTFIL FNAMES=T2,OUTREC=(1,80,C'XX')                     
//CTL3CNTL DD *                                           
  OUTFIL FNAMES=T3,OUTREC=(1,80,C'11')                     
//CTL4CNTL DD *                                           
  OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'12')             
/*                                                         


Hope this helps....

Cheers

kolusu


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


Joined: 26 May 2004
Posts: 16
Topics: 6

PostPosted: Sat Dec 04, 2004 1:00 am    Post subject: Reply with quote

It is working. Thankyou guys.
_________________
Thanks,
Zelwaa

-what matters most is how u c urself!!!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
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