Display a File Status Code SimoSTAT - The COBOL Source Code |
The SimoTime Home Page |
The SIMOSTAT routine will accept a two-byte file status code and provide a four-byte file status code that is suitable for display purposes. An eighty-byte message provides additional text information about the file status code.
This document provides a listing of the COBOL source code for the callable routine SIMOSTAT Additional information about this program may be obtained by sending an e-mail to: helpdesk@simotime.com
We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
The SIMOSTAT routine (or callable program) will do simple conversion of the two byte file status code and provide a four byte file status code that is suitable for display purposes.
The following will convert the text string from upper case to lower case text..
MOVE FILE-STATUS to FSPA-STATUS-CODE-02 CALL 'SIMOSTAT' using FILE-STATUS-PASS-AREA display FSPA-STATUS-CODE-04 display FSPA-TEXT-MESSAGE
A copy file is provided to define the pass area to be used when calling SimoSTAT. The following statement is required in the WORKING STORAGE section of the calling program.
WORKING STORAGE. … … COPY PASSSTAT. …
The following (SIMOSTAT.cbl) is the COBOL Source Code.
IDENTIFICATION DIVISION. PROGRAM-ID. SIMOSTAT. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * Copyright (C) 1987-2019 SimoTime Technologies. * * * * All rights reserved. Unpublished, all rights reserved under * * copyright law and international treaty. Use of a copyright * * notice is precautionary only and does not imply publication * * or disclosure. * * * * Permission to use, copy, modify and distribute this software * * for any non-commercial purpose and without fee is hereby * * granted, provided the SimoTime copyright notice appear on all * * copies of the software. The SimoTime name or Logo may not be * * used in any advertising or publicity pertaining to the use * * of the software without the written permission of SimoTime * * Technologies. * * * * Permission to use, copy, modify and distribute this software * * for any commercial purpose requires a fee to be paid to * * SimoTime Technologies. Once the fee is received by SimoTime * * the latest version of the software will be delivered and a * * license will be granted for use within an enterprise, * * provided the SimoTime copyright notice appear on all copies * * of the software. The SimoTime name or Logo may not be used * * in any advertising or publicity pertaining to the use of the * * software without the written permission of SimoTime * * Technologies. * * * * SimoTime Technologies makes no warranty or representations * * about the suitability of the software for any purpose. It is * * provided "AS IS" without any expressed or implied warranty, * * including the implied warranties of merchantability, fitness * * for a particular purpose and non-infringement. SimoTime * * Technologies shall not be liable for any direct, indirect, * * special or consequential damages resulting from the loss of * * use, data or projects, whether in an action of contract or * * tort, arising out of or in connection with the use or * * performance of this software * * * * SimoTime Technologies * * 15 Carnoustie Drive * * Novato, CA 94949-5849 * * 415.883.6565 * * * * RESTRICTED RIGHTS LEGEND * * Use, duplication, or disclosure by the Government is subject * * to restrictions as set forth in subparagraph (c)(1)(ii) of * * the Rights in Technical Data and Computer Software clause at * * DFARS 52.227-7013 or subparagraphs (c)(1) and (2) of * * Commercial Computer Software - Restricted Rights at 48 * * CFR 52.227-19, as applicable. Contact SimoTime Technologies, * * 15 Carnoustie Drive, Novato, CA 94949-5849. * * * ***************************************************************** * This program is provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * ***************************************************************** * ***************************************************************** * Source Member: SIMOSTAT.CBL * Copy Files: PASSSTAT.CPY * TAB4STAT.CPY ***************************************************************** * * SIMOSTAT - Provide File Status information for displaying. * * CALLING PROTOCOL * ---------------- * Use standard COBOL calling procedures. * * DESCRIPTION * ----------- * This routine will use the two-byte File Status Code that may * be a mix of numeric and binary data to provide a four digit * File Status Code and a one-line description in the Pass Area. * **************************************************************** * * MAINTENANCE * ----------- * 1989/02/27 Simmons, Created program. * 1989/02/27 Simmons, no changes to date * ***************************************************************** * DATA DIVISION. WORKING-STORAGE SECTION. ***************************************************************** * The following buffers are used to create a four-byte numeric * * file status code that may be displayed. * ***************************************************************** 01 IO-STATUS. 05 IO-STAT1 pic X. 05 IO-STAT2 pic X. 01 TWO-BYTES-BINARY pic 9(4) BINARY. 01 TWO-BYTES-ALPHA redefines TWO-BYTES-BINARY. 05 TWO-BYTES-LEFT pic X. 05 TWO-BYTES-RIGHT pic X. 01 IO-STATUS-04. 05 IO-STATUS-0401 pic 9 value 0. 05 IO-STATUS-0403 pic 999 value 0. 01 LOOK-OUT pic X value 'N'. COPY TAB4STAT. ***************************************************************** LINKAGE SECTION. COPY PASSSTAT. ***************************************************************** PROCEDURE DIVISION using FILE-STATUS-PASS-AREA. move FSPA-STATUS-CODE-02 to IO-STATUS perform CONVERT-TWO-BYTE-TO-FOUR-BYTE move IO-STATUS-04 to FSPA-STATUS-CODE-04 perform GET-TEXT-VERBAGE GOBACK. ***************************************************************** * Convert the two-byte file status code to a four digit value. * * If the full two byte file status is numeric it will be * * converted to 00nn. If the 1st byte is a numeric nine (9) * * the second byte will be treated as a binary number and will * * be converted to 9nnn. * ***************************************************************** CONVERT-TWO-BYTE-TO-FOUR-BYTE. if IO-STATUS not NUMERIC or IO-STAT1 = '9' move IO-STAT1 to IO-STATUS-04(1:1) subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY move IO-STAT2 to TWO-BYTES-RIGHT add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403 else move '0000' to IO-STATUS-04 move IO-STATUS to IO-STATUS-04(3:2) end-if exit. ***************************************************************** GET-TEXT-VERBAGE. add 1 to ZERO giving STATUS-IDX move 'N' to LOOK-OUT move SPACES to FSPA-TEXT-MESSAGE perform until STATUS-IDX > STATUS-CELLS-MAXIMUM or LOOK-OUT = 'Y' if STATUS-CELL-04(STATUS-IDX) = FSPA-STATUS-CODE-04 move STATUS-CELL(STATUS-IDX) to FSPA-TEXT-MESSAGE move 'Y' to LOOK-OUT else add 1 to STATUS-IDX end-if end-perform exit. ***************************************************************** * This program is provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * *****************************************************************
The SIMOSTAT routine uses two copy files. The first copy file defines the structure for the user interface or pass area. The second copy file defines a table of file status codes with a short message or text string.
The following (PASSSTAT.cpy) is the COBOL copy file that may be used when calling SIMOSTAT.
***************************************************************** * Data Structure or Pass Area used for calling SIMOSTAT. * ***************************************************************** * Copyright (C) 1987-2019 SimoTime Technologies * * All Rights Reserved * ***************************************************************** * Provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** * * The following is a summary of the fields used as linkage items. * * FSPA-STATUS-CODE-02 Two byte file status code. * FSPA-STATUS-CODE-04 Four Byte file status code. * FSPA-TEXT-MESSAGE Short description of status. * ***************************************************************** 01 FILE-STATUS-PASS-AREA. 05 FSPA-STATUS-CODE-02 PIC X(2). 05 FSPA-STATUS-CODE-04 PIC X(4). 05 FSPA-TEXT-MESSAGE PIC X(80). *** PASSSTAT - End-of-Copy File - - - - - - - - - - - PASSSTAT * ***************************************************************** *
The following (TAB4STAT.cpy) is the COBOL copy file that contains the file status codes with a short text string.
***************************************************************** * TAB4STAT is a COBOL Copy File * * Data Table for File Status Codes. * * Copyright (C) 1987-2019 SimoTime Technologies * * All Rights Reserved * ***************************************************************** * Provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** * The following table contains file status code information. * * The intent of this table is to provide a brief description * * of the file status code. For an expanded description refer to * * the documentation provided by the software vendor. * ***************************************************************** * 01 STATUS-TABLE-OF-DATA. 05 filler PIC X(56) value '0000, Successful completion '. 05 filler PIC X(56) value '0002, Index File, identical or duplicate key value '. 05 filler PIC X(56) value '0004, Conflict, record length and fixed file attributes '. 05 filler PIC X(56) value '0005, OPEN failure, referenced file is not found '. 05 filler PIC X(56) value '0006, WRITE failure, file that has been opened for input'. 05 filler PIC X(56) value '0007, OPEN or CLOSE failure, REEL/UNIT for non-reel/unit'. 05 filler PIC X(56) value '0008, Read failure, file opened for output '. 05 filler PIC X(56) value '0009, No room in directory or directory does not exist '. 05 filler PIC X(56) value '0010, No next logical record exists, end of the file '. 05 filler PIC X(56) value '0012, OPEN failure, file is already open '. 05 filler PIC X(56) value '0013, File not found '. 05 filler PIC X(56) value '0014, Requested relative record number > relative key '. 05 filler PIC X(56) value '0015, Too many indexed files open (MF) '. 05 filler PIC X(56) value '0016, Too many device files open (MF) '. 05 filler PIC X(56) value '0017, Record error: probably zero length (MF) '. 05 filler PIC X(56) value '0018, EOF before EOR or file open in wrong mode (MF) '. 05 filler PIC X(56) value '0019, Rewrite error: open mode or access mode wrong (MF)'. 05 filler PIC X(56) value '0020, Device or resource busy (MF) '. 05 filler PIC X(56) value '0021, Ascending key sequence has been violated '. 05 filler PIC X(56) value '0022, Indicates a duplicate key condition '. 05 filler PIC X(56) value '0023, Indicates no record found '. 05 filler PIC X(56) value '0024, Relative or indexed files, a boundary violation '. 05 filler PIC X(56) value '0030, Failure, boundary, parity check, transmission '. 05 filler PIC X(56) value '0034, WRITE beyond defined boundaries of sequential file'. 05 filler PIC X(56) value '0035, OPEN failure, specified file not found '. 05 filler PIC X(56) value '0037, OPEN failure, open mode specified is not supported'. 05 filler PIC X(56) value '0038, OPEN failure, file previously closed with a lock '. 05 filler PIC X(56) value '0039, File Attributes, conflict of actual vs. specified '. 05 filler PIC X(56) value '0041, OPEN failure, file is already opened '. 05 filler PIC X(56) value '0042, CLOSE failure, file already closed '. 05 filler PIC X(56) value '0043, DELETE or REWRITE attempt without a previous READ '. 05 filler PIC X(56) value '0044, A boundary violation exists '. 05 filler PIC X(56) value '0046, READ failure, no valid next record established '. 05 filler PIC X(56) value '0047, READ or START failure, not opened for INPUT or I-O'. 05 filler PIC X(56) value '0048, A WRITE failure, not opened OUTPUT, EXTEND or I-O '. 05 filler PIC X(56) value '0049, DELETE or REWRITE failure, file is not opened I-O '. 05 filler PIC X(56) value '9000/00, No further information '. 05 filler PIC X(56) value '9001/01, Insufficient buffer space or out of memory '. 05 filler PIC X(56) value '9002/02, File not open when access tried '. 05 filler PIC X(56) value '9003/03, Serial mode error '. 05 filler PIC X(56) value '9004/04, Illegal file name '. 05 filler PIC X(56) value '9005/05, Illegal device specification '. 05 filler PIC X(56) value '9006/06, Attempt to write to a file opened for input '. 05 filler PIC X(56) value '9007/07, Disk space exhausted '. 05 filler PIC X(56) value '9008/08, Attempt to input from a file opened for output '. 05 filler PIC X(56) value '9009/09, No room in directory, directory does not exist'. 05 filler PIC X(56) value '9010/0A, File name not supplied '. 05 filler PIC X(56) value '9012/0C, Attempt to open a file that is already open '. 05 filler PIC X(56) value '9013/0D, File not found '. 05 filler PIC X(56) value '9014/0E, Too many files open simultaneously '. 05 filler PIC X(56) value '9015/0F, Too many indexed files open '. 05 filler PIC X(56) value '9016/10, Too many device files open '. 05 filler PIC X(56) value '9017/11, Record error, probable zero record length '. 05 filler PIC X(56) value '9018/12, EOF before EOR or file open in wrong mode '. 05 filler PIC X(56) value '9019/13, Rewrite error: open mode or access mode wrong '. 05 filler PIC X(56) value '9020/14, Device or resource busy '. 05 filler PIC X(56) value '9021/15, File is a directory '. 05 filler PIC X(56) value '9022/16, Illegal or impossible access mode for OPEN '. 05 filler PIC X(56) value '9023/17, Illegal or impossible access mode for CLOSE '. 05 filler PIC X(56) value '9024/18, Disk I/O error '. 05 filler PIC X(56) value '9025/19, Operating system data error '. 05 filler PIC X(56) value '9026/1A, Block I/O error '. 05 filler PIC X(56) value '9027/1B, Device not available '. 05 filler PIC X(56) value '9028/1C, No space on device '. 05 filler PIC X(56) value '9029/1D, Attempt to delete open file '. 05 filler PIC X(56) value '9030/1E, File system is read only '. 05 filler PIC X(56) value '9031/1F, Not owner of file '. 05 filler PIC X(56) value '9032/20, Too many indexed files, or no such process '. 05 filler PIC X(56) value '9033/21, Physical I/O error '. 05 filler PIC X(56) value '9034/22, Incorrect mode or file descriptor '. 05 filler PIC X(56) value '9035/23, File access attempt with incorrect permission '. 05 filler PIC X(56) value '9036/24, File already exists '. 05 filler PIC X(56) value '9037/25, File access denied '. 05 filler PIC X(56) value '9038/26, Disk not compatible '. 05 filler PIC X(56) value '9039/27, File not compatible '. 05 filler PIC X(56) value '9040/28, Language initialization not set up correctly '. 05 filler PIC X(56) value '9041/29, Corrupt index file '. 05 filler PIC X(56) value '9042/2A, Attempt to write on broken pipe '. 05 filler PIC X(56) value '9043/2B, File information missing for indexed file '. 05 filler PIC X(56) value '9044/2C, Attempt open, NLS file and incompatible program'. 05 filler PIC X(56) value '9045/2D, Index structure overflow maximum duplicate keys'. 05 filler PIC X(56) value '9065/41, File locked '. 05 filler PIC X(56) value '9066/42, Attempt to add duplicate key to indexed file '. 05 filler PIC X(56) value '9067/43, Indexed file not open '. 05 filler PIC X(56) value '9068/44, Record locked '. 05 filler PIC X(56) value '9069/45, Illegal argument to ISAM module '. 05 filler PIC X(56) value '9070/46, Too many indexed files open '. 05 filler PIC X(56) value '9071/47, Bad indexed file format '. 05 filler PIC X(56) value '9072/48, End of indexed file '. 05 filler PIC X(56) value '9073/49, No record found in indexed file '. 05 filler PIC X(56) value '9074/4A, No current record in indexed file '. 05 filler PIC X(56) value '9075/4B, Indexed data file name too long '. 05 filler PIC X(56) value '9076/4C, Internal ISAM module failure '. 05 filler PIC X(56) value '9077/4D, Illegal key description in indexed file '. 05 filler PIC X(56) value '9081/51, Key already exists in indexed file '. 05 filler PIC X(56) value '9092/5C, PUT/update or ERASE without a previous GET '. 05 filler PIC X(56) value '9100/64, Invalid file operation '. 05 filler PIC X(56) value '9101/65, Illegal operation on an indexed file '. 05 filler PIC X(56) value '9102/66, Sequential file, non-integral number of records'. 05 filler PIC X(56) value '9104/68, Null file name used in a file operation '. 05 filler PIC X(56) value '9105/69, Memory allocation error '. 05 filler PIC X(56) value '9124/7C, Connection failure to remote system (MF) '. 05 filler PIC X(56) value '9125/7D, Connection to remote file server failed (MF) '. 05 filler PIC X(56) value '9129/81, Attempt to access record zero of relative file '. 05 filler PIC X(56) value '9135/87, File must not exist '. 05 filler PIC X(56) value '9138/8A, File closed with lock - cannot be opened '. 05 filler PIC X(56) value '9139/8B, Record length or key data inconsistency '. 05 filler PIC X(56) value '9141/8D, File already open - cannot be opened '. 05 filler PIC X(56) value '9142/8E, File not open - cannot be closed '. 05 filler PIC X(56) value '9143/8F, REWRITE/DELETE not preceded by successful READ '. 05 filler PIC X(56) value '9146/92, No current record defined for sequential read '. 05 filler PIC X(56) value '9147/93, Wrong open mode or access mode for READ/START '. 05 filler PIC X(56) value '9148/94, Wrong open mode or access mode for WRITE '. 05 filler PIC X(56) value '9149/95, Wrong open or access mode for REWRITE/ DELETE '. 05 filler PIC X(56) value '9150/96, Program abandoned at user request '. 05 filler PIC X(56) value '9151/97, Random read on sequential file '. 05 filler PIC X(56) value '9152/98, REWRITE on file not opened I-O '. 05 filler PIC X(56) value '9158/9E, Attempt to REWRITE to a line-sequential file. '. 05 filler PIC X(56) value '9159/9F, Malformed line sequential-file '. 05 filler PIC X(56) value '9161/A1, File header not found '. 05 filler PIC X(56) value '9173/AD, Called program not found '. 05 filler PIC X(56) value '9180/B4, End-of-file marker error '. 05 filler PIC X(56) value '9182/B6, Console input or output open in wrong direction'. 05 filler PIC X(56) value '9183/B7, Attempt to open line sequential file for I-O '. 05 filler PIC X(56) value '9188/BC, File name too large '. 05 filler PIC X(56) value '9193/C1, Error in variable length count '. 05 filler PIC X(56) value '9194/C2, File size too large '. 05 filler PIC X(56) value '9195/C3, DELETE/REWRITE not preceded by a READ '. 05 filler PIC X(56) value '9196/C4, Record number too large, relative/indexed file '. 05 filler PIC X(56) value '9210/D2, File is closed with lock '. 05 filler PIC X(56) value '9213/D5, Too many locks '. 05 filler PIC X(56) value '9218/DA, Malformed MULTIPLE REEL/UNIT file '. 05 filler PIC X(56) value '9219/DB, Operating system shared file limit exceeded '. ***************************************************************** 01 STATUS-TABLE-01 REDEFINES STATUS-TABLE-OF-DATA. 05 STATUS-CELL OCCURS 133 TIMES. 10 STATUS-CELL-04 pic X(4). 10 STATUS-CELL-52 pic X(52). 01 STATUS-CELLS-MAXIMUM pic 9(5) value 133. 01 STATUS-IDX pic 9(5) value 0. *** TAB4STAT - End-of-Copy File - - - - - - - - - - - TAB4STAT * ***************************************************************** *
The SIMOSTAT routine will accept a two-byte file status code and provide a four-byte file status code that is suitable for display purposes. This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.
In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.
SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the Contact, Comment or Feedback section of this document.
Software Agreement and Disclaimer
Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.
SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.
This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.
Note: A SimoTime License is required for the items to be made available on a local system or server.
The following links may be to the current server or to the Internet.
Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the icon.
Explore a complete list of the SimoTime Callable Routines or Utility Programs. This includes the callable routines and utility programs for the Micro Focus environment.
Explore an Extended List of Software Technologies that are available for review and evaluation. The software technologies (or Z-Packs) provide individual programming examples, documentation and test data files in a single package. The Z-Packs are usually in zip format to reduce the amount of time to download.
Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.
Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.
The following links will require an internet connect.
This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.
A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection
Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.
1. | Send an e-mail to our helpdesk. |
1.1. | helpdesk@simotime.com. |
2. | Our telephone numbers are as follows. |
2.1. | 1 415 763-9430 office-helpdesk |
2.2. | 1 415 827-7045 mobile |
We appreciate hearing from you.
SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.
Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.
Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.
Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com
Return-to-Top |
Display the File Status Code |
Copyright © 1987-2024 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |