A VSAM PL/I interface

Brian S. Ramsey, R. Cannon
{"title":"A VSAM PL/I interface","authors":"Brian S. Ramsey, R. Cannon","doi":"10.1145/503643.503703","DOIUrl":null,"url":null,"abstract":"The IBM Language Reference Manual for the PL/I Optimizing Compiler states that an interface for using Virtual Storage Access Method (VSAM) data sets exists. It places no restrictions on what can be done other than to say that VSAM data sets should be treated just as Indexed Sequential Access Method (ISAM) data sets. At least that is how it is supposed to work. In working with VSAM clusters and related components, however, the PL/I interface did not function as expected. A brief background on how this problem was discovered and a description of the error will be presented. In addition, the description of a new interface and its advantages and disadvantages will be presented. The system on which the development was performed is an IBM S/370-]68 running under MVS release 3.7E. Release 3.0 of the PL/I Optimizing Compiler was the subject of the work. Brian S. Ramsey is currently a cadet in the Air Force ROTC program. Approximately one year ago, he attempted to revise the cadet administration programs. At that time, the programs were designed to run with ISAM data sets, ISAM providing keyed access to the cadet records. In addition to the primary data set, two other ISAM data sets were used as inverted files to maintain secondary keys. The Virtual Storage Access Method allows the representation of an indexed sequential file, thus providing keyed and sequential access on the primary key, together with the capability to define secondary keys and to access records on those keys. By using VSAM rather than ISAM, the primary data set and the two data sets used for secondary access could be merged into a single VSAM data set. In this manner, maintenance of the directories for secondary access, until then the responsibility of the application program, would be transferred to the access method. In order to effect the transfer it was necessary to create a VSAM base cluster and two alternate indexes. After designing the initial specifications, the VSAM cluster was built and loaded. The alternate indexes were then built and related to the base cluster. The next step was to design programs to test the feasibility of using VSAM. It was during this phase that the bug was discovered. The program to test the Alternate Indexes opened the file for direct access using the following declare statement: DCL VS FILE DIRECT KEYED UPDATE ENV(VSAM); The file could not be opened. The reason given was that the Alternate Index was an organization incapable of direct keyed access. No reason could be found in the manuals for this type of error, so a small assembler language program was written to determine whether direct keyed access through an alternate index could be achieved. Using identically coded Access Control Blocks (ACBs),the program opened, used keyed access to read a record, and closed both the base cluster and one alternate index. No error occurred during this test. This experiment would seem to indicate that the PL/I interface has difficulty recognizing alternate indexes. The use of VSAM Alternate Indexes should be transparent to the user. Transparency was one of the principal reasons for creating alternate indexes. If the use is not transparent to the user, or if the user must make special allowances for the use of an alternate index, then why not just leave the alternate indes as a VSAM base cluster? When coding in assembler language, the use of alternate indexes is transparent to the programmer. This should also hold true for the higher level languages. Since PL/I did not meet this standard, the need for a better interface between VSAM and PL/I became apparent. The new interface was designed to make its use simple and similar to existing PL/I file operations. The interface could be accessed by the \"CALL\" statement in PL/I, in much the same manner as a call from PL/I to IMS. The user of this interface, though, would have a symbolic macro facility available to him to ease the coding of the subroutine calls. The macro expansion would be accomplished using the PL/I preprocessor facility. The interface was designed to consist of a series of modules that would use PL/I control blocks and structures as much as possible. The most interesting and perhaps challenging aspect of the interface was the manner in which it would handle errors. Normally, one would design a module to return a condition code indicating success or failure of the module's function. This would require a test after each subroutine call to check whether the request was satisfied or not. While this is not a bad method of checking for errors, the handling of errors by the interface would ideally be done using PL/I's own error handler. When any one of the interface I/O routines detects an error, a call is made to the interface error handler. The interface error handler then, if possible, translates the error into a PI/I oncode. Any errors which cannot be translated into PL/I on-conditions are to be translated into the ERROR on-code. Once the error has been translated, a parameter list is set up and a call is made to PL/I's error handler. This permits the","PeriodicalId":166583,"journal":{"name":"Proceedings of the 16th annual Southeast regional conference","volume":"4 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1978-04-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 16th annual Southeast regional conference","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/503643.503703","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

The IBM Language Reference Manual for the PL/I Optimizing Compiler states that an interface for using Virtual Storage Access Method (VSAM) data sets exists. It places no restrictions on what can be done other than to say that VSAM data sets should be treated just as Indexed Sequential Access Method (ISAM) data sets. At least that is how it is supposed to work. In working with VSAM clusters and related components, however, the PL/I interface did not function as expected. A brief background on how this problem was discovered and a description of the error will be presented. In addition, the description of a new interface and its advantages and disadvantages will be presented. The system on which the development was performed is an IBM S/370-]68 running under MVS release 3.7E. Release 3.0 of the PL/I Optimizing Compiler was the subject of the work. Brian S. Ramsey is currently a cadet in the Air Force ROTC program. Approximately one year ago, he attempted to revise the cadet administration programs. At that time, the programs were designed to run with ISAM data sets, ISAM providing keyed access to the cadet records. In addition to the primary data set, two other ISAM data sets were used as inverted files to maintain secondary keys. The Virtual Storage Access Method allows the representation of an indexed sequential file, thus providing keyed and sequential access on the primary key, together with the capability to define secondary keys and to access records on those keys. By using VSAM rather than ISAM, the primary data set and the two data sets used for secondary access could be merged into a single VSAM data set. In this manner, maintenance of the directories for secondary access, until then the responsibility of the application program, would be transferred to the access method. In order to effect the transfer it was necessary to create a VSAM base cluster and two alternate indexes. After designing the initial specifications, the VSAM cluster was built and loaded. The alternate indexes were then built and related to the base cluster. The next step was to design programs to test the feasibility of using VSAM. It was during this phase that the bug was discovered. The program to test the Alternate Indexes opened the file for direct access using the following declare statement: DCL VS FILE DIRECT KEYED UPDATE ENV(VSAM); The file could not be opened. The reason given was that the Alternate Index was an organization incapable of direct keyed access. No reason could be found in the manuals for this type of error, so a small assembler language program was written to determine whether direct keyed access through an alternate index could be achieved. Using identically coded Access Control Blocks (ACBs),the program opened, used keyed access to read a record, and closed both the base cluster and one alternate index. No error occurred during this test. This experiment would seem to indicate that the PL/I interface has difficulty recognizing alternate indexes. The use of VSAM Alternate Indexes should be transparent to the user. Transparency was one of the principal reasons for creating alternate indexes. If the use is not transparent to the user, or if the user must make special allowances for the use of an alternate index, then why not just leave the alternate indes as a VSAM base cluster? When coding in assembler language, the use of alternate indexes is transparent to the programmer. This should also hold true for the higher level languages. Since PL/I did not meet this standard, the need for a better interface between VSAM and PL/I became apparent. The new interface was designed to make its use simple and similar to existing PL/I file operations. The interface could be accessed by the "CALL" statement in PL/I, in much the same manner as a call from PL/I to IMS. The user of this interface, though, would have a symbolic macro facility available to him to ease the coding of the subroutine calls. The macro expansion would be accomplished using the PL/I preprocessor facility. The interface was designed to consist of a series of modules that would use PL/I control blocks and structures as much as possible. The most interesting and perhaps challenging aspect of the interface was the manner in which it would handle errors. Normally, one would design a module to return a condition code indicating success or failure of the module's function. This would require a test after each subroutine call to check whether the request was satisfied or not. While this is not a bad method of checking for errors, the handling of errors by the interface would ideally be done using PL/I's own error handler. When any one of the interface I/O routines detects an error, a call is made to the interface error handler. The interface error handler then, if possible, translates the error into a PI/I oncode. Any errors which cannot be translated into PL/I on-conditions are to be translated into the ERROR on-code. Once the error has been translated, a parameter list is set up and a call is made to PL/I's error handler. This permits the
VSAM PL/I接口
《IBM PL/I优化编译器语言参考手册》中指出,存在一个使用VSAM (Virtual Storage Access Method)数据集的接口。除了说VSAM数据集应该像索引顺序访问方法(ISAM)数据集一样被处理之外,它对可以做什么没有任何限制。至少它应该是这样运作的。但是,在使用VSAM集群和相关组件时,PL/I接口没有按预期工作。本文将简要介绍如何发现此问题的背景和错误描述。此外,还将介绍一种新的接口及其优缺点。执行开发的系统是IBM S/370- 68,运行在MVS 3.7E版本下。PL/I优化编译器的3.0版本是这项工作的主题。布莱恩·拉姆齐(Brian S. Ramsey)目前是空军后备军官训练队的一名学员。大约一年前,他试图修改学员管理课程。当时,这些程序被设计为与ISAM数据集一起运行,ISAM提供对学员记录的关键访问。除了主数据集之外,还使用另外两个ISAM数据集作为反向文件来维护辅助键。虚拟存储访问方法允许表示索引的顺序文件,从而提供对主键的键和顺序访问,以及定义辅助键和访问这些键上的记录的能力。通过使用VSAM而不是ISAM,主数据集和用于辅助访问的两个数据集可以合并为一个VSAM数据集。通过这种方式,在此之前,应用程序对二级访问目录的维护将被转移到访问方法。为了实现传输,需要创建一个VSAM基础集群和两个备用索引。初始规格设计完成后,构建并加载VSAM集群。然后构建备用索引并将其与基本集群关联起来。下一步是设计程序来测试使用VSAM的可行性。正是在这个阶段,漏洞被发现了。测试备用索引的程序使用下面的声明语句打开文件以便直接访问:无法打开文件。给出的理由是备用索引是一个不能直接键控访问的组织。在手册中找不到这种错误的原因,因此编写了一个小的汇编语言程序来确定是否可以通过替代索引实现直接键控访问。使用相同编码的访问控制块(acb),程序打开,使用键控访问来读取记录,并关闭基本簇和一个备用索引。测试过程中没有发生错误。这个实验似乎表明PL/I接口在识别替代索引方面存在困难。VSAM备用索引的使用应该对用户透明。透明度是创建替代索引的主要原因之一。如果使用对用户不透明,或者用户必须为使用备用索引做出特殊的允许,那么为什么不直接将备用索引保留为VSAM基集群呢?当用汇编语言编码时,备用索引的使用对程序员是透明的。这也适用于高级语言。由于PL/I不符合这个标准,在VSAM和PL/I之间需要一个更好的接口就变得很明显了。新界面的设计使其使用简单,类似于现有的PL/I文件操作。可以通过PL/I中的“CALL”语句访问该接口,其方式与从PL/I调用IMS的方式大致相同。但是,该接口的用户可以使用符号宏工具来简化子例程调用的编码。宏扩展将使用PL/I预处理器设施来完成。该接口被设计成由一系列尽可能使用PL/I控制块和结构的模块组成。这个界面最有趣、也可能是最具挑战性的方面是它处理错误的方式。通常,人们会设计一个模块来返回一个条件代码,指示模块功能的成功或失败。这将需要在每个子例程调用之后进行测试,以检查请求是否得到满足。虽然这不是一种检查错误的坏方法,但是接口对错误的处理最好使用PL/I自己的错误处理程序来完成。当任何一个接口I/O例程检测到错误时,将调用接口错误处理程序。接口错误处理程序然后,如果可能的话,将错误转换为PI/I oncode。任何不能转换为PL/I on-condition的错误都要转换为ERROR on-code。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信