Hi,
You cannot add an F-Spec to a procedure and I had not really considered
adding F-Specs to the Service Program source member before the procedures...
With release V6R1 you can specify F-Specs locally, i.e. immediately after
the P-Spec.
Files defined locally are only valid for the procedure's scope. That means
you can have several procedures in the same module that use the same file,
but each file in each procedure gets its own file pointer. Files in
procedures will be opened automatically as soon as the procedure will be
called and automatically closed as soon as the procedure will be left (just
like in a program with *INLR = *ON). If the key word STATIC is specified for
the local F-Specs, the file stays open at the end of the procedure (just
like you end a program with RETURN). With V6R1 files even can be passed as
parameters.
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!"
-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von nike@xxxxxxxxxxxxxx
Gesendet: Friday, February 15, 2008 00:20
An: RPG programming on the AS400 / iSeries
Betreff: Re: Encapsulation - Service Programs, Procedures, SQL, LDA, etc.
When I asked the question I did not expect you to write a whole article on
the subject :)
In reading through the article, I see one thing I had not considered.
Currently our service programs consist of nothing but exported procedures.
No F-Specs at all.
That is something we will explore for future use.
Thanks!
As an Amazon Associate we earn from qualifying purchases.