×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Also, note the following.  You're going to need to get the data to write
from the subfile from somewhere.

I say this because of the following quote from you in your original thread:
"I thought the REF was to reference the physical or logical file I was
pulling the data from? is that not the case?"

The REF keyword simply allows you do define a field with the same type and
size as another ( the referenced ) field.

It doesn't have any effect on data.  You are not telling the system where to
get the data by using REF.

So your RPG code should probably have an f-spec for the RECNOTES file and
your code should do something like so:

Clear subfile

read RECNOTES
Do while not %EOF(RECNOTES) 
  Add 1 to RRN counter
  Write detail
  read RECNOTES 
End

If there are detail records 
  Set *IN51 = *ON

Do until F3 is pressed
  EXFMT RECCTL
  IF F3 was not pressed
    Do something 
  End
End




HTH,

Charles Wilt
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121
 

> -----Original Message-----
> From: Tyler, Matt [mailto:mattt@xxxxxxxxxxxxxx]
> Sent: Monday, November 22, 2004 12:32 PM
> To: 'RPG programming on the AS400 / iSeries'
> Subject: RE: Unusual error that I cannto figure out
> 
> 
> In order to use the SFLDSP keyword you must have written data to the
> sub-file record RECSFL first.  Try this, since you almost 
> always want to
> display the sub-file header (control) record all the time, 
> regardless if you
> have detail or not, do not condition the keyword SFLDSPCTL.  
> After you have
> finished with loading data to the sub-file detail record, 
> RECSFL, use the
> RRN counter to condition *IN51.  
> 
> Pseudo code
> 
> Clear subfile
> 
> Do while data to load 
>   Add 1 to RRN counter
>   Write detail 
> End
> 
> If there are detail records 
>   Set *IN51 = *ON
> 
> Do until F3 is pressed
>   EXFMT RECCTL
>   IF F3 was not pressed
>     Do something 
>   End
> End
> 
> Exit program with LR on.
> 
> Oh, and always make your RRN field(s) at least 4.0.  You can 
> put up to 9999
> records into a sub-file.  If you leave it at 3.0 to run the 
> risk of getting
> an error about attempting to write to a sub-file record that 
> already exists.
> 
> 
> Thank you,
> Matt Tyler
> WinCo Foods, Inc
> mattt@xxxxxxxxxxxxxx
> 
> 
> -----Original Message-----
> From: Douglas W. Palme [mailto:dpalme@xxxxxxxxxxxxxxxxxxxxx] 
> Sent: Monday, November 22, 2004 10:19 a
> To: RPG programming on the AS400 / iSeries
> Subject: Unusual error that I cannto figure out
> 
> I am working with subfiles and thought I had this down, but 
> unfortunately I
> am getting an unusual error message when I try to run the 
> program.  Here is
> the dds for the subfile and the program that is calling it. 
> 
> All I am trying to do at the moment is display the subfile to 
> the screen.
> 
> The error message is the following, which I have never seen before:
> 
> Job 182784/DPALME/QPADEV0010 started on 11/22/04 at 11:45:21 
> in subsystem BA
> Session or device error occurred in file SUBFILE (C G D F).   
>               
> 
> Application error.  RNX1255 unmonitored by JDEAL at statement 
> 0000000014,...
> 
> Any suggestions or comments would be appreciated.
> 
> Douglas
> 
> 
> DDS:
>  A*%%TS  SD  20041122  114708  DPALME      REL-V5R2M0  
> 5722-WDS            
>  A*%%EC                                                       
>              
>  A                                      DSPSIZ(24 80 *DS3)    
>              
>  A          R RECSFL                    SFL                   
>              
>  A*%%TS  SD  20041122  114708  DPALME      REL-V5R2M0  
> 5722-WDS            
>  A            NOTES         75   B  3  5                      
>              
>  A          R RECCTL                    SFLCTL(RECSFL)        
>              
>  A*%%TS  SD  20041122  114708  DPALME      REL-V5R2M0  
> 5722-WDS            
>  A                                      CA03(03)              
>              
>  A  51                                  SFLDSP                
>              
>  A  51                                  SFLDSPCTL             
>              
>  A  52                                  SFLCLR                
>              
>  A                                      SFLSIZ(0016)          
>              
>  A                                      SFLPAG(0015)          
>              
>  A                                  1 24'THIS IS THE CONTROL 
> RECORD HEADER'
> 
> PGM:
> 
>  *program: subfiler                                      
> Fsubfile   CF   E             workstn                    
> F                                     sfile(recsfl:rrn)  
> Drrn              s              3  0                    
> C                   DOU       *IN03                      
> C                   EVAL      *IN52 = *ON                
> C                   WRITE     RECCTL                     
> C                   EVAL      *IN52 = *OFF               
> C                   EVAL      *IN51 = *ON                
> C                   EXFMT     RECCTL                     
> C                   ENDDO                                
> C                   EVAL      *INLR = *ON                
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) 
> mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.