define data local
1 #name (a20)
1 #first (a20)
end-define
*
stack top data ‘smith’ ‘sally’
stack top data ‘jones’ ‘robert’
stack top data ‘garcia’ ‘jose’
*
read work file #name#first
repeat until *data = 0
input #name#first
write #name#first
end-work
end-repeat
end
Run the program. You will “pop” one record at a time off the Stack via the INPUT statement. I just comment out the READ WORK FILE and the END-WORK, and replace them with the INPUT and some sort of control (here i have just used *data for control). The control might also be at the end of the repeat loop, looking for some value of a field in the “record”.
You can intersperse “records” that are supposed to be coming from different workfiles.
The advantage of this is I get to debug online. I have always regarded debugging as best done interactively (probably due to spending too many years reading dumps).
SYSFILE simply displays the files defined in your Natparms. The WORK parameter is used to specify basic file properties, mostly for memory allocation at Natural start-up. Neither SYSFILE nor WORK is used to specify a file name. File names are defined to Natural via DDNAMEs in your JCL.
To use the Natural Debugger interactively for a batch run, logon to TSO, allocate your batch files (CMWKFnn), and then invoke Natural.
Is it something like
I need to have a JCL where in I will define my work files (input and output).
Then define the workfiles from JCL in the SYSFILE and starting Natural for interactive debugging?
I still have the confusion of the usage of SYSFILE.
Can somebody help me to understand it better. In the mean time I will go thru the Utilities Manual.
You invoke Natural. As it is initializing, a set of parameters (NatParms, for short) is read to customize the session. These NatParms are set up by your Natural Administrator.
The WORK and PRINT parameters define how many work files and print files will be available to your session. Each file defined will require a memory allocation. Some administrators limit the number of files to reduce Natural’s memory requirements. In one shop, I was limited to 3 work files in my Natural programs.
In your Natural code you refer to work and print files by number, 1 - 32 and 0 - 31, respectively. Natural translates these numbers to CMWKFnn and CMPRTnn, which match the DDNAMEs in your JCL. In your JCL you specify the external file name for the appropriate DDNAME.
SYSFILE will display how many work and print files are available to Natural. It does not let you define more files. It does not let you specify external file names. There is little need for you to use SYSFILE.