RESOLVED: delay or async for RUP, or call SM from RUP

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

RESOLVED: delay or async for RUP, or call SM from RUP

Post by adale »

I hope I am just missing something simple here, and just being think headed about this.

I have a RUP that is ran from a submitted job on the IBM i (from the job scheduler), that is doing various file and job cleanup functions at the end of the business day.

In a new routine in the RUP, and am reading a file to select specific records.

As I read the record from this file (select fields), I need to call another RUP or SM to perform some other external transaction processing using the field values.

The challenge is that this external transaction processing takes a few seconds or more, but this delay is causing a crash as the SELECT is already continuing on before the return of the initial external transaction process.

#1 - Is there syntax to call a Server Module (xxx.ExecuteAsync) from within a RUP?

#2 - Or is there syntax to call another RUP in async mode so that the original RUP routine SELECT will be held until the called RUP completes?

#3 - or is there a means to build in a pause or delay within a SELECT statement?
Last edited by adale on Tue Oct 28, 2025 1:09 am, edited 1 time in total.
Arlyn Dale
Servias LLC
davidbalansa
Posts: 92
Joined: Mon Feb 01, 2016 10:08 am

Re: delay or async for RUP, or call SM from RUP

Post by davidbalansa »

Hi Arlyn,

Your select statement doesn't continue processing when you call a method in another RP. It will wait until processing is complete and then continue.

Not understanding the exact processing of your code, I am guessing the processing in your RP method called inside the select statement is updating the file you are processing, possibly messing up your file pointer and causing the error in the select statement.

In the past I have read records (using the select) I want to process into a list. Then performed the processing outside of the select statement using the list.

Regards,
David
davidbalansa
Posts: 92
Joined: Mon Feb 01, 2016 10:08 am

Re: delay or async for RUP, or call SM from RUP

Post by davidbalansa »

Hi Arlyn,

Your select statement doesn't continue processing when you call a method in another RP. It will wait until processing is complete and then continue.

Not understanding the exact processing of your code, I am guessing the processing in your RP method called inside the select statement is updating the file you are processing, possibly messing up your file pointer and causing the error in the select statement.

In the past I have read records (using the select) I want to process into a list. Then performed the processing outside of the select statement using the list.

Regards,
David
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: delay or async for RUP, or call SM from RUP

Post by adale »

David -
Thank you! You were correct, In one of the RP routines there was an update to the file in the select statement.
Corrected by using the original select to build a work list, then process the work list to do the RP updates, and it all works fine.
Thanks again.
Arlyn Dale
Servias LLC
Post Reply