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



I close the cursor elsewhere.

Thanks,

Mark

Mark D. Walter
Senior Programmer/Analyst
CCX, Inc.
mwalter@xxxxxxxxxx
http://www.ccxinc.com


                                                                                
                                                        
                      "Kimaly Mayhew"                                           
                                                        
                      <kmayhew@maxwellsh        To:       
<rpg400-l@xxxxxxxxxxxx>                                                       
                      oe.com>                   cc:                             
                                                        
                      Sent by:                  Subject:  RE: RE: Problem w/SQL 
                                                        
                      rpg400-l-bounces@m                                        
                                                        
                      idrange.com                                               
                                                        
                                                                                
                                                        
                                                                                
                                                        
                      07/28/2004 09:35                                          
                                                        
                      AM                                                        
                                                        
                      Please respond to                                         
                                                        
                      RPG programming on                                        
                                                        
                      the AS400 /                                               
                                                        
                      iSeries                                                   
                                                        
                                                                                
                                                        
                                                                                
                                                        




Mark,

Could part of your problem be that you aren't closing the cursor?

Kim

-----Original Message-----
From: rpg400-l-request@xxxxxxxxxxxx
[mailto:rpg400-l-request@xxxxxxxxxxxx]
Sent: Wednesday, July 28, 2004 8:55 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: RPG400-L Digest, Vol 3, Issue 551

Send RPG400-L mailing list submissions to
             rpg400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
             http://lists.midrange.com/mailman/listinfo/rpg400-l
or, via email, send a message with subject or body 'help' to
             rpg400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
             rpg400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of RPG400-L digest..."


Today's Topics:

   1. RE: Problem w/SQL (CWilt@xxxxxxxxxxxx)
   2. RE: Problem w/SQL (Dan Bale)
   3. RE: Problem w/SQL (Jeff Crosby)
   4. RE: Problem w/SQL (mwalter@xxxxxxxxxxxxxxx)
   5. RE: Problem w/SQL (mwalter@xxxxxxxxxxxxxxx)
   6. RE: Problem w/SQL (CWilt@xxxxxxxxxxxx)
   7. RE: Problem w/SQL (CWilt@xxxxxxxxxxxx)


----------------------------------------------------------------------

message: 1
date: Wed, 28 Jul 2004 08:32:17 -0400
from: CWilt@xxxxxxxxxxxx
subject: RE: Problem w/SQL

Mark,

At first glance, I don't see anything pooping out at me.

What's the compiler error message and which line is it complaining
about?

Charles


> -----Original Message-----
> From: mwalter@xxxxxxxxxxxxxxx [mailto:mwalter@xxxxxxxxxxxxxxx]
> Sent: Wednesday, July 28, 2004 8:25 AM
> To: RPG programming on the AS400 / iSeries
> Subject: Problem w/SQL
>
>
>
> Could someone explain to me why this compiles?
>
>      DdsData           ds            83    occurs(10000) based(p_data)
>      d ds_cusno                       8  0 overlay(dsData:*next)
>      d ds_cusnn                      35    overlay(dsData:*next)
>      D ds_invdat                      8  0 overlay(dsData:*next)
>      D ds_actDte                      8  0 overlay(dsData:*next)
>      d ds_ordno                       6  0 overlay(dsData:*next)
>      D ds_ordlv                       2  0 overlay(dsData:*next)
>      D ds_invno                       6  0 overlay(dsData:*next)
>      D ds_msrshp                     10  3 overlay(dsData:*next)
>
>      PgetMTDDBI        b                   export
>      DgetMTDDBI        PI              *
>      D numRecs                        5i 0
>      D itnbr                         15    const
>      d fclyr                          4  0 const
>      d fclmo                          2  0 const
>
>      Dsize             S             10i 0
>      Dx                S              5i 0
>
>      C/exec sql
>      c+ SELECT DISTINCT COUNT(*) INTO :numRecs
>      c+  FROM Oedhst
>      c+  WHERE cuscl NOT IN ('ZC','ZH')
>      C+  AND house NOT IN ('8','Y')
>      C+  AND itnbr = :itnbr
>      C+  AND fclyr = :fclyr
>      C+  AND fclmo = :fclmo
>      c/end-exec
>
>      c                   if        numRecs = 0
>      C                   return    *null
>      c                   endif
>
>      C                   eval      size = %size(dsData) * numRecs
>      C                   alloc     size          p_data
>
>      c/exec sql
>      c+ DECLARE c CURSOR FOR
>      C+  SELECT b.cusno,b.cusnm,a.invdat,b.actdte,
>      c+         b.ordno,b.ordlv,b.invno,a.msrshp
>      c+  FROM Oedhst a JOIN Oehhst b
>      c+  ON a.ordno = b.ordno
>      c+  AND a.ordlv = b.ordlv
>      C+  WHERE a.fclyr = :fclyr
>      C+  AND   a.fclmo = :fclmo
>      c+  AND   a.itnbr = :itnbr
>      c+  AND   b.cuscl NOT IN ('ZH','ZC')
>      c+  AND   a.house NOT IN ('8','Y')
>      C+  ORDER BY  invdat,ordno,ordlv
>      c/end-exec
>
>      c/exec sql
>      c+ OPEN c
>      c/end-exec
>
>      c                   for       x = 1 to numRecs
>
>      c     x             occur     dsData
>
>      c/exec sql
>      c+ FETCH c  into :dsData
>      c/end-exec
>
>      c                   endfor
>
>      c/exec sql
>      c+ CLOSE c
>      c/end-exec
>
>      c                   return    p_data
>      P                 E
>
>
> And This doesn't:
>
>      DdataDS           DS            23    occurs(15)
>      D dsItnbr                       15    overlay(dataDS:*next)
>      D dsWkctr                        5    overlay(dataDS:*next)
>      D dsCpfSeq                       3  0 overlay(dataDS:*next) INZ
>
>      PbuildCursor      b
>      DbuildCursor      PI
>
>      C/exec sql
>      C+ DECLARE c1 CURSOR FOR
>      C+  SELECT DISTINCT itnbr,wkctr,cpfseq
>      C+   FROM Cpfpf
>      C/end-exec
>
>      C/exec sql
>      C+ OPEN c1
>      C/end-exec
>
>      P                 E
>
>      PloadSubfile      B
>      DloadSubfile      PI
>
>      Dx                S             10i 0
>
>      C/exec sql
>      C+ FETCH FROM c1 FOR 15 ROWS INTO :datads
>      C/end-exec
>
>       ...
>
> Thanks,
>
> Mark
>
> Mark D. Walter
> Senior Programmer/Analyst
> CCX, Inc.
> mwalter@xxxxxxxxxx
> http://www.ccxinc.com
>
>
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L)
> mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>


------------------------------

message: 2
date: Wed, 28 Jul 2004 08:42:34 -0400
from: "Dan Bale" <dbale@xxxxxxxxxxxxx>
subject: RE: Problem w/SQL

> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx / CWilt@xxxxxxxxxxxx
> Sent: Wednesday, July 28, 2004 8:32 AM
>
> At first glance, I don't see anything pooping out at me.

Oooooh, really bad "visual" moment.

<g>

db


------------------------------

message: 3
date: Wed, 28 Jul 2004 07:42:43 -0500
from: "Jeff Crosby" <jlcrosby@xxxxxxxxxxxxxxxx>
subject: RE: Problem w/SQL

> At first glance, I don't see anything pooping out at me.

Well that's good.  I wouldn't wish that on anybody.  <g>

--
Jeff Crosby
Dilgard Frozen Foods, Inc.
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531

The opinions expressed are my own and not necessarily the opinion of my
company.  Unless I say so.





------------------------------

message: 4
date: Wed, 28 Jul 2004 08:45:00 -0400
from: mwalter@xxxxxxxxxxxxxxx
subject: RE: Problem w/SQL


Telling me that :datads is not defined or not usable.

Thanks,

Mark

Mark D. Walter
Senior Programmer/Analyst
CCX, Inc.
mwalter@xxxxxxxxxx
http://www.ccxinc.com




                      CWilt@xxxxxxxxxxxx

                      Sent by:                  To:
rpg400-l@xxxxxxxxxxxx

                      rpg400-l-bounces@m        cc:

                      idrange.com               Subject:  RE: Problem
w/SQL




                      07/28/2004 08:32

                      AM

                      Please respond to

                      RPG programming on

                      the AS400 /

                      iSeries









Mark,

At first glance, I don't see anything pooping out at me.

What's the compiler error message and which line is it complaining
about?

Charles


> -----Original Message-----
> From: mwalter@xxxxxxxxxxxxxxx [mailto:mwalter@xxxxxxxxxxxxxxx]
> Sent: Wednesday, July 28, 2004 8:25 AM
> To: RPG programming on the AS400 / iSeries
> Subject: Problem w/SQL
>
>
>
> Could someone explain to me why this compiles?
>
>      DdsData           ds            83    occurs(10000) based(p_data)
>      d ds_cusno                       8  0 overlay(dsData:*next)
>      d ds_cusnn                      35    overlay(dsData:*next)
>      D ds_invdat                      8  0 overlay(dsData:*next)
>      D ds_actDte                      8  0 overlay(dsData:*next)
>      d ds_ordno                       6  0 overlay(dsData:*next)
>      D ds_ordlv                       2  0 overlay(dsData:*next)
>      D ds_invno                       6  0 overlay(dsData:*next)
>      D ds_msrshp                     10  3 overlay(dsData:*next)
>
>      PgetMTDDBI        b                   export
>      DgetMTDDBI        PI              *
>      D numRecs                        5i 0
>      D itnbr                         15    const
>      d fclyr                          4  0 const
>      d fclmo                          2  0 const
>
>      Dsize             S             10i 0
>      Dx                S              5i 0
>
>      C/exec sql
>      c+ SELECT DISTINCT COUNT(*) INTO :numRecs
>      c+  FROM Oedhst
>      c+  WHERE cuscl NOT IN ('ZC','ZH')
>      C+  AND house NOT IN ('8','Y')
>      C+  AND itnbr = :itnbr
>      C+  AND fclyr = :fclyr
>      C+  AND fclmo = :fclmo
>      c/end-exec
>
>      c                   if        numRecs = 0
>      C                   return    *null
>      c                   endif
>
>      C                   eval      size = %size(dsData) * numRecs
>      C                   alloc     size          p_data
>
>      c/exec sql
>      c+ DECLARE c CURSOR FOR
>      C+  SELECT b.cusno,b.cusnm,a.invdat,b.actdte,
>      c+         b.ordno,b.ordlv,b.invno,a.msrshp
>      c+  FROM Oedhst a JOIN Oehhst b
>      c+  ON a.ordno = b.ordno
>      c+  AND a.ordlv = b.ordlv
>      C+  WHERE a.fclyr = :fclyr
>      C+  AND   a.fclmo = :fclmo
>      c+  AND   a.itnbr = :itnbr
>      c+  AND   b.cuscl NOT IN ('ZH','ZC')
>      c+  AND   a.house NOT IN ('8','Y')
>      C+  ORDER BY  invdat,ordno,ordlv
>      c/end-exec
>
>      c/exec sql
>      c+ OPEN c
>      c/end-exec
>
>      c                   for       x = 1 to numRecs
>
>      c     x             occur     dsData
>
>      c/exec sql
>      c+ FETCH c  into :dsData
>      c/end-exec
>
>      c                   endfor
>
>      c/exec sql
>      c+ CLOSE c
>      c/end-exec
>
>      c                   return    p_data
>      P                 E
>
>
> And This doesn't:
>
>      DdataDS           DS            23    occurs(15)
>      D dsItnbr                       15    overlay(dataDS:*next)
>      D dsWkctr                        5    overlay(dataDS:*next)
>      D dsCpfSeq                       3  0 overlay(dataDS:*next) INZ
>
>      PbuildCursor      b
>      DbuildCursor      PI
>
>      C/exec sql
>      C+ DECLARE c1 CURSOR FOR
>      C+  SELECT DISTINCT itnbr,wkctr,cpfseq
>      C+   FROM Cpfpf
>      C/end-exec
>
>      C/exec sql
>      C+ OPEN c1
>      C/end-exec
>
>      P                 E
>
>      PloadSubfile      B
>      DloadSubfile      PI
>
>      Dx                S             10i 0
>
>      C/exec sql
>      C+ FETCH FROM c1 FOR 15 ROWS INTO :datads
>      C/end-exec
>
>       ...
>
> Thanks,
>
> Mark
>
> Mark D. Walter
> Senior Programmer/Analyst
> CCX, Inc.
> mwalter@xxxxxxxxxx
> http://www.ccxinc.com
>
>
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L)
> mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.








------------------------------

message: 5
date: Wed, 28 Jul 2004 08:45:24 -0400
from: mwalter@xxxxxxxxxxxxxxx
subject: RE: Problem w/SQL


LOL

Thanks,

Mark

Mark D. Walter
Senior Programmer/Analyst
CCX, Inc.
mwalter@xxxxxxxxxx
http://www.ccxinc.com




                      "Dan Bale"

                      <dbale@xxxxxxxxxxx        To:       "RPG
programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>

                      om>                       cc:

                      Sent by:                  Subject:  RE: Problem
w/SQL
                      rpg400-l-bounces@m

                      idrange.com





                      07/28/2004 08:42

                      AM

                      Please respond to

                      RPG programming on

                      the AS400 /

                      iSeries









> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx / CWilt@xxxxxxxxxxxx
> Sent: Wednesday, July 28, 2004 8:32 AM
>
> At first glance, I don't see anything pooping out at me.

Oooooh, really bad "visual" moment.

<g>

db
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.








------------------------------

message: 6
date: Wed, 28 Jul 2004 08:52:55 -0400
from: CWilt@xxxxxxxxxxxx
subject: RE: Problem w/SQL

Is it by chance defined in a procedure?

the SQL precompiler only works with global variables.

Charles


> -----Original Message-----
> From: mwalter@xxxxxxxxxxxxxxx [mailto:mwalter@xxxxxxxxxxxxxxx]
> Sent: Wednesday, July 28, 2004 8:45 AM
> To: RPG programming on the AS400 / iSeries
> Subject: RE: Problem w/SQL
>
>
>
> Telling me that :datads is not defined or not usable.
>
> Thanks,
>
> Mark
>
> Mark D. Walter
> Senior Programmer/Analyst
> CCX, Inc.
> mwalter@xxxxxxxxxx
> http://www.ccxinc.com
>
>
>
>
>
>                       CWilt@xxxxxxxxxxxx
>
>
>                       Sent by:                  To:
> rpg400-l@xxxxxxxxxxxx
>
>                       rpg400-l-bounces@m        cc:
>
>
>                       idrange.com               Subject:  RE:
> Problem w/SQL
>
>
>
>
>
>
>
>                       07/28/2004 08:32
>
>
>                       AM
>
>
>                       Please respond to
>
>
>                       RPG programming on
>
>
>                       the AS400 /
>
>
>                       iSeries
>
>
>
>
>
>
>
>
>
>
>
>
> Mark,
>
> At first glance, I don't see anything pooping out at me.
>
> What's the compiler error message and which line is it
> complaining about?
>
> Charles
>


------------------------------

message: 7
date: Wed, 28 Jul 2004 08:53:08 -0400
from: CWilt@xxxxxxxxxxxx
subject: RE: Problem w/SQL

Well hey, what can I say...

obviously the compiler is crapping out on the OP. <grin>

Just as obvious, iSeries programmers really wanted to be comedians!

Charles

> -----Original Message-----
> From: Jeff Crosby [mailto:jlcrosby@xxxxxxxxxxxxxxxx]
> Sent: Wednesday, July 28, 2004 8:43 AM
> To: 'RPG programming on the AS400 / iSeries'
> Subject: RE: Problem w/SQL
>
>
> > At first glance, I don't see anything pooping out at me.
>
> Well that's good.  I wouldn't wish that on anybody.  <g>
>
> --
> Jeff Crosby
> Dilgard Frozen Foods, Inc.
> P.O. Box 13369
> Ft. Wayne, IN 46868-3369
> 260-422-7531
>


------------------------------

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) digest
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



End of RPG400-L Digest, Vol 3, Issue 551
****************************************



--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.







As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.