× 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: Simple Subfile question
  • From: Jim Langston <jimlangston@xxxxxxxxxxxxxxxx>
  • Date: Wed, 04 Apr 2001 10:33:32 -0700
  • Organization: Pacer International

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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.