I want to compare 2 sorted files on a particular field and write the matched records of the first file in the 3rd output file. how can I do it using jcl sort card and using join keys and reformat fields?
The sample files are
File A
123 rohan mumbai
234 sanu chennai
456 aaaa delhi
File B
123 d23 1234.60
345 d45 1456.90
456 d67 3456.00
output file
123 rohan mumbai
456 aaaa delhi
compare 2 sorted files
-
- Posts: 4
- Joined: Tue Mar 18, 2008 1:17 pm
- Skillset: cobol,jcl,ims db/dc,db2,cics
- Referer: internet
-
- Posts: 4
- Joined: Tue Mar 18, 2008 1:17 pm
- Skillset: cobol,jcl,ims db/dc,db2,cics
- Referer: internet
Re: compare 2 sorted files
//STEP0001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SAVEDD DD SYSOUT=*
//IN DD *
12345 RAM
12345 RAHUL
33333 SENTHIL
33333 SANTHOSH
33333 SARATH
78888 VENU
// DD *
12345 RAM
12345 RAMESH
21156 MAHESH
33333 SENTHIL
33333 SANTHOSH
33333 SENTHIL
78900 PRAKASH
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,5,CH) ON(7,8,CH) LASTDUP
//*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SAVEDD DD SYSOUT=*
//IN DD *
12345 RAM
12345 RAHUL
33333 SENTHIL
33333 SANTHOSH
33333 SARATH
78888 VENU
// DD *
12345 RAM
12345 RAMESH
21156 MAHESH
33333 SENTHIL
33333 SANTHOSH
33333 SENTHIL
78900 PRAKASH
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,5,CH) ON(7,8,CH) LASTDUP
//*
-
- Posts: 4
- Joined: Tue Mar 18, 2008 1:17 pm
- Skillset: cobol,jcl,ims db/dc,db2,cics
- Referer: internet
Re: compare 2 sorted files
charavind17 wrote:I want to compare 2 sorted files on a particular field and write the matched records of the first file in the 3rd output file. how can I do it using jcl sort card The sample files are
File A
123 rohan mumbai
234 sanu chennai
456 aaaa delhi
File B
123 d23 1234.60
345 d45 1456.90
456 d67 3456.00
output file
123 rohan mumbai
456 aaaa delhi
-
- Posts: 4
- Joined: Tue Mar 18, 2008 1:17 pm
- Skillset: cobol,jcl,ims db/dc,db2,cics
- Referer: internet
Re: compare 2 sorted files
see top one
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Sorted but want to print all discarded records
by Everlast » Thu Dec 30, 2021 1:28 am » in DFSORT/ICETOOL/ICEGENER - 1
- 2406
-
by sergeyken
View the latest post
Thu Dec 30, 2021 11:47 pm
-
-
-
Joining 2 vb files into vsam files ended error
by newbiemainframe » Thu Nov 12, 2020 7:59 am » in JCL - 1
- 1760
-
by NicC
View the latest post
Thu Nov 12, 2020 7:15 pm
-
-
-
compare substring in the same record
by samb01 » Mon Jun 12, 2023 1:08 pm » in DFSORT/ICETOOL/ICEGENER - 10
- 2903
-
by sergeyken
View the latest post
Tue Jun 13, 2023 11:04 pm
-
-
-
compare number lines of two dataset
by samb01 » Wed Nov 13, 2024 8:46 pm » in DFSORT/ICETOOL/ICEGENER - 6
- 2156
-
by sergeyken
View the latest post
Fri Nov 15, 2024 12:41 pm
-
-
- 3
- 1592
-
by sergeyken
View the latest post
Thu May 13, 2021 1:07 am