Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Matching 2 files using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 13
Location: Makati City, Philippines

PostPosted: Tue Apr 29, 2008 8:39 am    Post subject: Matching 2 files using SYNCSORT
Reply with quote

I have 2 files

File 1 :

10001STUDENT1

FILE 2:

10001XXXXXXX

The output that i need is:

10001STUDENT1XXXXXXX

Question is: How can i do this using SYNCSORT?
Back to top
View user's profile Send private message
References
PostPosted: Tue Apr 29, 2008 8:39 am    Post subject: Re: Matching 2 files using SYNCSORT Reply with quote

Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1252
Location: Mumbai, India

PostPosted: Tue Apr 29, 2008 9:30 am    Post subject:
Reply with quote

Hi,

If I'm not mistaken this question is been answered recently, lemme check the link...

Here I got it..

http://www.ibmmainframes.com/viewtopic.php?t=30264&highlight=&sid=b86bfc0348d852462a3b6008ea6779fe

oops even the 'author' is same..oh the product is different.

Well, the same solution would work in SyncSort as well, try it; if You have some nasty output then please post the SYSOUT messages & the JCL used.
Back to top
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1252
Location: Mumbai, India

PostPosted: Tue Apr 29, 2008 10:02 am    Post subject:
Reply with quote

Hi,

Apologies, that's not the solution, You used very similar 'records' for the inputs, so I goofed up... icon_redface.gif

Please use the below JCL

Code:
//DFSORT  EXEC PGM=ICETOOL                                             
//TOOLMSG DD SYSOUT=*                                                 
//DFSMSG  DD SYSOUT=*                                                 
//IN1     DD *                                                         
10001STUDENT1                                                         
//IN2     DD *                                                         
10001XXXXXXX                                                           
//TMP1    DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA 
//OUT     DD sysout=*                                                 
//TOOLIN  DD *                                                         
  COPY FROM(IN1) TO(TMP1) USING(CPY1)                                 
  COPY FROM(IN2) TO(TMP1) USING(CPY2)                                 
  SPLICE FROM(TMP1) TO(OUT) ON(1,5,CH) WITH(14,7)                     
//CPY1CNTL DD *                                                       
  OUTREC FIELDS=(1:1,5,6:6,8,14:7X)                                   
/*                                                                     
//CPY2CNTL DD *                                                       
  OUTREC FIELDS=(1:1,5,14:6,7)                                         
/*                                                                     


Quote:
If I'm not mistaken
I was on mistake... icon_evil.gif
Back to top
View user's profile Send private message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 13
Location: Makati City, Philippines

PostPosted: Tue Apr 29, 2008 10:11 am    Post subject:
Reply with quote

Anuj D. wrote:
Hi,

Apologies, that's not the solution, You used very similar 'records' for the inputs, so I goofed up... icon_redface.gif

Please use the below JCL

Code:
//DFSORT  EXEC PGM=ICETOOL                                             
//TOOLMSG DD SYSOUT=*                                                 
//DFSMSG  DD SYSOUT=*                                                 
//IN1     DD *                                                         
10001STUDENT1                                                         
//IN2     DD *                                                         
10001XXXXXXX                                                           
//TMP1    DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA 
//OUT     DD sysout=*                                                 
//TOOLIN  DD *                                                         
  COPY FROM(IN1) TO(TMP1) USING(CPY1)                                 
  COPY FROM(IN2) TO(TMP1) USING(CPY2)                                 
  SPLICE FROM(TMP1) TO(OUT) ON(1,5,CH) WITH(14,7)                     
//CPY1CNTL DD *                                                       
  OUTREC FIELDS=(1:1,5,6:6,8,14:7X)                                   
/*                                                                     
//CPY2CNTL DD *                                                       
  OUTREC FIELDS=(1:1,5,14:6,7)                                         
/*                                                                     


Quote:
If I'm not mistaken
I was on mistake... icon_evil.gif



Hi,

Thanks for the reply..

Will this work for the following example? :

file 1:

10001STUDENT1
10002STUDENT2

file 2:

10001XXXXXXX

output file:
10001STUDENT1XXXXXXX
10002STUDENT2

Thanks!
Back to top
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1252
Location: Mumbai, India

PostPosted: Tue Apr 29, 2008 10:35 am    Post subject:
Reply with quote

Hi,

No, it will not; it would work with this type of input instead,

Code:
//IN1     DD * 
10001STUDENT1   
10002STUDENT2   
//IN2     DD * 
10001XXXXXXX   
10002XXXXXXX   


Well, you've posted the same question in DFSORT as well & this time I'm not goofing up.

P.S. : A mild suggestion, unless You've something specific to point out from the previous post, please don't "quote" the previous post, just reply it.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 183
Location: USA

PostPosted: Tue Apr 29, 2008 9:22 pm    Post subject:
Reply with quote

sprikitik,

Try this SyncSort job:
Code:
//SORT1 EXEC PGM=SORT               
//SORTJNF1 DD *                     
10001STUDENT1                       
10002STUDENT2                       
//SORTJNF2 DD *                     
10001XXXXXXX                         
//SORTOUT DD SYSOUT=*               
//SYSOUT DD SYSOUT=*     
//SYSIN DD *               
  JOINKEYS FILES=F1,FIELDS=(1,5,A)   
  JOINKEYS FILES=F2,FIELDS=(1,5,A)   
  JOIN UNPAIRED                     
  REFORMAT FIELDS=(F1:1,13,F2:6,7)   
  SORT FIELDS=COPY                   
/*

The following output is produced:
Code:
10001STUDENT1XXXXXXX 
10002STUDENT2         
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1