Products Resources Support About Us

Rocket Software

I-Descriptor that call a Subroutine, that Execute a Count, in phantom mode, beautiful nightmare

Hello all !
I have worked on an idea and it works very well in my interactive session, but I had a surprise, then I tried to run my project from a phantom, non-interactive session, from outside my system (from the web).

I would like to have your ideas, if you have some, to find another way to reach my goal.

I have a file (SHOP) where is stored data about my stores. I have another file (VISITS), where is stored every customers visits. Each visits have a VISIT.DATE and VISIT.STATUS attributes, to allow us to know if the visitor is still there (active) or not.

I want an attribute in SHOP, to display how many visitors are actives for that store.
I have built a Subroutine, to use as I-DESC in SHOP. The way I use to get my result is:

CMD = 'COUNT VISITS WITH VISIT.DATE="24MAY19" AND WITH VISIT.STATUS="A" '
EXECUTE CMD CAPTURING CMD.RESULT

At that point, CMD.RESULT contains something like “27 records counted.” I use that OCONV to extract numeric chars:

FINAL.RESULT = OCONV(CMD.RESULT,"MCN")

When I print the value of FINAL.RESULT, I get “27”. It’s fantastic!

In SHOP file, I have added a new attribute, type I. It works well in my interactive session.

As soon as I try to access that attribute, from an external routine (web), it runs as a phantom, which can’t “output” the EXECUTE command, and can’t “capture” it to return as the subroutine result.

Do you have any ideas or hints to improve my method? Maybe you guys already had to solve that kind of issue.

Many thanks for your help, have a great day!

Need more information. UniData or UniVerse?

How are you having A web server calling a PHANTOM process?

If you have as Subroutine that generates the data you need, you can call it from Rocket U2 RESTFul Web Services.

You can also set up a Data Resource that does a query with the I-Type dictionary you described.

If you have a LOGIN proc on the account this can sometimes trip up PHANTOMs.

Hi everyone, thank you very much for answering. I am sorry I forgot to mention I am on UniVerse 11.2.5.

I have to admit that I’m not sure about the way the Web interact with the server, it works with a set of sockets and pools, maybe it’s already related with RESTful, I will investigate in the beginning of the week. I will also check the other U2 tools I have in my licensing pack.
In the same thinking, I really don’t know if the phantom starts with a login proc. We have some, but it’s ID linked with the user’s login code, it’s starts when the user login, to establish its environment. I could investigate if there is a specific proc/voc that is started for phantom tasks.

The best advice I could have at the moment would be another way to count another file, with some filters, from an I-Descriptor. If you have any clues, I would appreciate them. Just a reminder, they way I do it now, is certainly not the best one: I use the Execute function and retrieve the TCL output. I have a feeling that you guys, gurus, have faced that kind of challenge.

I might not use the right U2 solution to perform what I try to do. For the moment, I try to focus on the function that launch the count and allow an non-interactive session to retrieve the result.

That is something I really like in IT, and UV proves it again: All paths lead to Rome; in IT, there is multiple ways to get the same result :slight_smile:
That is something I appreciate about U2 packages, we can have multiple recipes to get a similar result, it’s a proof of its maturity and it’s possibilities!

Hi ! Just a quick word to tell you all I have found another way to hit my goal. I think using a subroutine within an I-Descriptor wasn’t compatible or the process behind wasn’t able to properly handle it. I don’t have any exact reason to tell you.

I hit my goal by using a much more simple way, using only Synonyms instead of I-Descriptor, and by staying in the same file I tried to inquire, instead of reaching another file. That simple method works well.

Thanks for your interest! Have a great day!