Re: Are SQL statement lines limited to 80 characters ?

Daniel Gross <[email protected]>
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <[email protected]>
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 <[email protected]>:
> 
> 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 <[email protected]> On Behalf Of Richard Schoen
> Sent: Friday, February 6, 2026 12:45 PM
> To: [email protected]
> 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: [email protected]
> To subscribe, unsubscribe, or change list options,
> visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: [email protected]
> Before posting, please take a moment to review the archives
> at https://archive.midrange.com/rpg400-l.
> 
> Please contact [email protected] for any subscription related questions.
> 
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact [email protected] for any subscription related questions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.