The RPG reference says this:

-> https://www.ibm.com/docs/en/i/7.6.0?topic=functions-sql

And this:

-> https://www.ibm.com/docs/en/i/7.6.0?topic=specifications-free-form-statements#freestmt

The essence is:

- in **free there is no limitation of the statement length

- in /free (or "column-limited free-form source") everything after column 80 has to be preceded by // and therefore is a comment

So there shouldn't be a problem with source after column 80 in **free source.

Which error message is emitted by the pre-compiler? Does RDi flag the statement as invalid?

HTH
Daniel


Am 06.02.2026 um 19:15 schrieb Dan Bale via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx>:

I found a program in production that has **FREE at the top of the source and one SQL statement that extends to column 85.

Just remember that **FREE is different than /free. Someone can confirm/deny, but I think /free is still limited to 80 columns.

- Dan Bale

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Richard Schoen
Sent: Friday, February 6, 2026 12:45 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Are SQL statement lines limited to 80 characters ?

Maybe some of you already know this, but I just spent a couple hours debugging an SQL statement that worked great in ACS Run SQL but would not pass the SQLRPGLE pre-compiler test.

As it turns out I believe each line of an SQL statement can only be up to position 80 before you need to continue on the next line.

I read something that alluded specifying **free would allow longer lines, but that didn't seem to help.

Can someone tell me what the reality is for this ?

Am I limited to 80 line SQL statements in SQLRPGLE ?

Thanks

Regards,
Richard Schoen

*** CONFIDENTIALITY NOTICE: The information contained in this communication may be confidential, and is intended only for the use of the recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. ***
--
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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.