Emily Lee Posted October 26, 2022 Share Posted October 26, 2022 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 More sharing options...
Toby Mills Posted October 26, 2022 Share Posted October 26, 2022 Hi EmilyWhat 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 More sharing options...
Emily Lee Posted October 26, 2022 Author Share Posted October 26, 2022 Hi Toby, I use TABLE FILE command to compare the &IBIMR_user with PIN of ‘DQB_SUPER_USERS’ FOCUS table. TABLE FILE DQB_SUPER_USERS PRINT * WHERE PIN EQ &IBIMR_user ON TABLE HOLD END -RUN Emily Yee-Mei Lee Link to comment Share on other sites More sharing options...
David Beagan Posted October 26, 2022 Share Posted October 26, 2022 Just put quotes around the variable.TABLE FILE DQB_SUPER_USERSPRINT *WHERE PIN EQ '&IBIMR_user'ON TABLE HOLDEND-RUN Link to comment Share on other sites More sharing options...
Emily Lee Posted October 26, 2022 Author Share Posted October 26, 2022 David and Toby,Yes, that quotes work well. It easily converts the integer to Alphanumeric.thank you very much. Emily Link to comment Share on other sites More sharing options...
David Beagan Posted October 26, 2022 Share Posted October 26, 2022 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; -? &VARIn the output you see: Link to comment Share on other sites More sharing options...
Toby Mills Posted October 27, 2022 Share Posted October 27, 2022 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: In 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 More sharing options...
Emily Lee Posted October 27, 2022 Author Share Posted October 27, 2022 Toby, Thank you for the great examples. I will share with my group. Emily Yee-Mei Lee DCS/ODIS/DDEA/DMIRB Office Phone: (410) 966-7476 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now