defining files in SYSFILE

Hi,

There has been a discussion about batch debugger and the last post was by Steve suggesting to define STACK the records and use the online debugger.

Can some one help me by giving some inputs about defining the files in SYSFILE and using the batch natural program debugging?

also the option to do this by STACKing the records

Thanks in Advance,
Mishra

Stacking Data is easy:

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).

steve

Hi Steve,

Thank you for your quick response though I checked little late.

Its nice to know about this option. Its helpful when the input file length is of short length.

But what I think is when the input file record length is very large, its better to define the fines in SYSFILE and debug the program in online.

Can you please throw some light on how can I achieve this using SYSFILE?

thanks,
Mishra

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.

Hi,

I did not get a clear view of the idea.

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.

Thanks,
Mishra

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.