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



Gina, 
Also I tested this by simply stripping down everything from my program
and only working on the fields defined within the ds. So I could not
have defined the fields twice.  
Thanks,
Sudha

Sudha Ramanujan
SunGard Futures Systems
sramanujan@xxxxxxxxxxxxxxxxxx
(312) 577 6179
(312) 577 6101 - Fax


-----Original Message-----
From: Gina M Whitney [mailto:whitneyg@xxxxxxxxxx] 
Sent: Friday, February 11, 2005 10:37 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: sqlrpgle & copy book

Are you getting the SQL0312 for fields?  You defined your data structure
as
fieldDs.

dfieldDs    ds
d field1          5a
d field2         15p 2
d field3         30a

c/exec sql fetch next from c into :fields :myNullAry
c/end-exec


In V5R3, there is a new parameter called RPGPPOPT:

          RPG preprocessor options (RPGPPOPT) - Help
  Specifies if the RPG compiler will be called to preprocess
  the source member before the SQL precompile is run.
  Preprocessing the SQL source member will allow some
  compiler directives to be handled before the SQL
  precompile.  The preprocessed source will be placed in
  file QSQLPRE in QTEMP.  This source will be used for the
  SQL precompile.
  *NONE
      The compiler is not called for preprocessing.
   *LVL1
     The compiler is called for preprocessing to expand
     /COPY and handle the conditional compilation
     directives except the /INCLUDE directive.
   *LVL2
     The compiler will be called for preprocessing to
     expand /COPY and /INCLUDE and handle the conditional
     compilation directives.

So with *NONE, which is the default, the precompiler can handle
one level of /Copy and does not read /INCLUDE.


Another common reason for getting SQL0312 is that you have the host
variable
defined more than once.  The precompiler never has handled scoping of
variables
and requires all variables to be unique, even if they are in different
procedure.

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