× 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.



Hi Nicola

It'd be a lot easier to say precisely what the problem is if we could see
the full source for the program. For large chunks of code, David (the list
owner) has setup a repository (http://code.midrange.com) where you can post
the code and include a link in your post.

You say that there isn't a loop in your program, but then mention an ENDDO
immediately before the ENDSR, so there must be at least one.

At a guess I would think that the program is using the RPG cycle which has a
built in loop. Do you have any files that are defined as IP, IS, UP or US
(Input Primary/Secondary or Update Primary/Secondary)? If so then you are
using the RPG cycle and the mainline portion of the code will automatically
repeat for each record in the file unless *INLR is switched on by the
program.

If that's not the case, please post the whole code and I'm sure somebody
will find the answer straight away.

Best regards

Jonathan


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of nb@xxxxxxxxxxxxx
Sent: 24 August 2007 09:13
To: rpg400-l@xxxxxxxxxxxx
Subject: Strange RPG loop






Hello. I got a nice problem with an RPG program.

Somtetimes (it is not very clear why) this program goes into a tight loop.
As usual, i open a STRSRVJOB/STRDBG to check why it goes in loop, and this
isi the strange: there's no loop in program !!!

Here is the code snippet:

1201 043600 C IF *IN(02)
1202 043700 C Z-ADD 12 Z
1203 043800 C EXSR MUOVETG
1204 043900 C EXSR PREPCD
1205 044000 c Eval *in02 = *off
1206 044100 C LEAVE
1207 044200 C ENDIF

the program loops between spec 439 and 441.

Looking by debugger with F10, when the program do the leave at 441, it
reaches the end of the subroutine (which is immediatly after the ENDDO) end
the calling SR, then came back directly into spec 439 and redo the tour.

I've tried to recompile the object, (we're at 5.3.0, with recent PTF) but
it still does it. Program is very 'old-fashion' written originally in
RPGIII, Convertet to RPGLE and have some minor manteinance.

Any hint on what i can check for??? i've lloked through the whole source,
but cannot realize why there should be a similar behavior.

Thanks

--

Nicola Brion
Tech Fossil (Often called a Dinosaur) - ancient animal that make things to
work.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.