Question

  Asked: Nov 7 2006   1:25 PM GMT
  Asked by: JohndeCoville


OPNQRYF's MAPFLD


AS/400, Application development, DB2 universal database, IBM Marketing Sound Off, RPGLE, Data analysis, IBM, Database, Oracle, DB2

I am trying to create an OPNQRYF and use MAPFLD.

I need to place conitionally one of two fields into ALPHANAME, I defined in MAPFLD.

These fields are conditionally placed as follows:
LNAME ===> ALPHANAME if LNAME is filled.
BUS_NAME==> ALPHANAME if LNAME is blank

APHANAME is defined this way in MAPFLD.

I would be grateful for any suggestions.

Thank you in advance,

--John

We are on V5R2 and OPNQRY sits on one physical file. I need to create/derive a new column if if/boolean or case logic. i sthat possible?

Let's call the deired column/field: @NEW.

If field A is filled set @NEW = A
If Field B is filled set @NEW = B

( making this real simple. A & B are not filled at the same time)

Thanks in advance if you have information on OPNQRYF

thanks,

--John

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



MAPFLD(@NEW '%max(A,B)')
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400, Development and Database.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register