Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

Need Help about SYNCTOOL

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
zouzoucoiffure
Member


Joined: 15 Mar 2010
Posts: 6

Answer was approved by Question owner.
Useful Post
1 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Mar 15, 2010 8:26 pm    Post subject: Need Help about SYNCTOOL Reply with quote

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 !
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

skolusu
Member


Joined: 26 Jul 2008
Posts: 43

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Mar 15, 2010 9:03 pm    Post subject: Reply with quote

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:

//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))
//*

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
zouzoucoiffure
Member


Joined: 15 Mar 2010
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Mar 16, 2010 2:46 pm    Post subject: Reply with quote

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.

Code:

#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:

//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:

//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))
//*
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
MrSpock
Active Member


Joined: 27 Jun 2007
Posts: 273

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Mar 16, 2010 5:38 pm    Post subject: Reply with quote

Code:
//SORTIN   DD *                                                         
$$$                                                                     
//         DD DSN=Input file 1,DISP=SHR                         
//         DD *                                                         
$$$                                                                     
//         DD DSN=Input file 2,DISP=SHR


Are you attempting to concatenate a file that's FB,80 with a file that's FB,3941 with a file that's FB,80 with a file that's FB,3941?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
zouzoucoiffure
Member


Joined: 15 Mar 2010
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Mar 16, 2010 6:08 pm    Post subject: Reply with quote

Hello MrSpock ,

My both Input files are FB/3941, and i try to get also an output file in FB/3941.

Dont look back after my first messages with FB/80, it was just for the example, but it was not i was waiting for.

Thank you for your help.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
MrSpock
Active Member


Joined: 27 Jun 2007
Posts: 273

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Mar 16, 2010 6:38 pm    Post subject: Reply with quote

The reason I asked is because if I try what your code shows I also abend with:

ABEND=S000 U0063 REASON=00000000

unless I make sure that the two separator files with "$$$" match my two input files that are FB,3941.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
skolusu
Member


Joined: 26 Jul 2008
Posts: 43

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Mar 16, 2010 8:38 pm    Post subject: Reply with quote

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 ?


zouzoucoiffure,

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.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
zouzoucoiffure
Member


Joined: 15 Mar 2010
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Mar 17, 2010 2:36 pm    Post subject: Reply with quote

I tried with ICETOOL (=SYNCTOOL).

Code:

//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:

#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...


the result is

Code:

#RESULT (FB/750)
----+----1----+----2----+----3----+--
000000002 bbbbbbbbbbbbbbbbbbbbbbbbb...  (from file 1)
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx...  (from file 2)
000000004 ddddddddddddddddddddddddd...  (from file 2)


instead of :
Code:

#RESULT (FB/750)
----+----1----+----2----+----3----+--
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx...  (from file 2)
000000004 ddddddddddddddddddddddddd...  (from file 2)


Do you have an idea ?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
MrSpock
Active Member


Joined: 27 Jun 2007
Posts: 273

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Mar 17, 2010 4:21 pm    Post subject: Reply with quote

The record

Code:
000000002 bbbbbbbbbbbbbbbbbbbbbbbbb...


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.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
zouzoucoiffure
Member


Joined: 15 Mar 2010
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Mar 17, 2010 5:37 pm    Post subject: Reply with quote

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 :
Code:
000000002 bbbbbbbbbbbbbbbbbbbbbbbbb...

in File 2 :
Code:
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx...


so i want to get new value :

Output :
Code:
000000002 xxxxxxxxxxxxxxxxxxxxxxxxx...


am i answering to your question ?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
zouzoucoiffure
Member


Joined: 15 Mar 2010
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Mar 19, 2010 3:09 pm    Post subject: Reply with quote

This works fine for me :

Code:

//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                             


Result :
Code:

000000002 XXXXXXXXXXXXXXXXXXXXXXXXX
000000004 DDDDDDDDDDDDDDDDDDDDDDDDD


Best Regards.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Alissa Margulies
Member


Joined: 28 Apr 2009
Posts: 25
Location: USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Apr 16, 2010 1:46 am    Post subject: Reply with quote

The files will get sorted during JOIN processing. Since you are not changing the sort order, you can code SORT FIELDS=COPY.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
zos_tech@syncsort.com
201-930-8260
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 10:14 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & 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


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-4996.html