|
Success!! I used the RPG program. It was a little different than this since I have RPG/400 and not ILE. It would be nice to have the EVAL operation that ILE uses. Thanks, Art -----Original Message----- From: Joel Fritz [mailto:JFritz@sharperimage.com] Sent: Wednesday, January 05, 2000 11:59 AM To: 'RPG400-L@midrange.com' Subject: RE: update files Here's a simple RPGIV program that will update records according to the conditions you've described. The things you need to know are the file name and it's record format name. The nasty part is getting all of the entries on the F spec right if you're unfamiliar with RPG. If the file is large (several million records) it may take a few minutes to run. This is the brute force approach--read all the records and change the ones that meet the criterion. Some others on the list have suggested SQL. I'd probably do it that way too, to tell the truth, but this will work and the source is not too much longer than the update query that would do the same thing. Fyourfile uf e disk F C read rcdfmtname C dow NOT %eof(yourfile) C if dtype = 'JRNL' AND ddstat = 'A' C eval ddstat = 'X' C update rcdfmtname C endif C read rcdfmtname C enddo C eval *inlr = *on > -----Original Message----- > From: Art Baker [mailto:Art_Baker@baan.com] > Sent: Wednesday, January 05, 2000 9:38 AM > To: 'RPG400-L@midrange.com' > Subject: FW: update files > > > Hello, > I looking to update a data file with RPG. Normally I've > been using > UPDDTA and changing the records, when required, but in this > case there is > over 900 records that needed to be updated. My question is > which command to > use, SETLL, READE or CHAIN. There are two things to look for > in this file, > DTYPE > and DDSTAT. The DTYPE to look for is JRNL and the DDSTAT to > look for is 'A'. > Both JRNL and 'A' need to be true then, change the 'A' to an 'X'. > Thanks for any advice, > Art > +--- > | 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 > +--- > +--- | 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 +--- +--- | 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 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.