Problem:
Assuming that an Indexed datafile exists that you want to be able to look at without having to write a COBOL program read and display all the fields. This file may also include compressed fields etc.
Resolution:
Net Express has a tool called the Data File Editor which will allow you to look at such things as indexed files in a text editor style format.
It also displays compressed fields in numeric display format.
Firstly, for the Data File Editor to be able to read an indexed file it needs to have a file that specifies the layout of the file so it can mask the data.
The obvious thing it uses to create this is the FD as specified in your program.
To create this file do the following:
Open a project with a program that you know has the file you want to read specified in the FD.
Compile the program if it's not already compiled.
In the left hand pane of the project (i.e. Project View) right click on the program name .cbl (ie progname.cbl).
One of your options is 'Create Record Layout'
When you select that it will show 'Structures from progname.cbl' in the left hand column.
In that column it will show all the FD statements in that program.
Right click on the 01 level of the file layout you want.
Select 'New Layout'.
It will open a wizard - Select 'Default Layout'
Select 'Next' and then 'Finish.
In the right hand pane it should now show the layout from the FD you selected from the left hand pane.
From the menu bar at the top select 'File' > 'Save'.
It will default to something 'Layout.STR' - change this to the filename.STR and Save the file.
Important: if you don't save the STR file as the same name as the datafile it means you'll have to select an STR file each time you want to edit the datafile. If you save it with the same name it will use it automatically.
The STR file is the file that will now be used by the Data File Editor to mask the physical file. This therefore should remain in the project directory.
Now that the STR file has been created:
Back in the main project load the datafile (filename.dat & filename.idx) onto the right hand pane of the project (i.e. the project source pool).
Then, all you have to do is right click on the .dat file (or what ever extension you use for the data portion of the file) and select 'Edit'.
It brings up a box saying that changes to the file are automatically saved etc - click OK and it will show the file.
In the left hand pane it shows each record in unformatted mode. If you select a record it will show it in formatted mode in the right hand pane.
That's a very short version of how you can create the STR file and then view the file, all from within the IDE.
For more information on this and all the other features available select 'Help' in the Express IDE. Then select 'Help Topics' > 'Contents' > 'Using Net Express' > 'Working With Data Files'. The topics you'll most likely look at are 'Editing Data Files' and 'Working with Record Layouts'.
For a full overall description of the Data File Editor you'll need to go to the Net Express manuals. From within the IDE select ('Help' > 'Support' > 'SupportLine on the web' > 'Documentation' > 'Net Express 4.0'. When the Net Express 4.0 manual comes up select 'File Handling' and then 'Editing Data Files.