rspec/rules/S2033/rpg/rule.adoc

40 lines
792 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Because library names could change from environment to environment, they should never be hard-coded in a program. Instead, you should use a variable to specify the library name and set that variable with data external to the program.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
CLRPFM FILE(XPJLIB/FILE01)
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
CHGVAR VAR(&LIB01) VALUE(&PREFIX *CAT 'LIB')
CLRPFM FILE(&LIB01/FILE01)
----
2021-04-28 16:49:39 +02:00
== Exceptions
Hard-coding references to QTEMP, which is a temporary library, is allowed.
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]