如何使用SYNCSORT一步从两个输入文件中获取匹配和不匹配的记录?

发布于 2024-12-08 09:05:28 字数 258 浏览 1 评论 0原文

我有如下要求。

->我有 2 个输入文件 FILE1 和 FILE2。

->将匹配的记录写入FILE3。

->将 FILE1 中的不匹配记录写入 FILE4。

->将 FILE2 中的不匹配记录写入 FILE5。

两个输入文件中的关键位置是(1,10)。

任何人都可以让我知道排序卡吗?我如何在 SyncSort 中一步获得它?

提前致谢, 拉贾塞卡·詹努。

I have a requirement like below.

-> I have 2 input files FILE1 and FILE2.

-> Write the matching records into a FILE3.

-> Write the Non matching records from FILE1 into FILE4.

-> Write the Non matching records from FILE2 into FILE5.

The key position in both the Input Files is (1,10).

Can anybody please let me know the SORTCARD, how Can I get this in single step in SyncSort??

Thanks in Advance,
Rajasekhar Jannu.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

往事风中埋 2024-12-15 09:05:28
JOINKEYS FILE=F1,FIELDS=(01,10,A)
JOINKEYS FILE=F2,FIELDS=(01,10,A)
UNPAIRED F1,F2   <== This results in cartesian product
REFORM FIELDS=(F1:01,10,F2:01,10),FILL=C'

另请注意,由于您没有提及每个文件的长度,因此仅考虑了这两个文件的 10 个字节。

如果您没有找到可行的解决方案,还建议您搜索已知的大型机论坛并将其发布到此处。希望这有帮助

参考这个:
连接键指南

SORT FIELDS=(01,10,CH,A) OUTFIL FNAMES=03, INCLUDE=(01,01,CH,NE,C'

另请注意,由于您没有提及每个文件的长度,因此仅考虑了这两个文件的 10 个字节。

如果您没有找到可行的解决方案,还建议您搜索已知的大型机论坛并将其发布到此处。希望这有帮助

参考这个:
连接键指南

,AND,11,01,CH,NE,C'

另请注意,由于您没有提及每个文件的长度,因此仅考虑了这两个文件的 10 个字节。

如果您没有找到可行的解决方案,还建议您搜索已知的大型机论坛并将其发布到此处。希望这有帮助

参考这个:
连接键指南

) <== Matched Records OUTFIL FNAMES=04, INCLUDE=(01,01,CH,NE,C'

另请注意,由于您没有提及每个文件的长度,因此仅考虑了这两个文件的 10 个字节。

如果您没有找到可行的解决方案,还建议您搜索已知的大型机论坛并将其发布到此处。希望这有帮助

参考这个:
连接键指南

,AND,11,01,CH,EQ,C'

另请注意,由于您没有提及每个文件的长度,因此仅考虑了这两个文件的 10 个字节。

如果您没有找到可行的解决方案,还建议您搜索已知的大型机论坛并将其发布到此处。希望这有帮助

参考这个:
连接键指南

) <== Non-Matched Records from File1 OUTFIL FNAMES=03, INCLUDE=(01,01,CH,EQ,C'

另请注意,由于您没有提及每个文件的长度,因此仅考虑了这两个文件的 10 个字节。

如果您没有找到可行的解决方案,还建议您搜索已知的大型机论坛并将其发布到此处。希望这有帮助

参考这个:
连接键指南

,AND,11,01,CH,NE,C'

另请注意,由于您没有提及每个文件的长度,因此仅考虑了这两个文件的 10 个字节。

如果您没有找到可行的解决方案,还建议您搜索已知的大型机论坛并将其发布到此处。希望这有帮助

参考这个:
连接键指南

) <== Non-Matched Records from File2

另请注意,由于您没有提及每个文件的长度,因此仅考虑了这两个文件的 10 个字节。

如果您没有找到可行的解决方案,还建议您搜索已知的大型机论坛并将其发布到此处。希望这有帮助

参考这个:
连接键指南

JOINKEYS FILE=F1,FIELDS=(01,10,A)
JOINKEYS FILE=F2,FIELDS=(01,10,A)
UNPAIRED F1,F2   <== This results in cartesian product
REFORM FIELDS=(F1:01,10,F2:01,10),FILL=C'

Also, note that only 10bytes have been considered from both the files as you didnt mention the lengths of each file.

Also suggest you to search known mainframe forums and post it here if you dont get the working solution. Hope this helps

Refer this:
Joinkeys Guide

SORT FIELDS=(01,10,CH,A) OUTFIL FNAMES=03, INCLUDE=(01,01,CH,NE,C'

Also, note that only 10bytes have been considered from both the files as you didnt mention the lengths of each file.

Also suggest you to search known mainframe forums and post it here if you dont get the working solution. Hope this helps

Refer this:
Joinkeys Guide

,AND,11,01,CH,NE,C'

Also, note that only 10bytes have been considered from both the files as you didnt mention the lengths of each file.

Also suggest you to search known mainframe forums and post it here if you dont get the working solution. Hope this helps

Refer this:
Joinkeys Guide

) <== Matched Records OUTFIL FNAMES=04, INCLUDE=(01,01,CH,NE,C'

Also, note that only 10bytes have been considered from both the files as you didnt mention the lengths of each file.

Also suggest you to search known mainframe forums and post it here if you dont get the working solution. Hope this helps

Refer this:
Joinkeys Guide

,AND,11,01,CH,EQ,C'

Also, note that only 10bytes have been considered from both the files as you didnt mention the lengths of each file.

Also suggest you to search known mainframe forums and post it here if you dont get the working solution. Hope this helps

Refer this:
Joinkeys Guide

) <== Non-Matched Records from File1 OUTFIL FNAMES=03, INCLUDE=(01,01,CH,EQ,C'

Also, note that only 10bytes have been considered from both the files as you didnt mention the lengths of each file.

Also suggest you to search known mainframe forums and post it here if you dont get the working solution. Hope this helps

Refer this:
Joinkeys Guide

,AND,11,01,CH,NE,C'

Also, note that only 10bytes have been considered from both the files as you didnt mention the lengths of each file.

Also suggest you to search known mainframe forums and post it here if you dont get the working solution. Hope this helps

Refer this:
Joinkeys Guide

) <== Non-Matched Records from File2

Also, note that only 10bytes have been considered from both the files as you didnt mention the lengths of each file.

Also suggest you to search known mainframe forums and post it here if you dont get the working solution. Hope this helps

Refer this:
Joinkeys Guide

哥,最终变帅啦 2024-12-15 09:05:28
enter code here
//JOIN EXEC PGM=SORT 
//SORTJNF1 DD * 
1234567890 FILEB 
1234678901 FILE1 
/* 
//SORTJNF2 DD * 
1234567890 FILEB 
1234789012 FILE2 
/* 
//JNF1CNTL DD DUMMY             <=== not necessary(informatory)
//JNF2CNTL DD DUMMY             <=== not necessary(informatory)
//BOTH     DD DSN=<FILENAME>
//FILE1 DD DSN=<file name> 
//FILE2 DD DSN=<file name>
//SYSOUT DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SORTOUT DD SYSOUT=*           <=== we can see the JOIN output here(explanatory)
//SYSIN DD * 
 JOINKEYS FILE=F1,FIELDS=(1,10,A) 
 JOINKEYS FILE=F2,FIELDS=(1,10,A) 
 JOIN UNPAIRED,F1,F2 
 REFORMAT FIELDS=(F1:1,16,F2:1,16),FILL=C'@' 
 OPTION COPY 
 OUTFIL FNAMES=BOTH, 
 INCLUDE=(01,01,CH,NE,C'@',AND,17,01,CH,NE,C'@'),BUILD=(1,16)
 OUTFIL FNAMES=FILE1,
 INCLUDE=(01,01,CH,NE,C'@',AND,17,01,CH,EQ,C'@'),BUILD=(1,16)
 OUTFIL FNAMES=FILE2,
 INCLUDE=(01,01,CH,EQ,C'@',AND,17,01,CH,NE,C'@'),BUILD=(17,16)
 /*  

 //***** this REFORMAT output would be something like
 1234567890 FILEB1234567890 FILEB 
 1234678901 FILE1@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@1234789012 FILE2  
 //*********************************

FILL=C'@' 将字符“@”填充到 JOIN 操作产生的记录中,以便稍后在使用 INCLUDE 进行 Filter 时可以使用该填充字符

enter code here
//JOIN EXEC PGM=SORT 
//SORTJNF1 DD * 
1234567890 FILEB 
1234678901 FILE1 
/* 
//SORTJNF2 DD * 
1234567890 FILEB 
1234789012 FILE2 
/* 
//JNF1CNTL DD DUMMY             <=== not necessary(informatory)
//JNF2CNTL DD DUMMY             <=== not necessary(informatory)
//BOTH     DD DSN=<FILENAME>
//FILE1 DD DSN=<file name> 
//FILE2 DD DSN=<file name>
//SYSOUT DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SORTOUT DD SYSOUT=*           <=== we can see the JOIN output here(explanatory)
//SYSIN DD * 
 JOINKEYS FILE=F1,FIELDS=(1,10,A) 
 JOINKEYS FILE=F2,FIELDS=(1,10,A) 
 JOIN UNPAIRED,F1,F2 
 REFORMAT FIELDS=(F1:1,16,F2:1,16),FILL=C'@' 
 OPTION COPY 
 OUTFIL FNAMES=BOTH, 
 INCLUDE=(01,01,CH,NE,C'@',AND,17,01,CH,NE,C'@'),BUILD=(1,16)
 OUTFIL FNAMES=FILE1,
 INCLUDE=(01,01,CH,NE,C'@',AND,17,01,CH,EQ,C'@'),BUILD=(1,16)
 OUTFIL FNAMES=FILE2,
 INCLUDE=(01,01,CH,EQ,C'@',AND,17,01,CH,NE,C'@'),BUILD=(17,16)
 /*  

 //***** this REFORMAT output would be something like
 1234567890 FILEB1234567890 FILEB 
 1234678901 FILE1@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@1234789012 FILE2  
 //*********************************

FILL=C'@' pads the charecter '@' to the record produced by JOIN operation, so that this padded charecter can be used later at the time of Filter using INCLUDE

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文