× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Here's some code from one of the sub-procedures which is demonstrating the
errant behavior:

p ListTrdp        b
d ListTrdp        pi            10

 *  Run SQL to get all trading partner names
c/Exec Sql  DECLARE cursor1 cursor for
c+   select distinct ehtrdp from edi006pf where ehtrdp <> ' '
c+   order by ehtrdp
c/End-Exec

 *  Open cursor
c/Exec sql  open cursor1
c/End-Exec

 *  Fetch first row
c/exec sql  fetch cursor1 into :@trdp
c/end-exec

c                   eval      sflrrn1= 0
c                   if        sqlcod = 0
c                   clear
c                   write     sflctl1
c                   dow       sqlcod = 0
c                   eval      sflrrn1= sflrrn
c                   eval      option = *blanks
c                   write     sfile1
c/exec sql  fetch cursor1 into :@trdp
c/end-exec
c                   enddo

c/exec sql
c+  close cursor1
c/end-exec

 **** 'Process the subfile code' left out ***

c                   endif

c                   return    *blanks
p ListTrdp        e


Naturally, there's more code in there but this is the relevent stuff.  The
first time thru this procedure everything works perfectly.  The EDI006PF
file is opened and closed as expected.  The subfile is populated as
expected.  On subsequent passes through the procedure, everything works
exactly as expected EXCEPT the EDI006PF is left open (according to
WRKACTJOB), making it appear that the 'close cursor1' is not working quite
as expected.  If I step thru the procedure in debug mode (STRDBG), SQLCOD
is *zeros right after the 'close cursor1' statement is processed.

Program compile options are: COMMIT(*NONE), CLOSQLCSR(*ENDMOD),
DBGVIEW(*SOURCE). OS is V4R5M0





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.