|
Just a couple of off the cuff thoughts... On 3/30/06, Mike Troxclaire <mike_troxclaire@xxxxxxxxxxx> wrote: > > Pros, > > ============================================================= > FCUST UF E DISK RENAME(CUSTR:CSREC) > > /FREE > DoW not %eof(CUST); > Read CUST; > If not %eof(CUST); > Exsr UpdateCSREC; > EndIf; > EndDo; > dsply 'UPDATE SUCCESSFUL'; > /END-FREE Won't this message show every time you run the program? It has no conditioning... /FREE > BegSR UpdateCSREC; > /END-FREE > > > C/EXEC SQL > C+ UPDATE TESTING/CUST SET CUSSTA = 'TX' > C+ WHERE CUSSTA = 'TN' > C/END-EXEC > /FREE > *inlr = *on; > EndSR; Why is your *INLR statement inside the update Subroutine? Is this supposed to control the loop in the mainline? How is all this logic any different than simply executing the UPDATE sql? I mean, the program opens the file for update (unnecessary), reads 1 record, goes to the execute subroutine, updates all the necesary records, and then sets on LR presumably to break out of the loop that calls the SR. Try this instead: (notice no F-Spec) =============================== C/EXEC SQL C+ UPDATE TESTING/CUST SET CUSSTA = 'TX' C+ WHERE CUSSTA = 'TN' C/END-EXEC /FREE if sqlstt = '00000' ; dsply 'UPDATE SUCCESSFUL'; else ; dsply 'UPDATE FAILED'; endif ; *inlr = *on; /END-FREE ============================================================= Just some quick thoughts... -- Joel Cochran
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.