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



Scott, the (pre) compile error:
DIAGNOSTIC MESSAGES
MSG ID SEV RECORD TEXT
SQL5011 30 173 Position 57 Host structure array JOB#DS not defined or
not usable.

I think Mr. Paris has a point about my DS array
being incorrectly defined - I was wondering myself
about "Position 57" but did not get the hint . . .

I need to return to this later due to deadline,
but do want/need to untangle my mess.

Thank you Scott and Jon !

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Mildenberger
Sent: Thursday, October 03, 2013 8:33 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: fetch cursor into DS array errors

What is your compile error? I wonder if the constant in the DIM is causing the pre-compiler to have a problem. Try putting 200 in there to see what happens.

Scott Mildenberger
Programmer/Analyst
Davis Transport Inc.
Missoula, MT
406-728-5510 x128


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary Thompson
Sent: Thursday, October 03, 2013 8:11 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: fetch cursor into DS array errors

Scott, my d specs (although I like yours better):
* Start: data to store F/S Cashless Vend "Job" Info ----------------------
D job#MaxC C const(200)
D job#Max S 5I 0 Inz(job#MaxC)
D job#@ S 5I 0 Inz(0)
D job#Rows S 5I 0 Inz(0)

D job#DS DS
D job# 29A DIM(job#MaxC)
D Fset 2A Overlay(job#:01)
D SetLoc 4A Overlay(job#:03)
D SetDat 7S 0 Overlay(job#:07)
D PrnNum 4A Overlay(job#:14)
D BatNum 3S 0 Overlay(job#:18)
D JobNum 6S 0 Overlay(job#:21)
D RecSta 3S 0 Overlay(job#:27)
* End : data to store F/S Cashless Vend "Job" Info ----------------------

and code:
Exec SQL
DECLARE job#Csr CURSOR FOR
SELECT DISTINCT
fset, setloc, setdat, prnnum,
1 AS batnum,
0 AS jobnum,
recsta
FROM fspost
WHERE recsta = 100
ORDER BY 1,2,3,4;

Exec SQL OPEN job#Csr;
If SQLCOD <> *Zero;
RtnCde = 'ERR ';
PgmMsg = 'Open job#Csr error in FSJOB01R.aaMain: ' + SqlState;
// ??? LeaveSR;
Endif;

Clear job#DS;

Exec SQL FETCH job#Csr FOR :job#Max ROWS INTO :job#DS;
job#Rows = Sqler3;

Thank you Scott!


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.