×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

DECODE

DECODE

(OP)
Hi all!

I'd like to decode a field. I have to "translate" some values but for the rest where I don't have to do a decode I'd like WebFocus to take the original value.
Something like that:

DEFINE FILE XYZ
 NEW_FIELD/A10 = DECODE OLD_FIELD (A 'first'
                                   B 'second'
                                   ELSE OLD_FIELD);
END

Yet I guess there must be something wrong with the syntax because for all values of the OLD_FIELD which do not match A or B I have now one single value named OLD_FIELD.
However, what I wanted is that all the values that don't match A or B are displayed as they are stored in OLD_FIELD.

Does anybody know how to do this?

Eva

RE: DECODE

Try this:

WRK_FIELD/A10 = DECODE OLD_FIELD (A 'first'
                                  B 'second'
                                  ELSE 'xxx');
NEW_FIELD/A10 = IF WRK_FIELD IS 'xxx' THEN OLD_FIELD ELSE
                WRK_FIELD;

a DECODE does not return the value of a field.

HTH

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close