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



Hey Lim,

Nice catch. That worked like a charm. In a normal program it doesn't
matter, only in the procedure. I didn't realize the procedure scoped so
strictly like that.

Just for those wondering, this was just an example of something that was
happening in a larger program I'm writing. So I didn't bother trying to
use the variables in the code, this code was just to isolate the problem.

Thanks again to all.


Thanks
Bryce Martin
Programmer/Analyst I
Ext. 4777



"Lim Hock-Chai" <Lim.Hock-Chai@xxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
11/06/2008 09:40 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
<rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: *NOMAIN procedure with display file






Haven't had a chance to test it yet. But a quick glance of the code
seems to indicate that the problem is probably cause by the fieldDS data
structure contains field1/2/3. Remember that fields in the file (At
aleast up to V5R4) are considered global variables. If you re-defined a
global field in a procedure. The field in this procedure override the
global field. So... If you move you fieldDS to the global section, I
think, everything should work fine. Just a guess..



"Bryce Martin" <BMartin@xxxxxxxxxxxx> wrote in message
news:<mailman.2796.1225981709.13295.rpg400-l@xxxxxxxxxxxx>...
I've got a situation where I'm trying to create a procedure with a
display
file. It is an SQLRPGLE program that doesn't see the fields in my dds

file. I've boiled the code down to a very simple example, the DDS
doesn't
change, just the RPG.

DDS:
DSPSIZ(24 80 *DS3)
PRINT(*LIBL/QSYSPRT)
INDARA

R RECORD1
A CA03(03 'F3=EXIT')
A
A FIELD1 L O 6 10
A FIELD2 L O 7 10
A FIELD3 L O 8 10


Here is the SQLRPGLE. If you compile it as it (with the certain lines

commented out) then it compiles just fine. But if you uncomment the
lines
that make it a *NOMAIN procedure it will no longer recognize Field1,
Field2, and Field3 from the DDS.

SQLRPGLE:
h*nomain
FTESTDF CF E WORKSTN infds(wsds)
F USROPN
D WSDS DS
D ALLIND 1A Overlay(wsds:369)
D
D* TEST PR
D
P* TEST B EXPORT
D
D* TEST PI
D
D IndPtr s * Inz(%Addr(*In))
D IndDS DS Based(IndPtr)
D fkeys 99a
D EXIT N Overlay(fkeys:3)
D
D
d fieldDS DS
d field1
d field2
d field3
d myfield D Dim(3) Overlay(fieldDS:1)
d
/free
*inlr = *on;
OPEN TESTDF;
DOW NOT EXIT;

EXFMT RECORD1;

IF EXIT;
LEAVE;
ENDIF;
ENDDO;
close testdf;
/end-free
P* TEST E

Any help will be greatly appreciated.


Thanks
Bryce Martin
Programmer/Analyst I
Ext. 4777
--- This message (including any attachments) is intended only for the
use of the individual or entity to which it is addressed and may contain
information that is non-public, proprietary, privileged, confidential,
and exempt from disclosure under applicable law. If you are not the
intended recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify us and
destroy this message immediately. ---

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.