× 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 Marco

To generate the cross reference file you could use SQL's CREATE statement -
something along the following:

CREATE TABLE QGPL/XREF (FROMCODE CHAR (1 ) FOR SBCS DATA NOT NULL
WITH DEFAULT, TOCODE CHAR (1 ) NOT NULL WITH DEFAULT)

And then use the INSERT command to load the records:

INSERT INTO QGPL/XREF VALUES('*', '1')

INSERT INTO QGPL/XREF VALUES(' ', 'N')

Alternatively you could create a DDS member for the member and use the CRTPF
command to create the file and UPDDTA to insert the records:

A R XREFR
A FROMCODE 1
A TOCODE 1

CRTPF FILE(QTEMP/XREF) SRCFILE(EXAMPLES/QDDSSRC) SRCMBR(XREF)

UPDDTA FILE(QGPL/XREF)

All the best

Jonathan
-----Original Message-----
From: midrange-l-bounces+jonathan.mason=astradyne-uk.com@xxxxxxxxxxxx
[mailto:midrange-l-bounces+jonathan.mason=astradyne-uk.com@xxxxxxxxxxxx] On
Behalf Of Silva Marco
Sent: 14 September 2007 08:25
To: Midrange Systems Technical Discussion
Subject: RE: Query> if then else in queries.

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



-----Original Message-----

From: midrange-l-bounces@xxxxxxxxxxxx

[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Silva Marco

Sent: 14 September 2007 00:47

To: Midrange Systems Technical Discussion

Subject: Query> if then else in queries.



Hello,



I need your help once again.



I have to create a query, but in that in that query I have to create a

new field.



The condition is: in filed RECEIVED If I have this * I want that appears

1 (can be a digit and not a number) if the field is blank or has nothing

I want to appear N







Example:



*=1



'blank'=N







'blank' means that the field has nothing on it.







Is it possible?



Best Regards,

Marco










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.