fhg
Volume 9, Number 12 -- April 1, 2009

A Sleepy RPG Program

Published: April 1, 2009

Hey, Ted:

Does RPG have anything equivalent to CL's Delay Job (DLYJOB) command? I am working on an RF application, and I need to code a delay of a few seconds into my program. Besides using a do loop with a final value of 1,000,000,000,000, how can I cause a timed interval within an RPG program?

--David


Thanks to the wonders of the Integrated Language Environment, RPG has a way to delay a job a specific number of seconds. It's called sleep. Sleep requires one 4-byte unsigned integer parameter--the number of seconds to delay--which must be passed by value.

Here's an example:

H dftactgrp(*no) actgrp(*new)
H option(*srcstmt:*nodebugio)
H bnddir('QC2LE')

D sleep           pr            10u 0 extproc('sleep')
D   Interval                    10u 0 value

D t1              s               z
D t2              s               z

 /free
   *inlr = *on;
   t1 = %timestamp();
   sleep (10);
   t2 = %timestamp();
   dump(a);

Notice that you must make the program consult the QC2LE binding directory in order for the compiler to find the sleep procedure. The interval may not be exactly the one you specify, due to processing, but it will be close. Calling sleep will certainly be more accurate than counting to a trillion.

--Ted




                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
WORKSRIGHT SOFTWARE

Do you need area code information?
Do you need ZIP Code information?
Do you need ZIP+4 information?
Do you need city name information?
Do you need county information?
Do you need a nearest dealer locator system?

We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

Just call us and we'll arrange for 30 days FREE use of either
ZIP/CITY or PER/ZIP4.

WorksRight Software, Inc.
Phone: 601-856-8337
Fax: 601-856-9432
E-mail: software@worksright.com
Web site: www.worksright.com


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Edwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

Help/Systems:  Request your FREE Robot/SCHEDULE Enterprise Information Kit today
WMCPA:  24rd Annual Spring Technical Conference, April 1 & 2, 2009, Delavan, WI
COMMON:  Join us at the 2009 annual meeting and expo, April 26-30, Reno, Nevada


 

IT Jungle Store Top Book Picks

Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
The iSeries Express Web Implementer's Guide: List Price, $49.95
Getting Started with PHP for i5/OS: List Price, $59.95
The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
Can the AS/400 Survive IBM?: List Price, $49.00
Chip Wars: List Price, $29.95


 
The Four Hundred
Wall Street Makes IBM, Sun Strange Bedfellows?

Measure Twice, Cut Once Applied to ERP Implementations

UCG Partners with MaxAva, Expands DR and HA Capabilities

As I See It: Generation Gap

BCD Cranks Up Services, Training for PHP Deployments

Four Hundred Stuff
Kronos Gives iSeries HR App an HTML Overhaul

Varsity Delivers Analytical Solutions for Shippers

A Cloud Solution for the Spreadsheet Proliferation Problem

SunGard Looks for Growth with New Reseller Program

TMW to Add .NET Features to i OS-Based Trucking App

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
March 28, 2009: Volume 11, Number 13

March 21, 2009: Volume 11, Number 12

March 14, 2009: Volume 11, Number 11

March 7, 2009: Volume 11, Number 10

February 28, 2009: Volume 11, Number 9

February 21, 2009: Volume 11, Number 8

TPM at The Register
Dell girds iron from the tower to the blade

HP goes to eleven with ProLiant launch

IBM punts two racks, a blade, and a hybrid thingy

Fujitsu talks big on x64 server sales

Rumour: Sun pink slips to fly today

IBM turns back on server history

Smoking power supply alarms net brokerage house

Parallels: Bare-metal hypervisor in the works

Blades and VMs - IT's peanut butter cup

Otellini: 'I'd rather have Sun be independent'

Red Hat sales buck Meltdown

Dell Nehalem men badmouth your servers

AMD migrates live VMs from Shanghai to Istanbul

Sun sells two Constellation supers for $30m

THIS ISSUE SPONSORED BY:

WorksRight Software
Help/Systems
Guild Companies


Printer Friendly Version


TABLE OF CONTENTS
A Sleepy RPG Program

Treasury of new DB2 6.1 (V6R1) Features, Part 5: New Functions and Change Stamp Columns

Admin Alert: Change Your Tape Drives, Change Your Tape Management Costs

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
How to return value from CL program?

ADO.NET/IBM.Data.DB2.iSeries/ iDB2Connection

Order by alias names

SQL procedure

Insert via Java

iSeries Access for Web

Mimix installation and configuration docs




 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2009 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement