admin管理员组

文章数量:1402815

I'm trying to run the command from .NET C# using non-query SQL commands on the AS400.

CALL QSYS2.QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(/REPORTES/xxxxxx.PDF) STMFOPT(*REPLACE) WSCST(*PDF)', 0000000132.00000)

But when I run it, I get the following error:

SQL Status: 38501 Vendor Code: -443 Message: [CPF0006] Errors occurred in the command. Cause: If an incorrect length was passed in part of the command, other messages are issued as the erroneous part of the command is parsed. Recovery: .: See the messages listed above in the job log. Correct any errors and resubmit the command. Processing has been terminated because the highlighted statement did not complete successfully.

Enviar comentarios Paneles laterales Historial Guardado

I'm trying to run the command from .NET C# using non-query SQL commands on the AS400.

CALL QSYS2.QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(/REPORTES/xxxxxx.PDF) STMFOPT(*REPLACE) WSCST(*PDF)', 0000000132.00000)

But when I run it, I get the following error:

SQL Status: 38501 Vendor Code: -443 Message: [CPF0006] Errors occurred in the command. Cause: If an incorrect length was passed in part of the command, other messages are issued as the erroneous part of the command is parsed. Recovery: .: See the messages listed above in the job log. Correct any errors and resubmit the command. Processing has been terminated because the highlighted statement did not complete successfully.

Enviar comentarios Paneles laterales Historial Guardado

Share Improve this question edited Mar 21 at 19:39 jarlh 44.8k8 gold badges50 silver badges67 bronze badges asked Mar 21 at 19:24 raabsoftraabsoft 112 bronze badges 1
  • Not real sure what that last sentence means. Please write it in english. – jmarkmurphy Commented Mar 21 at 20:32
Add a comment  | 

3 Answers 3

Reset to default 0

You don't mention what release of IBM i OS you are running...

But assuming a supported (or even somewhat recent 7.1+) one, you do not need to pass along the command length any more.

CALL QSYS2.QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(/REPORTES/xxxxxx.PDF) STMFOPT(*REPLACE) WSCST(*PDF))'

However, passing the correct length as you've done originally should still work AFAIK.

You're going to need to look in the job log of the servicing job (that's handling the .NET connection) to see what prior messages were logged.

From SQL yo can try

CL: CALL QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(/REPORTES/xxxxxx.PDF) STMFOPT(*REPLACE) WSCST(*PDF)', 0000000132.00000);

I don't know C# but from interactive SQL (in ACS) this works

Finally, the solution was to enclose the TOSTMF parameter in a double apostrophe TOSTMF(''/REPORTS/xxxxxx.PDF'')
CALL QSYS2.QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(''/REPORTES/xxxxxx.PDF'') STMFOPT(*REPLACE) WSCST(*PDF))'

本文标签: sqlCALL QSYS2QCMDEXC AS400Stack Overflow