Link to home
Start Free TrialLog in
Avatar of wendelina
wendelina

asked on

How to create a logical file with multiple select statements?

Hi,
I'm trying to create a logical file that selects records from the physical file based on two criteria - and the result is that I am getting matches for either scenario, but not both.  For example, I want all records with a D in one field and a 935 in the other.  When I compile the logical and view the results, I have all records that have  D in one field OR a 935 in the other.
Is there a way to add an "AND" to this select?
thanks
Avatar of Member_2_2484401
Member_2_2484401
Flag of United States of America image


This should do it ...

create view aNewLogicl as (
select *
from   deleteme
where  aField = 'D'
  and  aField2 = 935
)
 
HTH,
DaveSlash

Open in new window

Avatar of wendelina
wendelina

ASKER

Hi,
Thank you for the reply - but - I am seeking a DDS solution.  We have not moved into the SQL world on our 400 yet...but thank you!
Wendy
ASKER CERTIFIED SOLUTION
Avatar of Member_2_276102
Member_2_276102

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Solution was EXACTLY what we needed.  Haven't found this documented anywhere.  Results are just what is needed - thanks.
Wendy
Wendy:

Documentation for V5R4:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzakb/selectomit.htm

Read a page or two down the screen. Figures 1 & 2 show examples.

This can also be found in the various .PDFs for DDS. Page numbers might change slightly. The DDS .PDF for V5R2 has a similar section on pages 18 & 19 with figures 13 & 14. (Those are printed page numbers. The relative page numbers are 26 & 27 appararently.) The topic name is 'Select or omit field name'.

Tom
Thank you for the info.  That looks like a helpful link - I will add that to our documentation folder.
Wendy