IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Search a particular value in another file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ankita.maheswari11

New User


Joined: 20 Aug 2011
Posts: 10
Location: India

PostPosted: Tue Sep 06, 2011 7:09 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 06, 2011 8:50 pm
Reply with quote

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
View user's profile Send private message
ramsankar rajkumar

New User


Joined: 07 Jun 2011
Posts: 18
Location: Chennai, India

PostPosted: Wed Sep 07, 2011 2:08 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 07, 2011 2:34 pm
Reply with quote

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 icon_cool.gif

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 07, 2011 8:13 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Sep 07, 2011 10:45 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top