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


  • Subject: RE: Simple Subfile question
  • From: "Mangavalli, Ramanujam" <RamM@xxxxxxxxxxx>
  • Date: Wed, 4 Apr 2001 15:01:12 -0400

Jim, 

I am not too sure about what you are doing here. So I am going to assume
that the subfile display, display control, etc indicators are taken care of.

you said if you write some dummy records, the subfile shows up. So I am
thinking my assumption is right. 

When you have no records in a subfile, do not set the subfile display
(SFLDSP) indicator on.You send a message saying "No records found" and
display this message in the message subfile. 
Alternatively, you can define a dummy record which has nothing but a string
that says "No records found" and write that dummy record first and then
perform an EXFMT on the subfile control format with the subfile display
indicator off. 

Hope this helps. 



-----Original Message-----
From: Jim Langston [mailto:jimlangston@conexfreight.com]
Sent: Wednesday, April 04, 2001 1:34 PM
To: RPG400-L@midrange.com
Subject: Simple Subfile question


I don't work on subfiles too often, so this is really a simple question
but...

I am writing a new program and display file with a subfile.  I loaded the
subfile with dummy records and all is well.  Now I am ready to read my
real file, etc.. and I am displaying my screen for user input.  Now I'm
getting a session or device error, and I'm sure it's being caused by the
subfile being empty.

How do I display my subfile with empty records?  Or do I have to check
my SF_RecNum and only display it if it's not zero?

  *** Clear Subfile ***                             
 C                   Eval      *IN55 = *On          
 C                   Write     SubCtl               
 C                   Eval      *IN55 = *Off         
 C                   Eval      SF_RecNum = *Zero    
                                                    
 C                   DoW       NOT (*IN03 OR *IN12) 
                                                    
  *** Display Subfile and get input ***             
 C                   Write     Footer               
 C                   Write     Header               
 C                   Exfmt     SubCtl               
                                                    
 C                   EndDo                          

bombs out on the Exfmt SubCtl with
Session or device error occurred in file MNTSTGDFM (C G D F).

However:

  *** Clear Subfile ***                             
 C                   Eval      *IN55 = *On          
 C                   Write     SubCtl               
 C                   Eval      *IN55 = *Off         
 C                   Eval      SF_RecNum = *Zero    
                                                    
  *** Load some dummy records ***                        
 C                   Eval      DFType = '* Test1 *'      
 C                   Eval      DFUnit = 100              
 C                   Eval      DFSplt = 10               
 C                   Eval      DFCuFt = 100.101          
 C                   Eval      DFAmnt = 1000.01          
                                                         
 C                   Eval      SF_RecNum = SF_RecNum + 1 
 C                   Write     SubFile                   

 C                   DoW       NOT (*IN03 OR *IN12) 
                                                    
  *** Display Subfile and get input ***             
 C                   Write     Footer               
 C                   Write     Header               
 C                   Exfmt     SubCtl               
                                                    
 C                   EndDo                          

works, but is obviously not what I want.

Regards,

Jim Langston
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.