ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Subfile Program

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Subfile Program

    A)I have a physical file named E0003 its source code is
    Code:
     
    UNIQUE 
    R E0 
    EMID 5 0 
    EMNAM 15 
    EMDES 15 
    EMSAL 5 0 
    K EMID
    B) I have another display file name E3 its source code is
    Code:
     
    A*%%TS SD 20110118 074242 SURESH400 REL-V5R3M0 5722-WDS 
    A*%%EC 
    A DSPSIZ(24 80 *DS3) 
    A R SFL03 SFL 
    A*%%TS SD 20110118 070616 SURESH400 REL-V5R3M0 5722-WDS 
    A SFLNXTCHG 
    A EMID R O 9 13REFFLD(E0/EMID SURESH4001/E0003
    A EMNAM R O 9 24REFFLD(E0/EMNAM SURESH4001/E000
    A EMDES R O 9 42REFFLD(E0/EMDES SURESH4001/E000
    A EMSAL R O 9 64REFFLD(E0/EMSAL SURESH4001/E000
    A FLD001 1 0I 9 4 
    A R CTL03 SFLCTL(SFL03) 
    A*%%TS SD 20110118 070616 SURESH400 REL-V5R3M0 5722-WDS 
    A OVERLAY 
    A 30 SFLDSP 
    A SFLDSPCTL 
    A SFLSIZ(0006) 
    A SFLPAG(0005) 
    A 3 4'2=edit 5=view' 
    A 7 4' OPT EMID EMNAM -
    A EMDES EMSAL ' 
    A 8 7' ' 
    A R DD 
    A*%%TS SD 20110118 071850 SURESH400 REL-V5R3M0 5722-WDS 
    A 4 3'emid emnam -
    A emdes emsal' 
    A EMID R O 5 2REFFLD(E0/EMID SURESH4001/E0003) 
    A EMNAM R O 5 18REFFLD(E0/EMNAM SURESH4001/E0003) 
    A EMDES R O 5 41REFFLD(E0/EMDES SURESH4001/E0003) 
    A EMSAL R O 5 62REFFLD(E0/EMSAL SURESH4001/E0003) 
    A R DD1 
    A*%%TS SD 20110118 071850 SURESH400 REL-V5R3M0 5722-WDS 
    A 4 4'emid emnam emdes-
    A emsal' 
    A EMNAM R I 5 15REFFLD(E0/EMNAM SURESH4001/E0003) 
    A EMDES R I 5 32REFFLD(E0/EMDES SURESH4001/E0003) 
    A EMSAL R I 5 55REFFLD(E0/EMSAL SURESH4001/E0003) 
    A EMID R O 5 3REFFLD(E0/EMID SURESH4001/E0003) 
    A R FOOTER 
    A*%%TS SD 20110118 071850 SURESH400 REL-V5R3M0 5722-WDS 
    A 20 5'f7=confirm f3=exit'
    A R FOOTER1 
    A*%%TS SD 20110118 074242 SURESH400 REL-V5R3M0 5722-WDS 
    A 20 5'f3=exit'
    C)my subfile program is A60 its source code is
    Code:
     
    FE0003 UF E K DISK 
    FE3 CF E WORKSTN 
    F RRN KSFILE SFL03
    C Z-ADD 0 RRN 40 
    C Z-ADD 0 OPT 20 
    C READ E0003 45 
    C *IN45 DOWEQ *OFF 
    C RRN ADD 1 RRN 
    C WRITE SFL03 
    C READ E0003 45 
    C ENDDO 
    C RRN IFGT 0 
    C MOVE *ON *IN30 
    C ENDIF 
    C WRITE FOOTER1 
    C EXFMT CTL03 
    C READC SFL03 60 
    C *IN60 DOWEQ *OFF 
    C OPT IFEQ 5 
    C EMID CHAIN E0 58
    C EXFMT DD 
    C ENDIF 
    C OPT IFEQ 2 
    C EMID CHAIN E0 48
    C WRITE FOOTER 
    C EXFMT DD1 
    C *IN07 IFEQ *ON 
    C UPDAT E0 
    C ENDIF 
    C ENDIF 
    C ENDDO 
    C SETON LR
    D) the records present in my physical file E0003 are
    Code:
     
    EMID EMNAM EMDES EMSAL
    1 sarikha manager 25,000
    2 muthu sweeper 1,200
    3 vicky cleaner 1,500
    4 ramu operations 4,000
    5 edward officeboy 5,000
    6 kalyan sales 9,500
    7 ramesh fpc 11,500
    8 sarikha developer 14,000
    9 suresh teamleader 21,000
    10 rajesh developer 16,000
    11 ganesh programmer 20,000
    12 shankar projectmanager 30,000
    13 balu driver 6,500
    14 rajan cook 9,000
    15 thanika steno 4,000
    16 sarikha typist 5,000
    17 sreesha developer 17,000
    18 malathi programmer 21,000
    19 amal catering 11,000
    20 vimal testengineer 30,000
    when i run my subfile program A60 it Gives severity level 30 error
    QRG7030 Severity: 30 Number: 1
    Message . . . . : The Field or indicator is not defined.
    5722WDS V5R3M0 030905
    * 7030 07 3010
    i can't find out the solution please guide me.

    Actually my requirement is to load all the records from physical file E0003 to the display file in Subfile record format SFL03 and if we want to view one particular record alone means we should get it in a single record format display file DD,
    if we want to change or update records means we should do it in another single record format display file DD1 and using it except EMID we should edit all the fields and the same should be displayed in Subfile record format SFL03 and same should be updated in physical file E0003 also kindly tell me the solution.

    My display file E3 record formats are given below
    Code:
     
    10 SFL03 SFL 01/18/11
    20 CTL03 SFLCTL SFL03 01/18/11
    30 DD RECORD 01/18/11
    40 DD1 RECORD 01/18/11
    50 FOOTER RECORD 01/18/11
    60 FOOTER1 RECORD 01/18/11

  • #2
    Re: Subfile Program

    I dont see RRN define anywhere -- that is including in your subfile DDS

    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Subfile Program

      Originally posted by jamief View Post
      I dont see RRN define anywhere -- that is including in your subfile DDS

      jamie
      not to mention that if the OP looked in the compile listing (which is where that error is and not in the execution) they would have seen which field was not defined.
      I'm not anti-social, I just don't like people -Tommy Holden

      Comment


      • #4
        Re: Subfile Program

        oh and i forgot... EGADS RPG III!!!!
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment


        • #5
          Re: Subfile Program

          Rajan the cook here..

          Look in the "Programming DDS for display files" recipe book for an ingredient such as SFLRCDNBR.
          And as head chefs Jamie and Tom pointed out the clues are in the compile listing and defining what is missing.

          It will come together for you.
          the smoking gnu

          Comment

          Working...
          X