Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IBM says /DEFINE not supported in SQLRPGLE Programs

43 views
Skip to first unread message

SJ Lennon

unread,
Feb 23, 2000, 3:00:00 AM2/23/00
to
The word from IBM is that /DEFINE isn't supported in SQLRPGLE programs and
they have no plan to include it.

Here's a stripped down version that shows the problem:

SQLDEMO.SQLRPGLE is the program that tries to set the /DEFINE
CopyingPrototypes.

SQLERROR.SQLRPGLE is the program that tries to use the DEFINEd
CopyingPrptotypes to selectively include the prototype for SQLERROR.

SQLERROR_P.TXT is a prototype that can replace the /DEFINE logic in SQLDEMO
and make everything work, but I really don't want a seperate source file.

It seems curious that IBM doesn't have this supported. I'm debating whether
to ask for an enhancement.

SQLDEMO.SQLRPGLE
h dftactgrp(*no) actgrp(*caller)
h indent('| ')

/define CopyingPrototypes
/copy SQLError
/undefine CopyingPrototypes
*/copy SQLError_P

D CUNPC S 7
D PIDPC S 8 0
D Eof s n
D SQLDebug s 80
D EndCallSupport s 3 inz('ECS')

*=== Declare Cursor over MSSPICP ===================================
C/exec sql
C+ declare PicDateCursor cursor for
C+ select CUNPC, -- store
C+ PIDPC -- picture date
C+ from MSSPICP
C+ order by PIDPC desc
C+ for fetch only
C/end-exec

*=== Open Cursor over MSSPICP ======================================
C eval SQLDebug ='Open PicDateCursor'
C/exec sql open PicDateCursor
C/end-exec

C exsr SQLProblem
C eval *inlr = *on
*=== SQLProblem =====================================================
C SQLProblem begsr
C callp SQLERROR(SQLCA:
C EndCallSupport:
C SQLDebug)
C endsr

SQLERROR.SQLRPGLE
/if not defined(CopyingPrototypes)
/title SQLERROR: Handle Unexpected SQL Errors
H DftActGrp(*no) ActGrp('SQLERROR')
H Indent('| ')

*=== Files =========================================================
FSQLERRORW O F 133 PRINTER oflind(*INOV) usropn
/endif

*=== Prototype for SQLError ========================================
D SQLError PR extpgm('SQLERRORXX')
D SQLCA 136
D HowToEnd 3
D CallerIdent 80 options(*nopass)
/if defined(CopyingPrototypes)
/eof
/endif

*=== Constants and Work Fields ======================================
D JobIdent s 28

*=== Parameters =====================================================
D pSqlca s like(sqlca)
D pHowend s 3
D pID s 80

C *entry plist
C parm pSqlca
C parm pHowEnd
C parm pID

C eval SQLCA=pSqlca

*=== Setup up Debug Info to Print ===================================
C eval JobIdent = 'DummyText'
*=== Print SQLCA debug info =========================================
C open SQLERRORW
c except pNewPage

*=== Return Logic ===================================================
C eval *INLR=*ON

*=== SQLCA ==========================================================
* Code is not executable. It just defines the SQLCA area
C/EXEC SQL
C+ include sqlca
C/END-EXEC


*=== Print File =====================================================
OSQLERRORW E pNewPage 1 1
O 'Job:'
O JobIdent +1

SQLERROR_P.TXT
*=== Prototype for SQLError ========================================
D SQLError PR extpgm('SQLERROR')
D SQLCA 136
D HowToEnd 3
D CallerIdent 80 options(*nopass)


"Gary Guthrie" <GaryG...@home.com> wrote in message
news:38AD5FDA...@home.com...
> Conditional copy works with SQLRPGLE members. I see no PTF activity.
> Triple check your setup. Is the library list a potential problem?
>
> If you continue to have problems, let us see just what you have.
>
> Gary Guthrie
>
>
>
> SJ Lennon wrote:
> >
> > (Excuse me if this appears to be a duplicate posting. I don't seem to
see
> > my own posts with Outlook Express 5. Or maybe it is throwing away my
> > posts.)
> >
> > I'm trying to use a /DEFINE statement in an RPG IV SQL program. I try
to
> > compile it with the CRTSQLRPGI command. The SQL pre-compiler doesn't
seem
> > to set the variable and/or recognize it in the code that is copied in
with
> > the /COPY command. So instead of copying in just part of the code it
copies
> > in the entire source member. I've checked the manuals and haven't found
> > anything about this.
> >
> > Is this a known "feature" in V4R3? Is there perhaps a PTF at V4R3 that
will
> > fix the problem?
> >
> > Here's what I have in the source I'm trying to compile:
> >
> > 0001.00 h dftactgrp(*no) actgrp(*caller)
> > 0002.00 h indent('| ')
> > 0003.00 /copy RpgleHspec
> > 0004.00
> > 0005.00 /define CopyingPrototypes
> > 0006.00 /copy QSQLERR,SQLError
> > 0007.00 /undefine CopyingPrototypes
> >
> > At line 6, instead of just copying in a few lines from the SQLError
member,
> > it copies in the entire member. Naturally this causes all kinds of
errors.
> >
> > I know that I've got the SQLError member (the one I'm copying from) set
up
> > correctly, because if I use CRTBNDRPG instead of CRTSQLRPGI the copy is
done
> > correctly and I get the few lines that I want copied in. (Of course,
that
> > isn't an answer, since I don't get my SQL statements expanded.)

sqldemo.sqlrpgle
sqlerror.sqlrpgle
sqlerror_p.txt

SJ Lennon

unread,
Feb 23, 2000, 3:00:00 AM2/23/00
to
sqldemo.sqlrpgle
sqlerror.sqlrpgle
sqlerror_p.txt

Gary Guthrie

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to
I'm not buying that!

I think this might be pursuable as a bug. Here's why I think so.

I think you're getting clobbered by the /EOF directive in the copy
member. Can you confirm? You can tell by looking at your compile listing
and when the /EOF is found, nothing further is copied.

Try fashioning your copy member such that you don't need /EOF and see if
that works. /EOF is the only thing I've found so far that will cause a
problem with SQLRPGLE copy issues.

If this is the case, then it seems to me that the /EOF directive should
function the way it does for any other type of source member that issues
a /COPY. All /EOF is SUPPOSED to do is signal end of file for the
current member (member being copied, NOT the copying member).

Let me know what you find.

SJ Lennon

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to
Today our IBM support rep was trying to contact the original developer of
the pre-compiler. I may get into a conference call tomorrow. (I'm
presently working 3rd hand through one of our system programmers.)

Not sure what you mean about the /EOF. It never gets past the pre-compile
step so I don't get a compile listing. However, if I specify that I want
the pre-compiler output listed I see the entire copy member copied in. (I
verify tomorrow that I'm seeing that correctly.)

Sam

"Gary Guthrie" <GaryG...@home.com> wrote in message

news:38B564FC...@home.com...

Gary Guthrie

unread,
Feb 25, 2000, 3:00:00 AM2/25/00
to

What release are you running?

If you'd like, I can send you small test members and you can compile and
we can compare results. I DO get a listing.

Gary Guthrie

SJ Lennon

unread,
Feb 25, 2000, 3:00:00 AM2/25/00
to
We're on V4R3. Talked to IBM today, but are no further forward. Guy didn't
turn out to be a developer, but someone who seems to vet and schedule
enhancement requests. Didn't know what /COPY did. Didn't know RPG. So we
talked in circles. He is going to go back and confirm that either it isn't
supported or won't be, or that it is a bug, or that it is an oversight.
Don't expect anything back until the middle of next week at the earliest.

I tried replaceing the /EOF. It made no difference. I still get the entire
member copied in and the pre-compiler dies complaining that the
specifications are out of order.

Sure, send me the test members. I'll see what they do on our system. I've
attached a couple of demo files to this message that fail for me. Maybe you
can try them on your system if you have a minute.

Appreciate the help.

Cheers, Sam

"Gary Guthrie" <GaryG...@home.com> wrote in message

news:38B60AF4...@home.com...


>
>
> What release are you running?
>
> If you'd like, I can send you small test members and you can compile and
> we can compare results. I DO get a listing.
>

> Gary Guthrie
>
>
>
> SJ Lennon wrote:
> >

sqlerror.sqlrpgle
sqldemo.sqlrpgle

SJ Lennon

unread,
Feb 25, 2000, 3:00:00 AM2/25/00
to
We're on V4R3. Talked to IBM today, but are no further forward. Guy
didn't
turn out to be a developer, but someone who seems to vet and schedule
enhancement requests. Didn't know what /COPY did. Didn't know RPG. So
we
talked in circles. He is going to go back and confirm that either it
isn't
supported or won't be, or that it is a bug, or that it is an oversight.
Don't expect anything back until the middle of next week at the
earliest.

I tried replaceing the /EOF. It made no difference. I still get the
entire
member copied in and the pre-compiler dies complaining that the
specifications are out of order.

Sure, send me the test members. I'll see what they do on our system.
I've
attached a couple of demo files to this message that fail for me. Maybe
you
can try them on your system if you have a minute.

Appreciate the help.

Cheers, Sam

"Gary Guthrie" <GaryG...@home.com> wrote in message


news:38B60AF4...@home.com...
>
>
> What release are you running?
>
> If you'd like, I can send you small test members and you can compile
and
> we can compare results. I DO get a listing.
>

> Gary Guthrie
>
>
>
> SJ Lennon wrote:
> >

sqlerror.sqlrpgle
sqldemo.sqlrpgle

SJ Lennon

unread,
Feb 29, 2000, 3:00:00 AM2/29/00
to
We moved a machine to V4R4 over the weekend and I tried it there today.
Still get the same error.

Sam

"Gary Guthrie" <GaryG...@home.com> wrote in message

news:38B60AF4...@home.com...
>
>
> What release are you running?
>
> If you'd like, I can send you small test members and you can compile and
> we can compare results. I DO get a listing.
>

> Gary Guthrie
>
>
>
> SJ Lennon wrote:
> >

SJ Lennon

unread,
Feb 29, 2000, 3:00:00 AM2/29/00
to
I posted the following reply on Sunday, but I don't see it today, Tuesday.
Does/did anyone else see it? I haven't quite figured out if I'm losing
posts in this newsgroup, or if not, why I don't see them all.

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

We're on V4R3. Talked to IBM today, but are no further forward. Guy didn't
turn out to be a developer, but someone who seems to vet and schedule
enhancement requests. Didn't know what /COPY did. Didn't know RPG. So we
talked in circles. He is going to go back and confirm that either it isn't
supported or won't be, or that it is a bug, or that it is an oversight.
Don't expect anything back until the middle of next week at the earliest.

I tried replaceing the /EOF. It made no difference. I still get the entire
member copied in and the pre-compiler dies complaining that the
specifications are out of order.

Sure, send me the test members. I'll see what they do on our system. I've
attached a couple of demo files to this message that fail for me. Maybe you
can try them on your system if you have a minute.

Appreciate the help.

Cheers, Sam

"Gary Guthrie" <GaryG...@home.com> wrote in message


news:38B60AF4...@home.com...
>
>
> What release are you running?
>
> If you'd like, I can send you small test members and you can compile and
> we can compare results. I DO get a listing.
>

> Gary Guthrie
>
>
>
> SJ Lennon wrote:
> >

SJ Lennon

unread,
Mar 6, 2000, 3:00:00 AM3/6/00
to
Here's IBM's response, as paraphrased by our system programmer:

"The word from IBM is that function is not supported, there is no plan to
support that function and they are updating the V5R1 manuals to reflect the
fact that it will not work."

I'm not happy!

Sam

"SJ Lennon" <no...@none.com> wrote in message
news:#9LZfOyg$GA.248@cpmsnbbsa05...


> We moved a machine to V4R4 over the weekend and I tried it there today.
> Still get the same error.
>
> Sam
>

> "Gary Guthrie" <GaryG...@home.com> wrote in message

> news:38B60AF4...@home.com...
> >
> >
> > What release are you running?
> >
> > If you'd like, I can send you small test members and you can compile and
> > we can compare results. I DO get a listing.
> >

> > Gary Guthrie
> >
> >
> >
> > SJ Lennon wrote:
> > >

Gary Guthrie

unread,
Mar 7, 2000, 3:00:00 AM3/7/00
to
Let me see what I can shake up. I don't know if I can have any
influence, but I will certainly give it a try.

Gary Guthrie

SJ Lennon

unread,
Mar 7, 2000, 3:00:00 AM3/7/00
to
I posted two very short programs to demonstrate the problem on the News/400
RPG forum on Tuesday morning.

I want to be sure that I'm not doing something wrong and also sure that IBM
knows what they are talking about. The "developer" I talked to didn't
inspire me with confidence. If he'd know what /COPY was I'd have felt a
little better.

Sam

"Gary Guthrie" <GaryG...@home.com> wrote in message

news:38C50EE3...@home.com...


> Let me see what I can shake up. I don't know if I can have any
> influence, but I will certainly give it a try.
>

> Gary Guthrie
>
>
>
> SJ Lennon wrote:
> >

Gary Guthrie

unread,
Mar 8, 2000, 3:00:00 AM3/8/00
to
Sam,

There may be hope. My fine friends at IBM are looking into things and
will report back to me. Keep your fingers crossed.

As I said previously, the problem is that the /EOF declarative is
causing the problem in that SQLRPGLE doesn't handle it properly.
Preliminary indications are that SQL prep is ignoring /EOF and that's
causing the compiler to stop because /EOF gets copied into the main
source!

Gary Guthrie
REAL Technical Support
Technical Editor, NEWS/400 magazine

SJ Lennon

unread,
Mar 8, 2000, 3:00:00 AM3/8/00
to
Appreciate the help. It looks like you've got better contacts in IBM than
we have and we pay a hefty service contract.

As for the /EOF, the code I posted on the News/400 forum doesn't have a /EOF
in it and it doesn't work either. Frankly, I afraid that there just might
not be any conditional support in the precompiler.

Sam

"Gary Guthrie" <GaryG...@home.com> wrote in message

news:38C6A959...@home.com...

0 new messages