Skip to main content
Miguel Esteban Rodriguez Go
Participating Frequently
Apr 15, 2021 11:12 AM UTC

Triggers Universe - DOS Command Execute

Hi there,

I've been looking for a long time, how to execute the 'DOS' command in a trigger in Universe.
I have seen in some forum, that they indicated to add an 'H' in attribute 4, in the VOC DOS of the UV account.
I have tried this and it does not work, since when firing the trigger and executing the DOS command in the subroutine, I get this message:

Program "ED": pc = 744C, Verb "DOS" illegal when a transaction is active.
Program "ED": pc = 744C, Error performing trigger for "XXXXXXXX".
Failed to file "20451390" in file "XXXXXXXX". STATUS = 2

Has anyone had the same problem of being able to run Verb on triggers?

Thanks and best regards

------------------------------
Miguel Esteban Rodriguez Gonzalez
DataDealer Software España
------------------------------

    17 replies

    Jonathan Smith
    Rocketeer
    Apr 16, 2021 4:38 AM UTC
    Hi Jonathan,

    The truth is that I did not know about the existence of these indexed subroutines or aka fast triggers.

    If you can give me more information to know its functionality, I would be very grateful.

    Kind Regards,


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------
    Miguel,

    The subject of index-based subroutines is covered in the UniVerse System Description manual under the chapter for File Triggers for your reference.

    The principal for you would be this

    ....

    Create a dictionary on your file as below


    MIG.TEST
    0001 I
    0002 SUBR("MIG.INDEX.SUB")
    0003
    0004
    0005 10L
    0006 S


    >CREATE.INDEX MIG.FILE MIG.TEST NO.NULLS

    The MIG.INDEX.SUB will look like this

    SUBROUTINE MIG.INDEX.SUB(RTN.VAL)
    COMMON /MIG.SIB/ MIG.INIT, ...
    RTN.VAL = ""
    IF NOT(MIG.INIT) THEN
    *** Open Files to be used and stored in named common
    ....
    MIG.INIT = 1
    END
    *** Your Code
    ....
    RETURN
    END

    Regards,
    Jonathan

    ------------------------------
    Jonathan Smith
    UniData ATS and Principal Engineer
    Rocket Software
    ------------------------------
    Rocket Software - Senior Principal Technical Support Engineer - UniData ATS
    Miguel Esteban Rodriguez Go
    Participating Frequently
    Apr 16, 2021 4:55 AM UTC
    Miguel,

    The subject of index-based subroutines is covered in the UniVerse System Description manual under the chapter for File Triggers for your reference.

    The principal for you would be this

    ....

    Create a dictionary on your file as below


    MIG.TEST
    0001 I
    0002 SUBR("MIG.INDEX.SUB")
    0003
    0004
    0005 10L
    0006 S


    >CREATE.INDEX MIG.FILE MIG.TEST NO.NULLS

    The MIG.INDEX.SUB will look like this

    SUBROUTINE MIG.INDEX.SUB(RTN.VAL)
    COMMON /MIG.SIB/ MIG.INIT, ...
    RTN.VAL = ""
    IF NOT(MIG.INIT) THEN
    *** Open Files to be used and stored in named common
    ....
    MIG.INIT = 1
    END
    *** Your Code
    ....
    RETURN
    END

    Regards,
    Jonathan

    ------------------------------
    Jonathan Smith
    UniData ATS and Principal Engineer
    Rocket Software
    ------------------------------
    Thank you very much Jonathan.

    I had read the manual a thousand times and had not paid any attention to this point.

    This solution is great for me to do what I have in mind, since David's solution is very good too, but I have to have a phantom to launch the process every so often.


    Kind regards,


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------
    Henry Unger
    Participating Frequently
    Apr 16, 2021 12:10 PM UTC
    Hi Henry,

    The problem is that submitrequest in UV does not communicate correctly with many of the webservices that I have to invoke.

    In many of them, the communication returns in 3 or in other cases, it does not return the response from the webservice.

    For this reason, it has been more than two years since we have changed the communication engine in our application by invoking the cURL, with satisfactory results in 100% of the cases.

    It is a pending task for Rocket Software to improve the behavior of triggers, since they offer a high potential for the execution of processes that affect specific files.

    Thanks anyway for your comment.


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------
    Hi Miguel,

    The UniVerse fast trigger is a great solution.

    It is too bad that submitRequest did not work for you.

    Regarding cURL, there are things it can do that submitRequest cannot, so we developed a GCI library that links in libcurl so that all of its functionality is available to our applications.

    Henry

    ------------------------------
    Henry Unger
    President
    Pulsiam
    Encino CA United States
    ------------------------------
    DEAN ARMBRUSTER
    Participating Frequently
    Apr 19, 2021 10:05 AM UTC
    Hi David,

    I had not thought about it, but it is a great idea, since although the request has to be done in real time, I can leave the phantom scheduled to run in short intervals of time.

    Thanks David for clarifying a lot for me an alternative solution to the problem that triggers represent in UV.


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------
    Does UV have PAUSE/WAKE like UD?   We use tickler files often.  For those needing immediate action, the phantom process stores its pid in a file for other processes to access.  It uses PAUSE instead of SLEEP between iterations of the file it is watching.  The requesting process stores the item in the tickler file, then uses WAKE to signal the phantom it has something to do.  This allows longer sleep times for the phantom and it isn't constantly scanning the tickler file.

    ------------------------------
    DEAN ARMBRUSTER
    Ferguson Enterprises, LLC
    ------------------------------
    Miguel Esteban Rodriguez Go
    Participating Frequently
    Apr 19, 2021 10:31 AM UTC
    Does UV have PAUSE/WAKE like UD?   We use tickler files often.  For those needing immediate action, the phantom process stores its pid in a file for other processes to access.  It uses PAUSE instead of SLEEP between iterations of the file it is watching.  The requesting process stores the item in the tickler file, then uses WAKE to signal the phantom it has something to do.  This allows longer sleep times for the phantom and it isn't constantly scanning the tickler file.

    ------------------------------
    DEAN ARMBRUSTER
    Ferguson Enterprises, LLC
    ------------------------------
    Hi Dean,

    I don't think those instructions are for UV.

    Anyway, after testing the fast triggers through the indexed subroutine, it works perfectly for what I was looking for.

    Thanks for the info.


    Best Regards.

    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    INTERNATIONAL CONSULTANTS AND ASSOC
    ------------------------------
    David Green
    Inspiring
    Apr 19, 2021 3:36 PM UTC
    Does UV have PAUSE/WAKE like UD?   We use tickler files often.  For those needing immediate action, the phantom process stores its pid in a file for other processes to access.  It uses PAUSE instead of SLEEP between iterations of the file it is watching.  The requesting process stores the item in the tickler file, then uses WAKE to signal the phantom it has something to do.  This allows longer sleep times for the phantom and it isn't constantly scanning the tickler file.

    ------------------------------
    DEAN ARMBRUSTER
    Ferguson Enterprises, LLC
    ------------------------------

    Dean, that's genius!

     

    I will have to add that to my list of tools!  I did use PAUSE/WAKE once because I had to wait for phantom process to finish before I could continue.  So I share my PID with the phantom and put myself into PAUSE mode.  Then the phantom wakes me when it has finished processing.

     

    David Green

     


    Manu Fernandes
    Inspiring
    Feb 28, 2024 9:02 AM UTC
    Hi Miguel,

    The UniVerse fast trigger is a great solution.

    It is too bad that submitRequest did not work for you.

    Regarding cURL, there are things it can do that submitRequest cannot, so we developed a GCI library that links in libcurl so that all of its functionality is available to our applications.

    Henry

    ------------------------------
    Henry Unger
    President
    Pulsiam
    Encino CA United States
    ------------------------------

    hello Henri,

    I read your company develop GCI library that links libcurl . 

    Are you authorized to share your experience ? Please write me on private.

    with kind regards.



    ------------------------------
    Manu Fernandes
    ------------------------------