rspec/rules/S1633/rpg/rule.adoc

61 lines
1.3 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Both the name and the field definitions of a parameter 2 data area used in an ``++IN++`` should be coded in the ``++D++`` specification. This ensures that all definition data is kept together, and the specific data is not manually extracted in the code, thus making the code easier to read and maintain.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
D WSFD08 S 30A 0
C IN WSFD08
C MOVEL WSFD08 VAR9S
----
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
D WSFD08 S 30A 0
/free
in WSFD08;
/end-free
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
D WSFD08 DS 30 DTAARA(HEPDTAR005)
D W3SPNO 123 124B 0
D W3LNCT 367 368B 0
C IN WSFD08
----
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
D WSFD08 DS 30 DTAARA(HEPDTAR005)
D W3SPNO 123 124B 0
D W3LNCT 367 368B 0
/free
in WSFD08;
/end-free
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Define the data structure for this "IN" statement in its D spec
endif::env-github,rspecator-view[]