| 
 | 
Hi Stiju,
I think you are trying to read the Display file --- DOW       %EOF(CUSTDISP)
and *IN05=*ON means the control is given to the program from display file 
You may design some thing like this, fields may be both (Input /Output)
capable fields
And key field as Output capable field (say Fld1 ) in this case 
Opt2 = Update  Opt4 = Delete 
 
Opt      Fld1      Fld2      FLd3    ....
 
0320.00 C                   WRITE     FOOTER
0321.00 C                   EXFMT     CUSTMTCTL
When User Selcts Option = 2 one record and Opt = on the other record and
hits enter key 
The control is given back to the program
ReadC For equal indicator 80 
Dow *In80 = *On  and RRN > *zeros
Select 
When Opt = 2 
ExSr $Opt2Sr
When Opt = 4
ExSr $Opt4Sr
Other 
If Opt > *Zeros 
As you wish
EndSelect
ReadC For equal indicator 80
Enddo   
$Opt4Sr   - Update  Subroutine 
$Opt2Sr  BegSr
Fld1         Chain      the file which needs to be updated 
             If %Found ( the file which needs to be updated )
             Eval File_Field = Fld2
             Eval File_Field = Fld3 
             Update   ( the file which needs to be updated ) 
             Endif 
             EndSr
Simliarly for  $Opt4Sr   - Delete Subroutine 
$Opt2Sr  BegSr
Fld1         Chain      (the file which needs to be updated/deleted)
             If %Found  (the file which needs to be updated/deleted)
             Delete   
             Endif 
             EndSr
Thanks
Sadiq ...
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Stiju Easo
Sent: Thursday, March 09, 2006 2:18 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Abt update
Hello,
          While doing a maintenance subfile  , i got a problem.. the edit i
do in the screen is not reflected in the data base,  i used update for
changing database , i am pating section of code below ..
please point out error.
0320.00 C                   WRITE     FOOTER
0321.00 C                   EXFMT     CUSTMTCTL
0322.00 C**  IF F5 IS PRESSED PROCESS POSSITION VALUE
0323.00 C                   IF        *IN05=*ON
0324.00 C                   DOW       %EOF(CUSTDISP)
0325.00 C                   READC     CUSTMT
0326.00 C                   UPDATE    CUSTREC
0327.00 C                   IF        FLAG='U'
0328.00  **  CALL ROUTINE TO UPDATE SKU DETAIL
0329.00 C*                  EXSR      MTUPDATE
0330.00 C                   ELSEIF    FLAG='D'
0331.00  **  CALL ROUTINE TO DELETE A RECORD
0332.00 C*                  EXSR      MTDELETE
0333.00 C                   ENDIF
0334.00 C                   ENDDO
0335.00 C*                  IF        MTPOSVAL = ' '
update is in line no  0326.00
--
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.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.