View previous topic :: View next topic
|
Author |
Message |
ankita.maheswari11
New User
Joined: 20 Aug 2011 Posts: 10 Location: India
|
|
|
|
There is a requirement in our project where there are two files, we have to pick a value from one flat file and search that value in another file, in case that value is found in the file we have to update a table.
Thanks,
Ankita |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Now start over and provide information someone can use to help you. . .
Post some sample input data (both files) as well as the output you want when this process is run. Mention the recfm and lrecl of all files. Post the "rules" for processing.
Is there a "key" in both fles that is the value to be compared. If not, you need to explain just what is to be compared.
Do you expect this process to actually update a table? |
|
Back to top |
|
|
ramsankar rajkumar
New User
Joined: 07 Jun 2011 Posts: 18 Location: Chennai, India
|
|
|
|
Hi
use below DFSORT control statements customised to your requirement
Code: |
JOINKEYS F1=IDLERR,FIELDS=(205,8,A)
JOINKEYS F2=IDLSAP,FIELDS=(6,8,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F2:1,249,F1:1,260)
SORT FIELDS=COPY
|
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
in case that value is found in the file we have to update a table.
|
well... I guess that no utility will provide the whole shebang
unless the only thing You need to generate is yes/no flag and execute a different step accordingly
rough logic
STEP1
run something to determine if a match is found,
-- if found exit with a <found> return code
-- else exit with a <not found> return code
STEP2
if RC = <found>
-- run some program
if RC = <not found>
-- run some other program
ELSE
-- run something to tell about a clobbered return code |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
When you start a topic, it is customary/proper to reply to questions asked and provide the information requested. . .
Are you using dfsort or some other sort product on your system?
There are different ways to do this in one process, but you need to provide the specifics. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Ankita,
You haven't provided enough information. Show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example. |
|
Back to top |
|
|
|