My CL program is running CPYTOIMPF cmd & causes an SQL error

20 pts.
Tags:
CL programs
CPYTOIMPF
SQ999999
SQL error messages
Message Id: SQ999999 Error occurred in SQL Call Level Interface. A procedure call encountered an error. The error code is 10. When I F1 on the line in the job log and then F9 for details, I see this: From program QSQCLI in QSYS, module SQLSEA, procedure SQLSetEnvAttr at stmt 5793 and To program QCPEXPRT in QSYS, module QCPEXPRT, procedure Copy_The_Records at stmt 81. Function sequence error? What does this mean?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Not sure but we could use some additional info.
Can you run the command CPYTOIMPF on another file?
Are there any unusual column types in the file you’re attempting to copy? — ie: BLOG’s
Is there any crupt data in the file you’re attempting to copy?
What is the value for the TO STREAM file? Can you use CPYTOIMPF to send another file to this location?
What other parameters have you set in this command?
Thanks Phil

Phil,

I can run these CPYTOIMPF commands on a command line just like like my CL is doing and have no problem:

CPYTOIMPF FROMFILE(&RUNLIB/RPTSFILE *ALL) +
TOSTMF(‘/REPORTS/RNB/RPTSFILE.TXT’) MBROPT(*REPLACE) +
STMFCODPAG(*PCASCII) RCDDLM(*CRLF) +
DTAFMT(*FIXED)

CPYTOIMPF FROMFILE(&RUNLIB/RPTSFRMS *ALL) +
TOSTMF(‘/REPORTS/RNB/RPTSFRMS.TXT’) MBROPT(*REPLACE) +
STMFCODPAG(*PCASCII) RCDDLM(*CRLF) +
DTAFMT(*FIXED)
—————————————
Jasingle

So it fails in your CL in batch but not when you issue the command interactively.
If you call the CL interactively does it fail?
If not, you’re looking at authority or library list.
Authorities would include authority to /REPORTS/RNB/
and it might baulk if RPTSFILE.TXT or RPTSFRMS.TXT exist and were placed there with a different user.

Phil

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following