coecho
asked on
Call QSYS.QCDEXC from C#
I was able to run this successfully in the past -
CALL QSYS.QCMDEXC('SBMJOB CMD(CALL PGM(J09110Z) PARM(P09110Z FORECAST)) JOB(BDFORECAST) JOBQ(QPGMR) USER(FORECAST) INLLIBL(*JOBD)', 000000110.00000)
but now I'm getting the following error:
Error opening connectionERROR [HY000] [IBM][iSeries Access ODBC Driver][DB2 UDB]CPF1338 - Errors occurred on SBMJOB command.
Any ideas what could cause this error message when it worked before? Is this a type of permissions issue on DB2? Or a configuration issue? What port is DB2 going over for its connection? They closed down a bunch of ports here recently. I'm using the i5 Series ODBC client driver. Or - this there something wrong with the command I'm sending?
thanks for your help!
CALL QSYS.QCMDEXC('SBMJOB CMD(CALL PGM(J09110Z) PARM(P09110Z FORECAST)) JOB(BDFORECAST) JOBQ(QPGMR) USER(FORECAST) INLLIBL(*JOBD)', 000000110.00000)
but now I'm getting the following error:
Error opening connectionERROR [HY000] [IBM][iSeries Access ODBC Driver][DB2 UDB]CPF1338 - Errors occurred on SBMJOB command.
Any ideas what could cause this error message when it worked before? Is this a type of permissions issue on DB2? Or a configuration issue? What port is DB2 going over for its connection? They closed down a bunch of ports here recently. I'm using the i5 Series ODBC client driver. Or - this there something wrong with the command I'm sending?
thanks for your help!
string postCommand = @"CALL QSYS.QCMDEXC('SBMJOB CMD(CALL PGM(J09110Z) PARM(P09110Z FORECAST)) JOB(BDFORECAST) JOBQ(QPGMR) USER(FORECAST) INLLIBL(*JOBD)', 000000110.00000)";
try
{
using (OdbcCommand myCommand2 = new OdbcCommand(postCommand, myConnection))
{
if (myConnection.State == System.Data.ConnectionState.Closed)
{
myConnection.Open();
}
int iRows = myCommand2.ExecuteNonQuery();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("Error opening connection" + ex.Message);
return false;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Gary -
I was able to run the command on the green screen under a different account than I was trying to run the code under. It turns out, that the JDE User I was using on the ODBC connection string, had the user permissions changed so that it no longer has permissions to run the DB2 CMD.
Problem solved. Thanks for your help.
Lisa
I was able to run the command on the green screen under a different account than I was trying to run the code under. It turns out, that the JDE User I was using on the ODBC connection string, had the user permissions changed so that it no longer has permissions to run the DB2 CMD.
Problem solved. Thanks for your help.
Lisa
It sounded like something had changed. Glad you could track it down.
- Gary Patterson
- Gary Patterson
Hi coecho,
I'm almost sure that the comma between the command and the command length is not alowed, parameters in a as400 call are seperated by a space, not by a comma.
Regards,
Murph
I'm almost sure that the comma between the command and the command length is not alowed, parameters in a as400 call are seperated by a space, not by a comma.
Regards,
Murph
Sign onto the AS/400 in a green-screen session, preferably using the same profile that you use to submit the command. Manually submit the command. When the command failes, you can look at the detailed help (cursor on the error message, press F1) for a detailed explanation of the problem. It could be lots of things: