Need Help about SYNCTOOL
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 6
- Joined: Mon Mar 15, 2010 8:19 pm
Need Help about SYNCTOOL
Hi,
Here is my problem :
From theses files :
#FILE 1 (FB/80)
AAAAAAA-10-20
BBBBBBB-10-20
CCCCCCC-10-20
#FILE 2 (FB/80)
AAAAAAA-10-20
BBBBBBB-15-25
CCCCCCC-10-20
DDDDDDD-15-30
i want to obtain :
#RESULT (FB/80)
BBBBBBB-15-25
DDDDDDD-15-30
How can i get only datas from FILE 2 which are not in FILE 1 or modified in FILE 2 ?
Thank you for your Help !
Here is my problem :
From theses files :
#FILE 1 (FB/80)
AAAAAAA-10-20
BBBBBBB-10-20
CCCCCCC-10-20
#FILE 2 (FB/80)
AAAAAAA-10-20
BBBBBBB-15-25
CCCCCCC-10-20
DDDDDDD-15-30
i want to obtain :
#RESULT (FB/80)
BBBBBBB-15-25
DDDDDDD-15-30
How can i get only datas from FILE 2 which are not in FILE 1 or modified in FILE 2 ?
Thank you for your Help !
zouzoucoiffure,
The following DFSORT JCL will give you the desired results. Since both files are of the same lrecl and recfm we concatenate them with a header record $$$ which will differentiate the records from each file.
The following DFSORT JCL will give you the desired results. Since both files are of the same lrecl and recfm we concatenate them with a header record $$$ which will differentiate the records from each file.
Code: Select all
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
$$$
// DD DSN=Your input file1,DISP=SHR
// DD *
$$$
// DD DSN=Your input file2,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(81:ID=1))
SORT FIELDS=(1,7,CH,A),EQUALS
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(83:SEQNUM,1,ZD,RESTART=(1,7))),
IFTHEN=(WHEN=GROUP,BEGIN=(83,1,ZD,EQ,1),PUSH=(82:81,1,84:1,80))
OUTFIL BUILD=(1,80),
INCLUDE=(81,2,ZD,EQ,22,OR,(81,2,ZD,EQ,21,AND,1,13,CH,NE,84,13,CH))
//*
-
- Member
- Posts: 6
- Joined: Mon Mar 15, 2010 8:19 pm
Thank you skolusu for your quick answer,
but i didnt succeed to adapt your sample to my real script.
i gave you wrong informations because i thought it was easier to understand for you and also for me.
the real files are FB LRECL=3941, with an ID of 9 digits.
This is your code i tried to modify as i thought :
This is the result i got :
ABEND=S000 U0016 REASON=00000000 307
POTENTIALLY INEFFICIENT USE OF INREC
Do you have an idea ?
but i didnt succeed to adapt your sample to my real script.
i gave you wrong informations because i thought it was easier to understand for you and also for me.
the real files are FB LRECL=3941, with an ID of 9 digits.
Code: Select all
#FILE 1 (FB/3941)
----+----1----+----2----+----3----+--
000000001 aaaaaaaaaaaaaaaaaaaaaaaaa...
000000002 bbbbbbbbbbbbbbbbbbbbbbbbb...
000000003 ccccccccccccccccccccccccc...
#FILE 2 (FB/3941)
----+----1----+----2----+----3----+--
000000001 aaaaaaaaaaaaaaaaaaaaaaaaa...
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx...
000000003 ccccccccccccccccccccccccc...
000000004 ddddddddddddddddddddddddd...
#RESULT (FB/3941)
----+----1----+----2----+----3----+--
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx...
000000004 ddddddddddddddddddddddddd...
This is your code i tried to modify as i thought :
Code: Select all
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
$$$
// DD DSN=Input file 1,DISP=SHR
// DD *
$$$
// DD DSN=Input file 2,DISP=SHR
//SORTOUT DD DSN=Output file,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(400,50),RLSE),
// DCB=(RECFM=FB,LRECL=3941,BLKSIZE=27587)
//SYSIN DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(3942:ID=1))
SORT FIELDS=(1,9,CH,A),EQUALS
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(3944:SEQNUM,1,ZD,RESTART=(1,9))),
IFTHEN=(WHEN=GROUP,BEGIN=(3944,1,ZD,EQ,1),
PUSH=(3943:3942,1,3945:1,3941))
OUTFIL BUILD=(1,3941),
INCLUDE=(3942,2,ZD,EQ,22,OR,
(3942,2,ZD,EQ,21,AND,1,13,CH,NE,3945,13,CH))
//*
This is the result i got :
ABEND=S000 U0016 REASON=00000000 307
POTENTIALLY INEFFICIENT USE OF INREC
Do you have an idea ?
skolusu wrote:zouzoucoiffure,
The following DFSORT JCL will give you the desired results. Since both files are of the same lrecl and recfm we concatenate them with a header record $$$ which will differentiate the records from each file.
Code: Select all
//STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * $$$ // DD DSN=Your input file1,DISP=SHR // DD * $$$ // DD DSN=Your input file2,DISP=SHR //SORTOUT DD SYSOUT=* //SYSIN DD * INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(81:ID=1)) SORT FIELDS=(1,7,CH,A),EQUALS OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(83:SEQNUM,1,ZD,RESTART=(1,7))), IFTHEN=(WHEN=GROUP,BEGIN=(83,1,ZD,EQ,1),PUSH=(82:81,1,84:1,80)) OUTFIL BUILD=(1,80), INCLUDE=(81,2,ZD,EQ,22,OR,(81,2,ZD,EQ,21,AND,1,13,CH,NE,84,13,CH)) //*
Code: Select all
//SORTIN DD *
$$$
// DD DSN=Input file 1,DISP=SHR
// DD *
$$$
// DD DSN=Input file 2,DISP=SHR
-
- Member
- Posts: 6
- Joined: Mon Mar 15, 2010 8:19 pm
zouzoucoiffure,zouzoucoiffure wrote:Thank you skolusu for your quick answer,
but i didnt succeed to adapt your sample to my real script.
i gave you wrong informations because i thought it was easier to understand for you and also for me.
the real files are FB LRECL=3941, with an ID of 9 digits.
This is the result i got :
ABEND=S000 U0016 REASON=00000000 307
POTENTIALLY INEFFICIENT USE OF INREC
Do you have an idea ?
Yep I do have an idea. Your Error messages indicate you are using syncsort's SYNCTOOL, not DFSORT's ICETOOL. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort/SYNCTOOL.
-
- Member
- Posts: 6
- Joined: Mon Mar 15, 2010 8:19 pm
I tried with ICETOOL (=SYNCTOOL).
with theses files :
the result is
instead of :
Do you have an idea ?
Code: Select all
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=input file 1,DISP=SHR
// DD DSN=input file 2,DISP=SHR
//OUT DD DSN=output file,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(40,5),RLSE),
// DCB=(RECFM=FB,LRECL=750,BLKSIZE=27750)
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,750,CH) NODUPS
/*
with theses files :
Code: Select all
#FILE 1 (FB/750)
----+----1----+----2----+----3----+--
000000001 aaaaaaaaaaaaaaaaaaaaaaaaa...
000000002 bbbbbbbbbbbbbbbbbbbbbbbbb...
000000003 ccccccccccccccccccccccccc...
#FILE 2 (FB/750)
----+----1----+----2----+----3----+--
000000001 aaaaaaaaaaaaaaaaaaaaaaaaa...
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx...
000000003 ccccccccccccccccccccccccc...
000000004 ddddddddddddddddddddddddd...
Code: Select all
#RESULT (FB/750)
----+----1----+----2----+----3----+--
000000002 bbbbbbbbbbbbbbbbbbbbbbbbb... (from file 1)
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx... (from file 2)
000000004 ddddddddddddddddddddddddd... (from file 2)
Code: Select all
#RESULT (FB/750)
----+----1----+----2----+----3----+--
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx... (from file 2)
000000004 ddddddddddddddddddddddddd... (from file 2)
The record
has no duplicates, so why do you not want it in the output?
Maybe you need to look at selecting only records where the key occurs more than once, and then select the unique keys only once from that subset.
Code: Select all
000000002 bbbbbbbbbbbbbbbbbbbbbbbbb...
Maybe you need to look at selecting only records where the key occurs more than once, and then select the unique keys only once from that subset.
-
- Member
- Posts: 6
- Joined: Mon Mar 15, 2010 8:19 pm
Hi MrSpock,
my wish is to compare file 1 and file 2 in order to get only new lines or modified lines from file 2. unique keys is with 9 digits.
in File 1 :
in File 2 :
so i want to get new value :
Output :
am i answering to your question ?
my wish is to compare file 1 and file 2 in order to get only new lines or modified lines from file 2. unique keys is with 9 digits.
in File 1 :
Code: Select all
000000002 bbbbbbbbbbbbbbbbbbbbbbbbb...
Code: Select all
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx...
Output :
Code: Select all
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx...
-
- Member
- Posts: 6
- Joined: Mon Mar 15, 2010 8:19 pm
This works fine for me :
Result :
Best Regards.
Code: Select all
//SORT1 EXEC PGM=SORT
//SORTJNF1 DD *
000000001 AAAAAAAAAAAAAAAAAAAAAAAAA
000000002 BBBBBBBBBBBBBBBBBBBBBBBBB
000000003 CCCCCCCCCCCCCCCCCCCCCCCCC
/*
//SORTJNF2 DD *
000000001 AAAAAAAAAAAAAAAAAAAAAAAAA
000000002 XXXXXXXXXXXXXXXXXXXXXXXXX
000000003 CCCCCCCCCCCCCCCCCCCCCCCCC
000000004 DDDDDDDDDDDDDDDDDDDDDDDDD
/*
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,80,A)
JOINKEYS FILE=F2,FIELDS=(1,80,A)
JOIN UNPAIRED,F2,ONLY
SORT FIELDS=(1,9,CH,A)
/* FIN
Code: Select all
000000002 XXXXXXXXXXXXXXXXXXXXXXXXX
000000004 DDDDDDDDDDDDDDDDDDDDDDDDD
-
- Member
- Posts: 25
- Joined: Tue Apr 28, 2009 10:53 pm
- Location: USA
- Contact:
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page