Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Tdb 06-87 P.29-33 Data File Specification

IP.com Disclosure Number: IPCOM000039392D
Original Publication Date: 1987-Jun-01
Included in the Prior Art Database: 2005-Feb-01
Document File: 3 page(s) / 54K

Publishing Venue

IBM

Related People

Talley, TM: AUTHOR

Abstract

This article describes the use of the ISPF File Tailoring Facility as a method for storing data in a convenient and flexible manner and the use of a program to read the recorded data. The traditional method of storing data in a file is to specify field positions and lengths within a record, then write the record to the file. The major disadvantage of this method is that, each routine reading or writing data into the file must be modified if the data format changes, making maintenance costs high. This is particularly a problem when the data changes frequently, either in the number, length, or position of the fields. Using the IBM Program Product ISPF, along with a small amount of code, the maintenance effort can be significantly reduced.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 3

Tdb 06-87 P.29-33 Data File Specification

This article describes the use of the ISPF File Tailoring Facility as a method for storing data in a convenient and flexible manner and the use of a program to read the recorded data. The traditional method of storing data in a file is to specify field positions and lengths within a record, then write the record to the file. The major disadvantage of this method is that, each routine reading or writing data into the file must be modified if the data format changes, making maintenance costs high. This is particularly a problem when the data changes frequently, either in the number, length, or position of the fields. Using the IBM Program Product ISPF, along with a small amount of code, the maintenance effort can be significantly reduced. Rather than defining the data format in terms of field positions and lengths on a record, the data fields may be described as assignment statements in an ISPF skeleton. A sample skeleton is shown in Fig.
1. When preparing to write data to a file, the writing program assigns values to the variables to be stored, then uses the file tailoring commands of ISPF to write the data to a file via the skeleton model. ISPF inserts the values of the variables for the variable names. A sample data file produced from the skeleton is shown in Fig. 2. Note that the only difference between the skeleton and the data file is that ISPF has replaced in variable names (preceded by '&' in the skeleton) with the data held in those variables. Once the data has been put into a data file, Algorithm 1 in Fig. 3 provides a way to read the data from the file. The algorithm repeatedly reads lines from the data file while data remains in the file. The field name (i.e., the string to the left of '=' in the data file) is assigned to the variable 'varname', the '=' is assigned to the variable 'operator', and the remainder of the line is assigned to 'restofline'. The 'restofline' variable contains the actual data to be assigned to the field name. After reading the variables, Algorithm 1 determines whether the data line is a comment. For the sample data file in Fig. 2 comment lines are indicated by an '*' as the first character on a line. Comment lines are not evaluated. If the data line is not a comment, Algorithm 1 builds a command string, 'str', as an assignment statement appropriate for the source language. 'Str' is then evaluated as an executable line of code. Note that the programming language used to implement the algorithm must provide a method for building and executing a command string within the reading routine. Most interpreted languages (for example, LISP, LOGO, and...