Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Search a particular value in another file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Search a particular value in another file
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

Site Director


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

PostPosted: Tue Sep 06, 2011 8:50 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Wed Sep 07, 2011 2:34 pm    Post subject: Reply to: Search a particular value in another file
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

Site Director


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

PostPosted: Wed Sep 07, 2011 8:13 pm    Post subject:
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 Moderator


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

PostPosted: Wed Sep 07, 2011 10:45 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us