Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timeout to exit program 1

Status
Not open for further replies.

dmtech9

Programmer
Jun 29, 2001
2
0
0
US
We use AS400 operating system version 4.1 and RPG400. Is there a way within an RPG program to timeout a program?

In other words we'd like to end the rpg interactive program and return to the menu or CL program that called the RPG.

Thanks for any advice.
 
I don't know how this could be done.

Have you searched the IBM documents( Or try searching search400.com?

Otherwise, a really good place to post would be at mindrange.com, you can generally get a response quicker there... Please let us (Tek-tips members) know if the solutions we provide are helpful to you. Not only do they help you but they may help others.

Mike Wills
IT Corporate Support
RPG Programmer
koldark@koldark.net
 
You should browse the AS400 books that are supplied on CD free of charge (you can phone IBM up to get these if you can't find one at your installation) it will give you super quick facilities for searching every possible manual related to the as400 platform (from OS commands to language specific stuff). I am sure there will be something there regarding using api calls to find the jobs runtime. Can't think of the specific command at the moment though!!! sorry
 
While not too sure if this is available in RPG400 it was in earlier versions. We output a format with a special name of '$$TIMER' and as the first data string pass 'mmss' which represents the decimal value of minutes and seconds before the timeout occurs.
This actually starts a time withing workstation data management and when the timer expires control is returned to your program with a particular return code value. Then, in the INFSR, you can check for the code and do what ever you wish. We end the program which causes a return to the menu.

Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top