Execute a job from a program - IBM AS400

This is a discussion on Execute a job from a program - IBM AS400 ; I am interfacing with AS/400 by using a client application C# and I can send standard SQL commands and queries, such as SELECT ... , INSERT ... , UPDATE ... etc In the AS/400 someone has defined a daily task ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Execute a job from a program

  1. Execute a job from a program

    I am interfacing with AS/400 by using a client application C# and I
    can send standard SQL commands and queries, such as SELECT ... ,
    INSERT ... , UPDATE ... etc

    In the AS/400 someone has defined a daily task [in a certain library]
    consisting in the execution of a query
    which regenerates a table.

    I need to execute that task from my program.

    What would be the SQL command to send to AS/400 to execute the same
    task programmatically?
    (I am programming a C# application and know nearly nothing about the
    as400 system).


    Thank you.

    -P

  2. Re: Execute a job from a program

    The SQL has DROP and CREATE TABLE statements that may be able to
    replace whatever the daily task is. There is also a /job scheduler/
    feature as part of the operating system which could be used to have the
    daily task completed on a schedule. Regardless....
    The SQL has a CALL statement, to execute a stored procedure. If the
    manner in which the task is activated is by a CL (command language)
    program or command, then simply pass that string in the following SQL
    CALL request:
    CALL QSYS.QCMDEXC ('command string', 00000000##.00000) /* where the
    ## are replaced by the digits that define the /command string/ length
    from 01 to 99 [as written above, ##=14]; if more than 99, then take
    another zero from the left to replace instead a ### with 001 to 999 */
    There are prettier ways to accomplish the above CALL, but that is I
    hope, the best method to get it done with as little complications as
    possible.

    Regards, Chuck
    --
    All comments provided "as is" with no warranties of any kind
    whatsoever and may not represent positions, strategies, nor views of my
    employer

    pamela fluente wrote:
    > I am interfacing with AS/400 by using a client application C# and I
    > can send standard SQL commands and queries, such as SELECT ... ,
    > INSERT ... , UPDATE ... etc
    >
    > In the AS/400 someone has defined a daily task [in a certain library]
    > consisting in the execution of a query which regenerates a table.
    >
    > I need to execute that task from my program.
    >
    > What would be the SQL command to send to AS/400 to execute the same
    > task programmatically?
    > (I am programming a C# application and know nearly nothing about the
    > as400 system).


  3. Re: Execute a job from a program

    On 23 Nov, 09:38, CRPence wrote:
    > The SQL has DROP and CREATE TABLE statements that may be able to
    > replace whatever the daily task is. There is also a /job scheduler/
    > feature as part of the operating system which could be used to have the
    > daily task completed on a schedule. Regardless....
    > The SQL has a CALL statement, to execute a stored procedure. If the
    > manner in which the task is activated is by a CL (command language)
    > program or command, then simply pass that string in the following SQL
    > CALL request:
    > CALL QSYS.QCMDEXC ('command string', 00000000##.00000) /* where the
    > ## are replaced by the digits that define the /command string/ length
    > from 01 to 99 [as written above, ##=14]; if more than 99, then take
    > another zero from the left to replace instead a ### with 001 to 999 */
    > There are prettier ways to accomplish the above CALL, but that is I
    > hope, the best method to get it done with as little complications as
    > possible.
    >
    > Regards, Chuck
    > --
    > All comments provided "as is" with no warranties of any kind
    > whatsoever and may not represent positions, strategies, nor views of my
    > employer
    >
    >
    >
    > pamela fluente wrote:
    > > I am interfacing with AS/400 by using a client application C# and I
    > > can send standard SQL commands and queries, such as SELECT ... ,
    > > INSERT ... , UPDATE ... etc

    >
    > > In the AS/400 someone has defined a daily task [in a certain library]
    > > consisting in the execution of a query which regenerates a table.

    >
    > > I need to execute that task from my program.

    >
    > > What would be the SQL command to send to AS/400 to execute the same
    > > task programmatically?
    > > (I am programming a C# application and know nearly nothing about the
    > > as400 system).- Nascondi testo tra virgolette -

    >
    > - Mostra testo tra virgolette -


    Thanks a lot Chuck,

    you have provided 2 ways which are both useful.
    Clearly if I can use the second way is better because I am not
    responsible
    for what the procedure actually does.

    I will try and let you know.

    Thank you very much for your help and kindness.

    -P

  4. Re: Execute a job from a program

    Your participation is welcome and encouraged here on this newsgroup.
    However I will inform that, if it is of interest to you, there is
    additionally, the newsgroup it.comp.as400 -- also [very] active.

    Regards, Chuck
    --
    All comments provided "as is" with no warranties of any kind
    whatsoever and may not represent positions, strategies, nor views of my
    employer

  5. Re: Execute a job from a program

    On 23 Nov, 19:54, CRPence wrote:
    > Your participation is welcome and encouraged here on this newsgroup.
    > However I will inform that, if it is of interest to you, there is
    > additionally, the newsgroup it.comp.as400 -- also [very] active.
    >
    > Regards, Chuck



    Thank you Chuck ,

    it's good to know that.

    Cheers,

    -P

  6. Re: Execute a job from a program

    > However I will inform that, if it is of interest to you, there is
    > additionally, the newsgroup it.comp.as400 -- also [very] active.


    We try to do our best :-)
    (with a little exception for some Friday afternoons ;-)


    > Regards, Chuck


    Thank you,
    regards
    Stefano P.

    --
    "Niuna impresa, per minima che sia,
    può avere cominciamento e fine senza queste tre cose:
    e cioè senza sapere, senza potere, senza con amor volere"
    [Anonimo fiorentino, XIV sec.]

    (togliere le "pinzillacchere" dall'indirizzo email ;-)

+ Reply to Thread