Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us