Since you are somewhat new to Natural, I will be careful to explain what this posting is all about. I typically use the term “batch index” (no. this is not a standard Software AG term), to indicate to what extent a program is “batch”. The index runs from 0 to 10. Zero is an online program. One is a program that could be online except for the existance of a single work file that contains some transaction records, of a single report that is being routed to a work file. Ten is a program that involves a bunch of input work files, and a bunch of output reports and perhaps many of these are used conditionally, etc. No, this is not a strict quantitative index, it is very much qualitative.
Suppose I have a one or a two. It is not difficult to transform such a program into an online program. For example, Suppose I have a single input workfile. I can define data such as:
1 #wf1-record (a300/1:5) init <'datadatadata '>
1 #wf1-index (i4)
1 #real-wf-record (a300)
Now, in my program, instead of a READ WORK FILE loop, I have something like
for #wf1-index = 1 to 5
move #wf1-record (#wf1-index) to #real-wf-record
and now you have the code that would have existed in the READ WORK FILE loop.
Ideally, all you have to do to restore this to a batch program is change the above two statements to a READ WORK FILE statement and change the end-for to an end-work.
Clearly, beyond a couple of work files, this starts to get unwieldy. But, if you are new to Natural, and are working with a low batch index, and want to get some practice using Natural’s debugger, this is a viable solution.