× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The original poster wanted to wait for an object lock to be released though,
so this solution probably isn't an option in this instance... You'd have to
have another program sat polling to see when the object lock had gone and
then add the entry to the data queue...  

Regards,
Stu

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Hewitt, Rory
Sent: Thursday 13 January 2005 17:45
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: How to make a program "sleep" for an amount of time?


Mike,
 
As others have pointed out, you can use the 'sleep()' function or the
'_WAITTIME' function or the DLYJOB command to simply wait for a period
of time.
 
However, all of these options don't give you much flexibility in terms
of the amount of time you want to sleep for. An option I like to use is
the QRCVDTAQ API with a wait time of -1 (forever) to wait for an entry
to appear on the data queue. Then you can have another process (another
program or a command) add an entry to the data queue (using the QSNDDTAQ
API) to 'wake up' your program. This is the easiest example of a
never-ending-program (NEP) - your program sleeps until it receives a
data queue entry, processes that data queue entry (or does some sort of
processing) and then goes back to sleep again.
 
This gives you total flexibility - you can decide when you want your
program to wake up. You can also include data in your data queue entry
to provide instructions on what the program should do - simply wake up,
end normally, do some other processing etc...
 
Regards,
 
Rory 
 
Rory M. Hewitt
Software Architect
Computer Associates
t: (650) 534-9056
f: (650) 534-9019
e: rory.hewitt@xxxxxx
-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



If you are not the intended recipient, please notify the sender by return email 
and then delete the message from your computer. The Skandia UK Group reserves 
the right to monitor e-mail communications through its networks.

No contract may be concluded on behalf of the Skandia UK Group by email.

Skandia Life Assurance (Holdings) Limited Skandia Life Assurance Company 
Limited Skandia MultiFUNDS Limited, Skandia Investment Management Limited.

Registered Nos: 1606702, 1363932, 1680071, 4227837, England
Registered Office: Skandia House, Portland Terrace, Southampton SO14
7EJ, United Kingdom

Royal Skandia Life Assurance Limited Registered No : 24916 Isle of Man
Registered Office: Skandia House, King Edward Road, Onchan, Isle of Man IM99 
1NU, British Isles

Skandia Life Assurance Company Limited, Skandia MultiFUNDS Limited, Skandia 
Investment Management Limited and Royal Skandia Life Assurance Limited are 
authorised and regulated by the Financial Services Authority for UK
investment business.

Internet: www.skandia.co.uk

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.