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



Ahh yes. I was writing a footer before exfmt of the control record. That
was overlaying my no records format. Once I added the OVERLAY to the
footer it worked fine.


Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777



"Jerry C. Adams" <midrange@xxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
03/21/2011 12:00 PM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
"'RPG programming on the IBM i / System i'" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: Best practice for displaying an empty subfile






Bryce,

Since the format is output using a WRITE, rather than an EXFMT, maybe
something later in the code is overlaying it.

That said, I have attacked this problem in two different ways. First, in
the ELSE portion putting "No Records Found' into a description line,
setting
the RRN to 1, writing the subfile record, and displaying the subfile.

Second, in the RPG program:

IF rrna > *Zeros;
SF_Display = *On; // Indicator 33
SF_End = *On; // Indicator 90
rrna = 1;
ELSE;
SF_Display = *Off;
SF_End = *Off;
ENDIF;

Later I WRITE the function keys display and then EXFMT the subfile control
record (with OVERLAY, of course).

In the display file:

33 SFLDSP
N31 SFLDSPCTL
31 SFLCLR
90 SFLEND(*MORE)

I use Load All subfiles these days, but either method should work for
page-at-a-time subfiles.

Jerry C. Adams
IBM i Programmer/Analyst
Umpres should be natural Republicans - dead to 'human feelings'. - George
Will
--
A&K Wholesale
Murfreesboro, TN
615-867-5070


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Bryce Martin
Sent: Monday, March 21, 2011 10:15 AM
To: RPG programming on the IBM i / System i
Subject: RE: Best practice for displaying an empty subfile

I know this thread is about a month old, but I just had the opportunity to

try this out and it didn't work for me. I'm not sure exactly what I am
doing wrong.

SFLDSP = *off when I write the NRCDFMT. I used the exact DDS that you
provided.

if mrrrn <> 0;
saverrn = mrrrn;
sfldsp = *on;
else;
write(E) NRCDFMT1;
endif;

A R NRCDFMT1
A OVERLAY
A 6 19'NO RECORDS FOUND'
A DSPATR(HI)

If you'd like to see anything else, just let me know. The program loads
up just fine w/o error and there are no subfile records to be written. I
debug the code and it does the Write(E) NRCDFMT1; I tried it w/o the (e)
and it doesn't error out, it just doesn't show up on the screen.


Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777



"Monnier, Gary" <Gary.Monnier@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
02/17/2011 05:29 PM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: Best practice for displaying an empty subfile






Have you tried writing a blank record to the subfile?

You can also write a "No Records Found" record format overtop the
subfile display area. Here's a broad example.

Display file record format NRCDFMT overlays the screen area where
subfile records would be displayed.

A R NRCDFMT
A OVERLAY
A 15 19'No Records Found'
A DSPATR(HI)

Code snippet...

// rrnInSfl is incremented each time a record is written to the subfile

D rrnInSFL S 4S 0 like(SFRRN)

/free
.
.
.
if (rrnInSFL <= 0); // No entires to display
write(E) NRCDFMT; // No entries found record
endif;

write(E) FUNCTNKEY; // Function keys record

write(E) ERRMSGSFLC; // Put messages to the screen

exfmt SUBFILECTL; // Subfile control record
.
.
.
/end-free

Writing the NRCDFMT assumes the SFLDSP keyword is not active.

Hope this helps

Gary Monnier

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Pete Helgren
Sent: Thursday, February 17, 2011 2:06 PM
To: RPG Midrange Discussion
Subject: Best practice for displaying an empty subfile

I have an program that displays records in a subfile and it works great,

until there are no records to display. In that case it crashes with a
predictable RNQ1255. I set off the subfile display indicator before I
EXFMT when I have no records to display so I am wondering if there is
other logic I need to add so I can at least display the empty subfile
screen.

Thanks


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.