View previous topic :: View next topic
|
Author |
Message |
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
Hi,
I need to compare to files and to create a file1 which will have recrds not found in file2 and vice versa. I ad referenced this topic in foum but was not able to get the desired o/p. Here is my code
Code: |
//STEP10 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
A
B
C
D
I
J
K
L
/*
/*
//IN2 DD *
A
B
C
D
E
F
G
H
/*
//T1 DD DSN=&&TEMP,DISP=(,PASS,DELETE),UNIT=SYSDA,
// RECFM=FB
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT1) ON(1,1,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(81:C'1')
/*
//CTL2CNTL DD *
INREC OVERLAY=(81:C'2')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT1,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,80)
/* |
I need o/p as
Code: |
File1:
I
J
K
L
File 2:
E
F
G
H |
but I am getting
Code: |
file 2:
A
B
C
D
E
F
G
H |
please let me know what mistake i have made.
regards,
rupesh gupta |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
A slight change will get you what you want:
Code: |
//STEP10 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
A
B
C
D
I
J
K
L
/*
/*
//IN2 DD *
A
B
C
D
E
F
G
H
/*
//T1 DD DSN=&&TEMP1,DISP=(MOD,DELETE),UNIT=SYSDA,
// RECFM=FB
//T2 DD DSN=&&TEMP2,DISP=(MOD,DELETE),UNIT=SYSDA,
// RECFM=FB
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(T2) ON(1,1,CH) NODUPS
SELECT FROM(T2) TO(OUT1) ON(1,1,CH) NODUPS USING(CTL3)
SELECT FROM(T2) TO(OUT2) ON(1,1,CH) NODUPS USING(CTL4)
/*
//CTL1CNTL DD *
INREC OVERLAY=(81:C'1')
//CTL2CNTL DD *
INREC OVERLAY=(81:C'2')
//CTL3CNTL DD *
INCLUDE COND=(81,1,CH,EQ,C'1')
//CTL4CNTL DD *
INCLUDE COND=(81,1,CH,EQ,C'2')
/* |
Garry. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Rupesh gullu,
If I ran the JCL as you provided I am indeed getting the desired results. You need to show us the DFSMSG sysout to see as to why to get wrong results.
Garry, You really don't need that many passes. OP's original JCL will indeed give the desired results |
|
Back to top |
|
|
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
Hi Gary,
I have got the desired o/p with your solution,but one thing I am not able to understand is that why use gave MOD as disp parameter.
Skolusu can you let me know how can I post te whole DFSMSG. Do you want the specific DFSMSG or the whole DFSMSG. Whole msg is quite big. I think i won't be able to paste the full one. I am still getting the wrong o/p with my way of soving it.
regards,
rupesh gupta |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Quote: |
the specific DFSMSG or the whole DFSMSG |
Start with what is on the screen.
Why not post the jes messages. |
|
Back to top |
|
|
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
Hi Skolusu
I have got the correct solution for the problem. I changed the Disp parameters from Disp=(,pass,delete) to Disp=(mod,pass) and has got the desired o/p without using extra CTL4.
Thanks all for your help
regards,
Rupesh Gupta |
|
Back to top |
|
|
chavansu
New User
Joined: 20 Nov 2008 Posts: 14 Location: California USA
|
|
|
|
I used the job given by rupesh gullu. But I am getting only OUT2 ain the sysout. but not OUT1. Also I want to use ALLDUPS option but it seems its not workin for this.
Please help |
|
Back to top |
|
|
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
hi chavansu,
For your temp file use disp as (mod,pass) I guess you will get correct ans.
Just try and let me know.
regards,
rupesh gupta |
|
Back to top |
|
|
chavansu
New User
Joined: 20 Nov 2008 Posts: 14 Location: California USA
|
|
|
|
Hi Rupesh,
It worked. Thanks ! |
|
Back to top |
|
|
|