View previous topic :: View next topic
|
Author |
Message |
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Hi All,
I need your help. I have two input files.find below.
Input file1:
123
456
789
Input File2:
GARS123
GRAS456
SARG789
So now using the the values of the first input file, i have to search whether these values are present in the second input file, if so the entire values from input file2 (For Ex : GARS123) need to be placed in output file.
Like wise needs to search for all the values in the input file1.
Hope the above issue is clear enough. |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
raj12vel,
Try this.....
Code: |
//SORT01 EXEC PGM=SORT
//SORTJNF1 DD *
123
456
789
//SORTJNF2 DD *
GARS123
GRAS456
SARG789
SARG890
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,3,A)
JOINKEYS FILE=F2,FIELDS=(5,3,A)
REFORMAT FIELDS=(F2:1,7)
SORT FIELDS=COPY
END
/*
|
Output:
Code: |
GARS123
GRAS456
SARG789
|
HTH. |
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Great. Working fine.
thnaks alot.
can i see the output in the new output file. If so, how to give the same in the code |
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
I got it. Thanks for your timed help. |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
glad that I could help |
|
Back to top |
|
|
|