0

I'm using three logical file with different Record Format where on the first subfile I'm using LF1 and LF2 where on the first subfile I cannot use *LOVAL SETLL it will give me Run Time Error. not sure why?

then the program will lead me to second subfile and I'm using LF3 it seems fine.

but then If I back to first subfile the subfile turn to blanks.???? why?

this my subroutine for building my subfile:

C     CLRSR         BEGSR                                                                                             
C                   EVAL      *IN55='0'                                                                               
C                   WRITE     USQLSCTL                                                                                
C                   EVAL      *IN55='1'                                                                               
C                   ENDSR                                                                                             
C*                                                                                                                    
C*BUILDING SUBFILE                                                                                                    
C     BLDSR         BEGSR                                                                                             
C     *LOVAL        SETLL     USRLGX                                                                                 
C                   EVAL      RECNO=0                                                                                 


C                   EXSR      TMISR1                                                                                  
C                   EXSR      REDSR1                                                                                  

C                   DOW       NOT %EOF                                                                                
C                   IF        USRID<>IDD                                                                              
C                   EXSR      MVESR                                                                                   
C                   EXSR      DIMSR                                                                                   
C                   MOVE      USRID         IDD                                                                       
C                   EVAL      RECNO=RECNO+1                                                                           
C                   WRITE     USQLS                                                                                   
C                   ENDIF                                                                                             

C                   EXSR      TMISR1                                                                                   
C                   EXSR      REDSR1                                                                                   

C                   ENDDO                                                                                             
C                   ENDSR   

and the related subroutine

C     TMISR1        BEGSR                                                                                             
C                   READ      USRLGX                                                                                  
C                   MOVE      USRTI         MINTI                                                                     
C                   ENDSR                                                                                             

C     REDSR1        BEGSR                                                                                             
C                   READ      USRLG                                                                                   
C                   MOVE      USRTO         MAXTO                                                                     
C                   ENDSR                                                       6                                      

n the LF I used is USRLG and USRLGX. where both LF refer to the same record format. but each LF has different sorted order. *record format has been RENAME on F-Spec

  • I have this two problem which is:
  • I only can use *LOVAL setll logical-file once only.
  • n the result for coding above sometime it will give result for UserTimeIn some time it equals to blanks.(000000)
Mat
  • 202,337
  • 40
  • 393
  • 406
user1516536
  • 23
  • 2
  • 5
  • What is the definition of the key(s) in the LF, and please show the I/O statements in your pgm for it. What ringtone error are you getting? – WarrenT Aug 16 '12 at 03:51
  • Also, which one is 'LF1', which is 'LF2', and which is 'LF3'? What file are you waiting for on the `DOW NOT %EOF` (if possible, always qualify the expected file) - there are two possibilities (that we know of). You haven't provided the definitions of 3 of the sub-routines, are they important? And _where_ are you getting the runtime error (and what is it)? And perhaps most importantly... **why** are you insisting on working in _columnar_ format - what version of the OS are you on? – Clockwork-Muse Aug 16 '12 at 15:27
  • @X-Zero I think I recall he's a student; the choice of syntax (and 'no SQL') is not his to make. – Buck Calabro Aug 16 '12 at 16:32
  • @user1516536 Subfiles are a close coupling between the RPG and the DDS. It'll be easier to see what's happening if you post the relevant DDS. The F-specifications from the RPG program would be a good idea too. – Buck Calabro Aug 16 '12 at 20:37

1 Answers1

1

When ever you use *LOVAL then you must use record address type "k" (means key in program)