View previous topic :: View next topic
|
Author |
Message |
Vigneshwaran S Warnings : 1 New User
Joined: 10 Dec 2008 Posts: 60 Location: Chennai
|
|
|
|
Hi all,
I have two input file,
File 1:
Code: |
001 12345678
001 23456789
001 32145671
|
File 2:
Code: |
001 12345678
001 23456712
001 23456712
001 12342344
|
Required Output :
Code: |
001 23456712
001 23456712
001 12342344
|
i'm using this Icetool step,
Code: |
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
001 12345678
001 23456789
001 32145671
/*
//IN2 DD *
001 12345678
001 23456712
001 23456712
001 12342344
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(4,8,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(81:C'1')
/*
//CTL2CNTL DD *
INREC OVERLAY=(81:C'2')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'2'),
BUILD=(1,80)
/*
|
SUGGEST ME WHERE I'M GOING WRONG. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Please take some time and think about what we might need to help you.
What are the rules for the data being included into the required output file.
What are you actually getting in your output file. |
|
Back to top |
|
|
Vigneshwaran S Warnings : 1 New User
Joined: 10 Dec 2008 Posts: 60 Location: Chennai
|
|
|
|
HI all,
Sorry for not explaining the condition.
If the eight digit starting from Pos - 5 is present in file 2 but not in File 1. I need to write it to the output.
Even i have to write the duplicates if any ( Example 23456712 appears twice/thrice) in file 2 but not in file 1.I need to write it to the output.
Let me know if i'm confusing. |
|
Back to top |
|
|
lalitsharma_77
New User
Joined: 29 Nov 2007 Posts: 10 Location: Pune
|
|
|
|
Hi Vineshwaran,
I am not sure whether JOINKEYS PTF is installed in your shop or not. If yes then the following DFSORT job will give you the required result.
Code: |
//STEP010 EXEC PGM=SORT
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
001 12345678
001 23456789
001 32145671
/*
//SORTJNF2 DD *
001 12345678
001 23456712
001 23456712
001 12342344
/*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(5,8,A)
JOINKEYS FILE=F2,FIELDS=(5,8,A)
JOIN UNPAIRED,F2,ONLY
SORT FIELDS=(5,8,CH,D)
/*
|
Output::
Code: |
001 23456712
001 23456712
001 12342344
|
Thanks
Lalit |
|
Back to top |
|
|
Vigneshwaran S Warnings : 1 New User
Joined: 10 Dec 2008 Posts: 60 Location: Chennai
|
|
|
|
Hi lalit,
Sorry,JOINKEYS PTF is not installed in my system.
I'm still struck up with this |
|
Back to top |
|
|
Lijo
New User
Joined: 24 Aug 2008 Posts: 41 Location: Cochin
|
|
|
|
I am not sure if this can achieved using SELECT operator, but try this solution using SPLICE operator:
Code: |
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
001 12345678
001 23456789
001 32145671
/*
//IN2 DD *
001 12345678
001 23456712
001 23456712
001 12342344
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(5,8,CH) WITH(82,1) -
KEEPBASE KEEPNODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(81:C'11')
/*
//CTL2CNTL DD *
INREC OVERLAY=(81:C'22')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'22'),
BUILD=(1,80)
/* |
|
|
Back to top |
|
|
karisurya
New User
Joined: 02 Aug 2007 Posts: 64 Location: Bangalore
|
|
|
|
Yes Ligo solution should work.
Vigneshwaran,
Just for info if you had referred manuals under Icetool you might have easily found out solution your self. The requirement is explained as example there under SLICE subtopic.
Regards,
Surya |
|
Back to top |
|
|
Vigneshwaran S Warnings : 1 New User
Joined: 10 Dec 2008 Posts: 60 Location: Chennai
|
|
|
|
Hi all,
Yes Lijo Solution is working.
Yes Surya i jus now looking into a ICETOOL manual and i could see it.
May be i was breaking my mind to find solution using SELECT operation( Single Direction Thinking)
Thanks all fr postiong. |
|
Back to top |
|
|
|