A few suggestions from a person who modifies some BPCS 405 CD on V5R1 using SQL and SQL cursor embedded in RPG/400 outside of AS/Set.

BPCS_L works only for text, without anything embedded, because of the fear of viruses, thus some of your post gets a bit scrambled.

I have subroutines to define the cursor, open the cursor, access the cursor, close the cursor, in which I name them so that access to cursor in the program is in that sequence, because SQL bombs if the stuff to be done is not in the sequence in the program that the references are needed.

Sometimes there is a bad input, especially in a cursor that joins several files, and some of the data is coded for deletion, or inactive, or whatever, so depending on how the file is defined that is being accessed, there needs to be SQL code to check do what if input failure.

Even though you doing physical file, what 400 using might be a different logical depending on how you accessing it and in what sequence ... The 400 has artificial intelligence that tries to use best performance access based on how the programmer is asking for the data, even though we might explicitly call for a particular physical or logical in the CLP.

A debug can be run during the execution of program.


   Wel we are using cursor. Also we are using sum function into the SQL.
   Th SQL is on ITH physical file and not on any logical file. We
   are&nbspalso not using any ITH data model in the SQL. However once we
fech the records we do write to them in a physical file which is i ncluded in the data model.

    when we rewrote the
   entire program again it dd not work. However when we write new AS/SET
   code only for that subrotine the SQL gives accurate results.




   Theeason i want to know the number of records that are fetched in he
   cursor is to check whether the number of records selected in ursor is
   incorrect or if there is problem in writing the records in the daabase
   file.  I am also attaching the copy of the AS/SET code routine hat is
   giving us the problem.  If possible please have a look at it ad provide
   us some insight on the problem.




   &nbp;Our BPCS version is 6.01.2,  AS/SET (ADK) version V6.1.00
   and&nbspOS/400 version is V5R2.

   Thanking you in advance.

-
Al Macintyre  http://www.ryze.com/go/Al9Mac
Find BPCS Documentation Suppliers http://radio.weblogs.com/0107846/stories/2002/11/08/bpcsDocSources.html
BPCS/400 Computer Janitor at http://www.globalwiretechnologies.com/

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-2022 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.