rspec/rules/S2794/rpg/rule.adoc

33 lines
943 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
The use of a result data structure with file I/O improves performance because it moves the data in one large block from file to data structure (or vice versa) rather than field by field.
Additionally using a data structure can limit the problems caused by having bad data in a file. Without a data structure, the entire ``++READ++`` operation will fail at the first bad value. With one, the error comes only when the bad field is used.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
F MyFile IF E Disk
* Noncompliant
C READ Record1
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
F MyFile IF E Disk
D InputData DS LikeRec(Record1)
C READ Record1 InputData
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]