Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

&IBIMR_user how to change it's format from Integer to A6?


Emily Lee

Recommended Posts

We use "&IBIMR_user" to get the login user ID.

We will compare this login ID with a group of PIN pulled from the database.

The PIN from the database is A6, but the &IBIMR_user is integer, so they cannot be compared.

How do I fix the format of &IBIMR_user?

Thanks, Emily Lee WF Server is WF8207.28

Link to comment
Share on other sites

Hi Emily

What does your IF or WHERE test look like right now that doesn't work?

Are you in dialog manager (does your line start with a -)? For example does it say -IF &onething EQ &another thing or is it a WHERE test in a TABLE FILE command for example?

The easy route that might work for you is to remove your quote marks from around &IBIMR_user if you don't want to think of it as an alpha.

Dialog manager is a little different than working with TABLE FILE as far as how your variables will be thought of. Thus the question about what your code looks like when you're trying to compare.

There are things you can do to flip between formats like just using EDIT(&IBIMR_user) but to give you a good answer, we'd like to know where this comparison happens - in Dialog Manager code or in code like you'd see if a DEFINE FILE or TABLE FILE (FOCSTACK for you focus nerds who already know where I'm going with this question)?

Link to comment
Share on other sites

Hi Emily, I'm glad that worked for you.

Please be aware that an amper variables is stored as a string of characters, even if it looks like a number. So in your example, there is no need for it to convert from integer to alphanumeric.

If a numeric calculationn a Dialogue Manager -SET statement is performed the variable values are converted to numeric as needed to compete the calculation—the result is then stored as alphanumeric. For example:

-SET &VAR1 = '1';-SET &VAR2 = '2';-SET &VAR3 = &VAR1 + &VAR2;-SET &VAR4 = &VAR1 | &VAR2; -? &VAR

In the output you see:

image.png.f6223fcca67b5b1f1201f32862075a6c.png

Link to comment
Share on other sites

To expand a little on David's example,

Dialog Manager does have the idea of an Alpha or Numeric but it kind of decides on the fly what the actual data type is.

Check this out.

-SET &VAR1 = '1';-SET &VAR2 = '2';-SET &VAR3 = &VAR1 + &VAR2;-SET &VAR4 = &VAR1 | &VAR2 | '@'; -? &VAR-TYPE *********************************-TYPE VAR3 VALUE: &VAR3-TYPE VAR3 TYPE : &VAR3.TYPE-TYPE VAR4 VALUE: &VAR4-TYPE VAR4 TYPE : &VAR4.TYPE-TYPE *********************************

Notice that I altered the code for &VAR4 by also concatenating on an '@' sign. This flips what Dialog Manager thinks about the data type of this variable.

You can add on one of the &variable suffixes like .LENGTH or .TYPE to see extra info about the &variables. Here's what &VAR4.TYPE would show in my example above:

image.png.79ff49d676a6fcaa00c2790bf686eb8e.pngIn other words, you don't have to worry as much about datatypes in Dialog Manager as you do in the world of TABLE FILE etc... Datatypes are kind of fluid in Dialog Manager. You can hit problems here, but just remember that mostly, WebFOCUS is making up it's mind about the datatype dymanically as it's given values.

There used to be more to this in earlier releases, but we'll leave that as an esoteric history lesson that Art Greenhaus told me a long time ago.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...