View previous topic :: View next topic
|
Author |
Message |
mf_karthik
New User
Joined: 26 Jul 2005 Posts: 55
|
|
|
|
I have two input files first file has an input record length of 5 and the second file contains the record lenght of 80. I want to compare the two files if the record in the first file is present in the second file then I need the first 8 characters from the second file to a output.
example:
file 1:
file 2:
Code: |
AB123001
AB123002
AB123004
EF345001
CD456001
CD456002 |
OUTPUT:
Code: |
AB123001
AB123002
AB123004
CD456001
CD456002 |
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Sounds like a JOINKEYS operation. Did you already look into doing that? |
|
Back to top |
|
|
mf_karthik
New User
Joined: 26 Jul 2005 Posts: 55
|
|
|
|
Yes i tried using join but its not working |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Yes i tried using join but its not working |
and since it is friday, fortunately, most of us will soon not be working, also |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
and since it is friday |
pretty fast clocki over there
still thursday around here |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
OMG!, you are correct. wishful thinking on my part. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
mf_karthik wrote: |
Yes i tried using join but its not working |
And despite over six years as a member here, you've never learned that you should specify how it's "not working". A shame, that. |
|
Back to top |
|
|
mf_karthik
New User
Joined: 26 Jul 2005 Posts: 55
|
|
|
|
Any answers pls... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the first/second rule of forums is ...
do not solicit for answers
replying is on our own time and free of charge...
if You have time constraints a forum is not the best place to ask for help
the second/first is ..
learn to post properly, telling it did not work, does not help anybody
You will not get any answers until You provide something useful to work on |
|
Back to top |
|
|
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
Back to top |
|
|
mf_karthik
New User
Joined: 26 Jul 2005 Posts: 55
|
|
|
|
to:Akatsukami
its my mistake that not poting the syntax..if you are not willing to answer dont post anything which humilate others..its a open forum not yours.... |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
mf_karthik wrote: |
to:Akatsukami
its my mistake that not poting the syntax..if you are not willing to answer dont post anything which humilate others..its a open forum not yours.... |
If you are not willing to learn from your mistakes, don't post anything which wastes others' time. This forum is intended to provide aid to professionals, not soothing pap to spoiled children. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Any answers pls... |
Probably not until you post something worth using to help you. . .
Quote: |
its my mistake that not poting the syntax.. |
Yes, and you posted no explanation of the actual problem ("not working" is NOT the problem) and none of the informational messages presented by the run. . .
Quote: |
if you are not willing to answer dont post anything which humilate others.. |
When this is what it takes to teach . . .
Quote: |
its a open forum not yours.... |
Nor yours. . . If you do not like receiving that kind of reply, provide better posts. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
its my mistake that not poting the syntax.. |
I wonder in which direction some people neurons spin
after realizing that he made a mistake
by not posting the jcl used and I hope he meant also the result
why in &heaven did not post them instead of whining ??? |
|
Back to top |
|
|
rakesha.hg
Active User
Joined: 21 Mar 2008 Posts: 161 Location: bangalore
|
|
|
|
its a simple joinkeys operation.Try this sort card.
Code: |
//STEP01 EXEC SYNCSORT,REGION=4096K
//SORTJNF1 DD *
AB123
BC234
CD456
//SORTJNF2 DD *
AB123001
AB123002
AB123004
EF345001
CD456001
CD456002
//SORTOUT DD DSN=TSX1H.X1HRH.TSO.SORTOUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TSO,
// SPACE=(TRK,(100,10),RLSE)
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,5,A)
JOINKEYS FILE=F2,FIELDS=(1,5,A)
REFORMAT FIELDS=(F2:1,8)
SORT FIELDS=(1,5,CH,A)
|
hope this helps |
|
Back to top |
|
|
|