Operation not allowed in a job running multiple threads from SQL RPGLE

305 pts.
Tags:
AS/400
IBM iSeries
RPG
RPGLE
Hi, I am running SQLRPGLE on V7R1. The program takes entries from file and emails. The program on high level does following steps..........: 1. Fetch Record from File, ............ 2. Convert Spool file to PDF and puts into IFS, into Root/Folder1, ......... 3. Copies PDF file from Root/Folder1 to QDLS/Folder1 using command CPY, ....... 4. Send PDF file using SNDDST from QDLS/Folder1, .......... 5. Deletes PDF File from QDLS/Folder1............ Repeat these for all the records available in Input File........... No CL Program is used. All the above items are done from SQLRPGLE using QCMDEXC.... The program many times fails while executing command CPY with following error..... Msg Id: CPFA0A8, Operation not allowed in a job running multiple threads......... I run this program in Batch and the batch job is submitted with option ALWMLTTHD(*NO). I get this error even I use THREAD(*SERIALIZE) in my RPGLE....... Why program runs in multi thread ? Can any one provide reason and solution to this? ----------------- Thanks Reddy

Software/Hardware used:
OS400 V7R1M0

Answer Wiki

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

Discuss This Question: 6  Replies

 
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
  • TomLiotta
    Why program runs in multi thread ?   We can't tell because you didn't show us how you run the program nor how the program is coded.   2. Convert Spool file to PDF...   What spool file? Where did it come from? How does any spooled file relate to the SQL program? How is the .PDF conversion done?   3. Copies PDF file from Root/Folder1 to QDLS/Folder1... and 4. Send PDF file using SNDDST...   Why are you using QDLS? Why use SNDDST? Both of those are potentially related causes.   Tom
    125,585 pointsBadges:
    report
  • sim400
    Tom, Thanks for Reply.....We have Jobs generating reports (spool file) and they add the spool file to be sent out in email into a File. My SQLRPGLE running in batch picks entries from File (it will have details of spool file), takes that spool file and runs CPYSPLF, generates PDF file.......I use QDLS and SNDDST to send the PDF file in email. I think we can use SNDDST only from QDLS.All CL commands are run by RPGLE only thru QCMDEXC.
    305 pointsBadges:
    report
  • ToddN2000
    Is your program just for e-mailing the spool files or are you creating and e-mailing within the same program? If it is for e-mailing only, why not write it in CL? How are you getting the spool file attributes for e-mailing the correct document. Does your problem happen every time you run the job or is it sporadic?
    11,245 pointsBadges:
    report
  • TomLiotta
    The Information Center File system considerations for multithreaded programming topic is clear:
    The QDLS file system is not threadsafe.
    You can't use that programming to do that task in a subsystem that allows multi-threading. And you might not be able to run that program in a subsystem that doesn't allow multiple threads. It doesn't matter how you compile your program. The functions that you are accessing through that program are where the problem is.   And again, why are you using SNDDST? It's not appropriate for what you're doing. Use an e-mail function instead, and stop using QDLS.   Tom
    125,585 pointsBadges:
    report
  • sim400
    Tom,What could I use to send email on iSeries? I know only SNDDST.Anyway, the problem is solved after using CHGQRYA DEGREE(*NONE) at the start of the program.
    305 pointsBadges:
    report
  • TomLiotta
    The solution is temporary. There will be other problems. You can find a number of problems discussed in this forum and in just about any similar forum on the internet.   There are a number of plain SMTP free e-mail solutions that do not require use of SNDDST nor QDLS. Maybe the most common is Mime&Mail for IBM System i from Easy400. Java e-mail has also become fairly common, and other solutions exist. SMTP e-mail can also be done without any 3rd-party utilities by calling the native SMTP functions, but most sites prefer a utility.   SNDDST plus QDLS is a useful short-term function. For continuing long-term use, you need to use features that are appropriate to the task.   Tom
    125,585 pointsBadges:
    report

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