OPNQRYF’s MAPFLD

Tags:
Application development
AS/400
Data analysis
Database
IBM
IBM DB2
IBM Marketing Sound Off
Oracle
RPGLE
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

MAPFLD(@NEW ‘%max(A,B)’)

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following