Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10326
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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us