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!