|
Right.... Well... Yes... "adopt, adept and improvise" as someone said... I have to say I am a bit disappointed with IBM in this respect.. I had hoped that the precompiler had a bit more knowledge about the scope of variables. The raising of the compile-bar is something that can be considered, however... Wouldn't that possibly introduce other errors through the back-door? I don't quite get your remark about changing the contents of a CONST variable.. Where does this change take place then? In my view I am not trying to change the variable, I am using that variable rather: passing it on. Cor
-----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Wilt, Charles Sent: maandag 13 november 2006 14:42 To: RPG programming on the AS400 / iSeries Subject: RE: It must be Monday, what have I done now?Don't tell me that the RPG Pre-compiler has absolutely noknowledge ofglobal and local variables (there are other procedures present all using the same parameter names).Sorry, but that's exactly the problem. You can use local variables, but they have to be unique or they have to be defined the same as any other occurrences.From the v5r3 manual:Names in ILE RPG for iSeries applications that use SQL Any valid ILE RPG for iSeries variable name can be used for a host variable with the following restrictions. - Do not use host variable names or external entry names that begin with the characters 'SQ', 'SQL', 'RDI', or 'DSN'. These names are reserved for the database manager. - The length of host variable names is limited to 64. v The names of host variables should be unique within the program. If the same name is used for more than one variable and the data types are different, the data type of the host variable is unpredictable.From the v5r4 manual:Names in ILE RPG applications that use SQL Any valid ILE RPG variable name can be used for a host variable with the following restrictions. - Do not use host variable names or external entry names that begin with the characters SQ, SQL, RDI, or DSN. These names are reserved for the database manager. - The length of host variable names is limited to 64. v The names of host variables must be unique within the program. The one exception is that if a stand-alone field, parameter, or both, are defined exactly the same as another stand-alone field, parameter, or both, the duplicated name is accepted. - If a host variable is a duplicated name and does not belong to the exceptional category mentioned in the previous item, but does have the same type, the precompiler issues SQL0314 as a severity 11 error instead of its normal severity of 35. If you want to ignore these severity 11 errors, change the GENLVL parameter value on the CRTSQLRPGI command to be 11 or higher. Also, note that in your code you're attempting to use a CONST parm as a host variable. Even if you satisfied the SQL pre-compiler, the RPG complier would complain since you'd be attempting to change the value of a CONST parameter. HTH, Charles Wilt -- iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 -- This is the RPG programming on the AS400 / iSeries (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.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
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.