× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The IF begins in column 12 right after an ENDIF as:

IF blcode = 'Z';
ITER;
ENDIF;
IF blscd = 'XFT'
OR blscd = 'XEX';

The "IF blcode = 'Z'" code segment did not generate any kind of errors.
Once I changed the multi-line IF/OR to a single line (IF blscd = 'XFT' OR
blscd = 'XEX';) with the IF in the original position, the error went
bye-bye.

Jerry C. Adams
IBM i Programmer/Analyst
A woman's work is never done. Poor organization skills.
--
A&K Wholesale
Murfreesboro, TN
615-867-5070


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Monnier, Gary
Sent: Monday, October 24, 2011 11:27 AM
To: RPG programming on the IBM i / System i
Subject: RE: String Format Error

What column does the IF statement start in?

Maybe a line further up in the code is missing a semi-colon?

Gary

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jerry C. Adams
Sent: Monday, October 24, 2011 8:35 AM
To: RPG400-L
Subject: String Format Error

V5R1, member type = SQLRPGLE.



I am getting an RFN5501 error, such as:



034000 IF blscd = 'XFT'


*RNF5501 20 034000 The comment entry on a free-form calculation
is
not valid.

034100 OR blscd = 'XEX';




This one I can "fix" by putting the 'IF/OR' on the same line. But I've
used freeform 'OR' in RPGLE programs without an error.



Plus I'm getting it here:



042400 SQLString = 'SELECT blclas, bldate, blscd, +


042500 bltcd@, blamt, blsqty, blretp, +


042600 bldisc, blindx, bltxcd, bldesc, +


042700 blum, blprce, blcode FROM ' +


*RNF5501 20 042700 The comment entry on a free-form calculation
is
not valid.

042800 LINES +


*RNF5501 20 042800 The comment entry on a free-form calculation
is
not valid.

042900 ' WHERE blco = bnco +


043000 AND bldv = bndv +


043100 AND bldp = bndp +


043200 AND blglac = bnglac +


043300 AND blglsb = bnglsb +


043400 AND blcust = bncust +


043500 AND blspto = bnspto +


043600 AND bldate = bndate +


043700 AND blref# = bnref# +


043800 AND bljrcd = bnjrcd' +


*RNF5501 20 043800 The comment entry on a free-form calculation
is
not valid.

043900 ' ORDER BY blclas, blitm# for Read Only';




I got rid of the last one by changing it to:



AND bljrcd = bnjrcd ORDER BY blclas, blitm# for Read Only'; . Again, I
"fixed" the problem by changing the code to:



partA = 'SELECT blclas, bldate, blscd, +

bltcd@, blamt, blsqty, blretp, +

bldisc, blindx, bltxcd, bldesc, +

blum, blprce, blcode FROM ' ;

partB = ' WHERE blco = bnco +

AND bldv = bndv +

AND bldp = bndp +

AND blglac = bnglac +

AND blglsb = bnglsb +

AND blcust = bncust +

AND blspto = bnspto +

AND bldate = bndate +

AND blref# = bnref# +

AND bnjrcd = bnjrcd ORDER BY blclas, blitm# for Read Only';



SQLString = %trim(parta) + ' ' + LINES + ' ' + %trim(partb);



But I'm left wondering: Why? It's a Monday morning, but I've had my
allotted number of cups of coffee. The string with the error *looks*
like other, similar strings that I have formatted without an error, but
the old eye may be missing something. I read the ILE RPG Reference
manual and couldn't find anything that pointed me to the error of my
ways.



The error on the multi-line IF/OR, though, definitely doesn't appear to
be anything that I did wrong.



Comments on the "Comment" error?



Thanks.



Jerry C. Adams

IBM i Programmer/Analyst

I wanna get out of this rat race. The rats are winning.

--

A&K Wholesale

Murfreesboro, TN

615-867-5070



--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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.