× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Silva

STRQRY runs the menu for working with Query/400 - I think you are confusing the various querying products on the iSeries. The answers you have received - they have assumed you are using SQL, not Query/400. When you use the word "queries", it is ambiguous, because there are 2 or 3 different ways to use that term on the iSeries
- Query/400 queries using query definitions,
- SQL using STRSQL to run the interactive SQL interface,
- query management queries, which are basically a way to encapsulate SQL statements in a runnable object,
- RUNSQLSTM, which executes non-SELECT statements in a script
- iSeries Navigator for running SQL

Now as to your problem - this solution will work in either Query/400 or SQL SELECT statement. The other suggestion, to use the CASE control statement, works only in SQL SELECT statements but has the advantage that you don't need this funky little file hanging around.

HTH
Vern

At 02:24 AM 9/14/2007, you wrote:

Content-class: urn:content-classes:message
Content-Type: multipart/related; boundary="----_=_NextPart_001_01C7F6A0.5413C282"; type="multipart/alternative"; x-avg-checked=avg-ok-3A808C8

Hi. How can I do that is AS/400 using the STRQRY

Obrigado,

Marco Silva

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jonathan Mason
Sent: sexta-feira, 14 de Setembro de 2007 1:02
To: 'Midrange Systems Technical Discussion'
Subject: RE: Query> if then else in queries.

Hi Marco

Create a second file to be used as a cross reference. It should just
have

two fields on each record, a FROMCODE and a TOCODE. Use DFU to add two
records to the file, one with a FROMCODE = '*' and a TOCODE = '1' and
another with a FROMCODE = ' ' and a TOCODE = 'N'.

In your query join file RECEIVED to this new cross reference file using
FROMCODE and the original code field from file RECEIVED as the join key.
Select field TOCODE for output in your report.

Hope it helps

Jonathan


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.