Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to retain duplicates in the o/p file using SPLICE opertr

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
obulisankar

New User


Joined: 03 May 2007
Posts: 20
Location: bangalore

PostPosted: Mon Sep 01, 2008 5:57 pm    Post subject: How to retain duplicates in the o/p file using SPLICE opertr
Reply with quote

Hi All,

I have two Input files both having same record length of 160. The common keys on which ICETOOL should compare these two files are not located in same column positions (i.e., On 1st file it is from 147 - 148 and on the second fil it is from 1 - 2). After comparison I want the matching records to be in one file and non matching records to be in other file. I also want to retain the duplicates of both matching and non-matching records in the output files.

Lets take the foll scenario:

Infile1 :
At positon 147-148 (binary)
10
10
10
10
10
20
30

Infile 2:
At positon 1-2 (binary)
10
25

The expected output files are:
OUTFILE1:
10
10
10
10
10

OUTFILE1:
20
30

The outfiles got with the following job are:
OUTFILE1:
10

OUTFILE2:
10
10
10
10
20
30

Below is the job i am currently using:
Code:

//STEP01   EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//QTR1FILE DD DSN=INFILE1,DISP=OLD
//RT7CLSCD DD DSN=INFILE2,DISP=OLD
//OUT1     DD DSN=OUTFILE1,
//            SPACE=(CYL,(10,10),RLSE),
//            DISP=(,CATLG,CATLG)
//OUT2     DD DSN=OUTFILE2,
//            SPACE=(CYL,(10,10),RLSE),
//            DISP=(,CATLG,CATLG)
//T1       DD DSN=&&T1,DISP=(MOD,PASS),UNIT=SYSDA,SPACE=(TRK,(5,5))
//TOOLIN   DD *
  COPY FROM(QTR1FILE) TO(T1) USING(CTL1)
  COPY FROM(RT7CLSCD) TO(T1) USING(CTL4)
  SPLICE FROM(T1) TO(OUT1) ON(147,2,BI) WITHALL -
  WITH(182,1) KEEPNODUPS  USING(CTL5)
/*
//CTL1CNTL DD *
* MARK FILE1 RECORDS WITH '11'
  OUTREC FIELDS=(1,160,181:C'11')
/*
//CTL4CNTL DD *
* MARK FILE2 RECORDS WITH '44'
  OUTREC FIELDS=(147:1,2,181:C'44')
/*
//CTL5CNTL DD *
* WRITE MATCHING RECORDS TO OUT12 FILE.  REMOVE ID.
  OUTFIL FNAMES=OUT1,INCLUDE=(181,2,CH,EQ,C'14'),OUTREC=(1,160)
* WRITE FILE1 ONLY RECORDS TO OUT1 FILE.  REMOVE ID.
  OUTFIL FNAMES=OUT2,INCLUDE=(181,2,CH,EQ,C'11'),OUTREC=(1,160)
/*
//OUT      DD SYSOUT=*
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Sep 01, 2008 11:22 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//QTR1FILE DD DSN=INFILE1,DISP=OLD
//RT7CLSCD DD DSN=INFILE2,DISP=OLD
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT1     DD DSN=OUTFILE1,
//            SPACE=(CYL,(10,10),RLSE),
//            DISP=(,CATLG,CATLG)
//OUT2     DD DSN=OUTFILE2,
//            SPACE=(CYL,(10,10),RLSE),
//            DISP=(,CATLG,CATLG)
//TOOLIN DD *
COPY FROM(RT7CLSCD) TO(T1) USING(CTL1)
COPY FROM(QTR1FILE1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT1) ON(147,2,BI) KEEPBASE KEEPNODUPS -
  WITHALL WITH(1,161) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(147:1,2,161:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(161:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT1,INCLUDE=(161,2,CH,EQ,C'VB'),
    BUILD=(1,160)
  OUTFIL FNAMES=OUT2,INCLUDE=(161,2,CH,EQ,C'VV'),
    BUILD=(1,160)
/*
Back to top
View user's profile Send private message
obulisankar

New User


Joined: 03 May 2007
Posts: 20
Location: bangalore

PostPosted: Tue Sep 02, 2008 3:34 pm    Post subject: How to retain duplicates in the o/p file using SPLICE opertr
Reply with quote

Thanks a lot Frank!!!!!! It was of great help. icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us