The uppercase is an easy fix.

Go into preferences -> type "format" in the "type filter text" box -> select the Free-form SQL Formatting -> then unselect the Automatic uppercasing.

Does the program compile or verify? IE is the Exec SQL statement valid?

Also, is this an older workspace? IE was it used very early in the 9.6 versions? Could you try it in a new workspace after turning off the Automatic uppercasing?

RDi no longer has a setting to MOVE the SQL comments, but perhaps your workspace has a retained setting.

Steve Ferrell

-----Original Message-----
From: WDSCI-L <wdsci-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of x y
Sent: Tuesday, August 3, 2021 6:55 PM
To: Rational Developer for IBM i <wdsci-l@xxxxxxxxxxxxxxxxxx>
Subject: [WDSCI-L] Funny behavior in RDi/SQL formatter

External: Pause and review the sender's email address, any URLs before clicking links, opening attachments, or following requests. When in doubt, contact the Service Desk.

I start with a nice, clean piece of code in RDi running on an up-to-date Win10 Professional ThinkPad:

:ad1desc; --Description

if sqlstt = SQLGoodRead;
//Good read

qd1eff = zzr000_d8a(ad1eff);
qd1can = zzr000_d8a(ad1can);
qd1desc = ad1desc;

if %date >= ad1eff
and (%date <= ad1can or ad1can = d'0001-01-01');
*in52 = *on;
*in52 = *off;

s01rrn = s01rrn + 1;
//Subfile RRN

write r90wd01;


*in35 = *on;
// Turn off "More...



And press Ctrl+Shift+F and get this dog's breakfast of weird indenting and upper-cased opcodes:

:ad1desc; --Description

IF sqlstt = sqlgoodread; //Good read
qd1eff = zzr000_d8a(ad1eff);
qd1can = zzr000_d8a(ad1can);
qd1desc = ad1desc;
IF %date >= ad1eff
AND (%date <= ad1can
OR ad1can = d'0001-01-01')
*in52 = *ON;
*in52 = *off;
s01rrn = s01rrn + 1; //Subfile RRN
WRITE r90wd01;
ELSE; //Otherwise
*in35 = *ON; // Turn off "More...

CLOSE gpr90w_gpp090_cursor;

qpos01 = 1;

q_format = 'tag400';


The behavior is intermittent. The code is straightforward to the point of being boring and without any hinky formatting in previous lines. The problem is not resolved by a reboot. I have received messages indicating "indenting past column 80 not allowed" and that message appears to end the reformatting process (that problem was caused by a 3rd party conversion tool's problem with handling comments and indented code).

My guess is that the formatter doesn't know to quit when the last line of the program variables list has a comment, like this:
:ad1desc; --Description

Almost all of my SQL code is machine-generated and my programs may have broken a rule by having an SQL comment *after* the semicolon. Let's see if that's the cure.
This is the Rational Developer for IBM i (WDSCI-L) mailing list
To post a message email: WDSCI-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
or email: WDSCI-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at

Help support by shopping at with our affiliate

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