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



In most situations I only use OPEN, FETCH and CLOSE either, but in
composition with List APIs I prefer to have these additional calls for
creating the user space at the beginning and deleting it at the end of the
UDTF execution.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)


-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Robert
Rogerson
Gesendet: Tuesday, 08.11 2016 22:36
An: RPG programming on the IBM i (AS/400 and iSeries)
Betreff: Re: Global or static variables in RPG external UDTF program

Thanks for the link Darren. If I read about the FIRST call or the FINAL
call I can't remember. I have created UDTFs in the past but only used OPEN,
FETCH and CLOSE.

Rob


On 11/8/2016 4:07 PM, Darren Strong wrote:
It almost sounds like the variable is only being initialized when you
first call the function. Could this be that the function is SQL and
therefore runs in the DFTACTGRP? And in my understanding the static
variable would retain it's value until the end of the activation group.
And the DFTACTGRP woldn't end until you signoff...
That was good advice. It didn't seem to make a difference in this
case, but I've found an article on DeveloperWorks by Birgita H.,
including some example code for coding an API list read in a UDTF, so
I'll reform my program around that example and see how it goes.

https://www.ibm.com/developerworks/ibmi/library/i-power-of-udtf/i-powe
r-of-udtf-pdf.pdf

Thank you.


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


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.