×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

@

please help me to solve this problem, I am tring to call a cl program on AS/400 from Window platform, I used two methods, however, none of them works

method 1: I use addtrgPF to a file, which invoke the cl program, when a record is inserted in the file, the cl program is supposed to be invoked.

result 1: when I inserted a record to a file in AS400 platform , the CL program could be invoked properly, however, when the inserting is done from window platform, the record has been inserted into the file, however, the cl program can not be invoked. I tried two way to insert the record from window, one is to append member to that file, the other is to exactly using the SQL insert statement by using VB.

Method2: I called the stored procedure to call the cl program from windown platform by using VB, it does not work.
my part code is as following:
Report

Replies, comments and Discussions:

  • 工作学习 / 专业知识杂谈 / please help me to solve this problem, I am tring to call a cl program on AS/400 from Window platform, I used two methods, however, none of them works
    method 1: I use addtrgPF to a file, which invoke the cl program, when a record is inserted in the file, the cl program is supposed to be invoked.

    result 1: when I inserted a record to a file in AS400 platform , the CL program could be invoked properly, however, when the inserting is done from window platform, the record has been inserted into the file, however, the cl program can not be invoked. I tried two way to insert the record from window, one is to append member to that file, the other is to exactly using the SQL insert statement by using VB.

    Method2: I called the stored procedure to call the cl program from windown platform by using VB, it does not work.
    my part code is as following:
    • continue...
      Dim conn As Connection
      Dim cmd As Command
      Dim Stmt As String

      Set conn = New ADODB.Connection
      Set cmd = New ADODB.Command

      conn.Open "DSN=DOWNLOADS;Uid=***;PWD=***"
      cmd.CommandTimeout = 110
      cmd.ActiveConnection = conn

      'Stmt = "insert into yao.trgfile (addin) values('n')"
      Stmt = "CALL QSYS.QCMDEXC1 ('call yao/addlib', 0000000015.00000)"


      cmd.Prepared = True
      cmd.CommandText = Stmt
      cmd.Execute

      conn.Close
      Set cmd = Nothing
      Set conn = Nothing
    • continue..
      the insert statement works well, however the QSYS.QCMDEXC statement does not work, it is said "syntax error or access viloation"

      My questiones:

      Method1 : why I can not invoke the cl program from window platform even the record has been inserted?

      Method2: I could not figure out any syntax error from theshort statement, does it mean other further meaning?

      I appreciate any suggestion!
    • method1: check JOBD of default USRPRF used, make sure LIBL is correct
      • could you please explain that clearly? I do not use the *libl, when I did addpftrg command, I specified the file and invoked program in my library instead of *libl. do you mean I have to use the *libl
        • talk to sys admin if you have no authority to change it.
          • I can do that, however, I have not got your point, could you explain clearly? I very appreciate that.
            • every active job has USRPRF / JOBD / LIBL. look up SPLF in outq QEZJOBLOG