It did "throw" an error, C-style. usleeep returns -1 if there was an error and the programmer has to check errno to find out what it was. You ignored the error and it just kept on truckin'.
Coy Krill
Core Processing Administrator/Analyst
Washington Trust Bank
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of (WalzCraft) Jerry Forss
Sent: Thursday, August 04, 2016 09:43
To: 'RPG programming on the IBM i (AS/400 and iSeries)'
Subject: RE: USleep
Importance: Low
No error is being thrown, which would have helped.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: Thursday, August 4, 2016 11:37 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: USleep
Hi Jerry
Looking at this web site
http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/apis/usleep.htm
It looks like you will get an error if the time interval specified is
1,000,000 or more microseconds
Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
‘If you're going through hell, keep going.’
Winston Churchill
-----Original Message-----
From: Alan Shore
Sent: Thursday, August 04, 2016 12:32 PM
To: 'RPG programming on the IBM i (AS/400 and iSeries)' <rpg400-l@xxxxxxxxxxxx>
Subject: RE: USleep
Hi Jerry
I looked at the write up about usleep here
http://www-01.ibm.com/support/docview.wss?uid=nas8N1012283
The piece that got my attention is
If you need to delay the job for less than a second See extract below
The function usleep() is a C API that suspends the current process for the number of microseconds passed to it. It can be used for delaying a job. DLYJOB works well if you are looking to delay a job for more than a second. If you need to delay the job for less than a second, however, you must use the usleep() API. The usleep() API is contained in the service program QSYS/QP0SSRV1. The prototype is as follows:
Because your time is over 3 seconds - is the delay only for .267000 seconds
Just my .02 worth
Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
‘If you're going through hell, keep going.’
Winston Churchill
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of (WalzCraft) Jerry Forss
Sent: Thursday, August 04, 2016 12:25 PM
To: 'RPG programming on the IBM i (AS/400 and iSeries)' <rpg400-l@xxxxxxxxxxxx>
Subject: RE: USleep
I run it in debug.
The examples I have seen have the value defined as 10U 0.
I did try as integer with no change.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Thursday, August 4, 2016 11:22 AM
To: Rpg400 Rpg400-L
Subject: Re: USleep
The return value should be an integer not a an unsigned I believe but that would not make a difference.
You don’t appear to have any timing mechanism in the program so how do you know if it is sleeping or not?
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
On Aug 4, 2016, at 12:07 PM, (WalzCraft) Jerry Forss <JForss@xxxxxxxxxxxxx> wrote:
Hi All,
I am testing the following code:
H Option(*SrcStmt : *NoDebugIO)
H DftActGrp(*No) ActGrp(*Caller) BndDir('QC2LE')
D MicroSec S 10U 0
D StrStamp S Z Inz(Z'2016-07-05-18.55.04.377000')
D EndStamp S Z Inz(Z'2016-07-05-18.55.01.110000')
D USleep PR 10U 0 ExtProc('usleep')
D 10U 0 Value
/Free
MicroSec = %Diff(StrStamp : EndStamp : *MSeconds);
USleep(MicroSec);
*InLr = '1';
The MicroSec gets loaded with 3267000.
When it executes the USleep it should delay 3267000 micro seconds (3.267000 seconds).
There is NO delay at all. What am I not doing correctly?
I am currently on 5.4 (I know, working on it)
Jerry Forss
Information Technology Team
WalzCraft
608-781-6355 EXT 2530
jforss@xxxxxxxxxxxxx
Subject to Change Notice:
WalzCraft reserves the right to improve designs, and to change specifications without notice.
Confidentiality Notice:
This message and any attachments may contain confidential and
privileged information that is protected by law. The information
contained herein is transmitted for the sole use of the intended
recipient(s) and should "only" pertain to "WalzCraft" company matters.
If you are not the intended recipient or designated agent of the
recipient of such information, you are hereby notified that any use,
dissemination, copying or retention of this email or the information
contained herein is strictly prohibited and may subject you to
penalties under federal and/or state law. If you received this email
in error, please notify the sender immediately and permanently delete
this email. Thank You;
WalzCraft PO Box 1748 La Crosse, WI. 54602-1748
www.walzcraft.com<http://www.walzcraft.com/> Phone... 800-237-1326
--
This is the RPG programming on the IBM i (AS/400 and 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.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
--
This is the RPG programming on the IBM i (AS/400 and 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.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Subject to Change Notice:
WalzCraft reserves the right to improve designs, and to change specifications without notice.
Confidentiality Notice:
This message and any attachments may contain confidential and privileged information that is protected by law. The information contained herein is transmitted for the sole use of the intended recipient(s) and should "only" pertain to "WalzCraft" company matters. If you are not the intended recipient or designated agent of the recipient of such information, you are hereby notified that any use, dissemination, copying or retention of this email or the information contained herein is strictly prohibited and may subject you to penalties under federal and/or state law. If you received this email in error, please notify the sender immediately and permanently delete this email. Thank You;
WalzCraft PO Box 1748 La Crosse, WI. 54602-1748
www.walzcraft.com Phone... 608-781-6355
--
This is the RPG programming on the IBM i (AS/400 and 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.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
--
This is the RPG programming on the IBM i (AS/400 and 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.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Subject to Change Notice:
WalzCraft reserves the right to improve designs, and to change specifications without notice.
Confidentiality Notice:
This message and any attachments may contain confidential and privileged information that is protected by law. The information contained herein is transmitted for the sole use of the intended recipient(s) and should "only" pertain to "WalzCraft" company matters. If you are not the intended recipient or designated agent of the recipient of such information, you are hereby notified that any use, dissemination, copying or retention of this email or the information contained herein is strictly prohibited and may subject you to penalties under federal and/or state law. If you received this email in error, please notify the sender immediately and permanently delete this email. Thank You;
WalzCraft PO Box 1748 La Crosse, WI. 54602-1748
www.walzcraft.com Phone... 608-781-6355
--
This is the RPG programming on the IBM i (AS/400 and 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.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
---------------------------------------------------------------------
This electronic mail message and any attachments may contain confidential or privileged information and is intended for use solely by the above-referenced recipient. Any review, copying, printing, disclosure, distribution, or other use by any other person or entity is strictly prohibited under applicable law. If you are not the named recipient, or believe you have received this message in error, please immediately notify the sender by replying to this message and delete the copy you received
---------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.