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



orderCount += 1;
IF datepi > prevdate;
prevdate = datepi;
ENDIF;

Normally I would format the IF to begin right under the 'O' in orderCount. In fact, I did, but WDSc insists upon pushing the statement two positions further to the right. In addition, though it can't be shown in this example, the IF is color-coded BLUE (in fact, the whole line is colored blue). IF's are color-coded RED; at least mine are (excepting this one). SQL statements are (for me, anyway) colored Blue.

Plus, referring to my earlier post about WDSc returning to the line after the last SQL statement after entering a non-SQL statement, WDSc's cursor is returning to the line after the IF statement. Except for the abhorrent behavior of WDSc's cursor, everything was going fine until the IF statement above. There doesn't seem to be anything out of the ordinary in the preceding code, but here the whole section anyway:

/free

EXEC SQL
Declare Cursor AllOrders for
Select dncust,
dnref#,
dndate
From HISTORY / BWDNAMH01
WHERE dndate > 20081231 AND
dnjrcd = 'AR' AND
IN (SELECT customer
from LAYTRACK)
Order By dncust,
dndate;

EXEC SQL
Open AllOrders;

DOW 1 = 1;

EXEC SQL
Fetch Next from AllOrders Into :custpi, :ref#pi, :datepi;

IF SQLState = '02000'
OR SQLCode < *Zeros;
LEAVE;
ENDIF;

IF custpi <> prevCust;
IF prevCust <> *Zeros;
CHAIN prevcust LAYTRACK;
IF %found(LAYTRACK);
lastorddt = prevDate;
orders2009 = ordercount;
UPDATE LAYTRACKR;
ENDIF;
prevCust = custpi;
prevDate = *Zeros;
orderCount = *Zeros;
ENDIF;

orderCount += 1;
IF datepi > prevdate;
prevdate = datepi;
ENDIF;

This is driving me nuts.

Jerry C. Adams
IBM System i Programmer/Analyst
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.