|
To me it looks like you will be better of by creating stored procedures or
UDTF... This is exactly what they are therefore.
lør. 9. maj 2020 kl. 13.18 skrev Reeve <rfritchman@xxxxxxxxx>:
I'm trying to stack multiple INCLUDE's to generate static SQL. The goalis
to move common code out of the application source and into copy books forincludes
ease of development and maintenance. I have a need to include a JOIN in
some cases, and while I could simply have two versions of a single
consolidated copy book (one with the join and one without), that solution
doesn't appeal to me.
This is the first copy book:
EXEC SQL
SELECT cmcust INTO :cmcust FROM arp001
and this is the second:
WHERE cmstat = 'A'
and this is the third:
AND CMCLS = 'R'
...and there will be additional selections.
Here's what the code might look like:
/include qcpysrc,testcopy1
JOIN arp002 ON cmcust = nmcust
/include qcpysrc,testcopy2
/include qcpysrc,testcopy3
and cmcls = 'R' and nmtype = '2';
The source out of the preprocessor includes an /END-FREE and the compiler
tags the "-" in column 11 as an error even when the source member
a /FREE in it. The first SQL line isn't terminated so the preprocessoris
likely not looking for an /END-FREE.still
Position 11 Token - was not valid. Valid tokens: FOR USE
When I've added a /FREE statement to these source members, the error
appears. I've tried COPY as well; still getting errors in thepreprocessor
output. Using RPGPPOPT(*LVL2) and V7R3M0.--
I'll be grateful for any ideas!
Stay safe and stay healthy.
-reeve
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
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.