0

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

1
  • Not real sure what that last sentence means. Please write it in english. Commented Mar 21 at 20:32

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

0
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))' 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.