Record Concatenation SIMO801K - The COBOL Source Code |
The SimoTime Home Page |
The SIMO801K Utility Program will concatenate text strings from multiple 80-byte records into a single record with a 1024 byte record length.
This program provides the programmer with the ability to concatenate text strings within multiple 80-byte records into a single 1024-byte record. For an example of a program that calls this routine refer to the Current Server or Internet Access section of this document.
This document provides a listing of the COBOL source code for the SIMO801K utility program. 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 SIMO801K Utility Program will read a sequential file with 80-byte records. Position 72 of the record is used as a continuation indicator. A non-space character will cause positions 1-71 to be moved to the output buffer but the write will be suppressed. The next record will be concatenated with data already in the output buffer. The output file is a Record Sequential file (RSEQ) with a record length of 1,024 bytes.
wip
The following (SIMO801K.cbl) is the COBOL Source Code.
IDENTIFICATION DIVISION. PROGRAM-ID. SIMO801K. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2015-10-28 Generation Time: 23:58:40:43 * * * * Record Record Key * * Function Name Organization Format Max-Min Pos-Len * * PRIMARY SYSUT1 SEQUENTIAL FIXED 00080 * * * * SECONDARY SYSUT2 SEQUENTIAL FIXED 01024 * * * * * * Translation Mode is User Defined * * * ***************************************************************** ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT SYSUT1-FILE ASSIGN TO SYSUT1 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS SYSUT1-STATUS. SELECT SYSUT2-FILE ASSIGN TO SYSUT2 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS SYSUT2-STATUS. ***************************************************************** DATA DIVISION. FILE SECTION. FD SYSUT1-FILE DATA RECORD IS SYSUT1-REC . 01 SYSUT1-REC. 05 SYSUT1-DATA-01 PIC X(00080). FD SYSUT2-FILE DATA RECORD IS SYSUT2-REC . 01 SYSUT2-REC. 05 SYSUT2-DATA-01 PIC X(01024). ***************************************************************** * This program was created with the SYSMASK1.TXT file as input. * * The SYSMASK1 provides for the sequential reading of the input * * file and the sequential writing of the output file. * * * * If the output file is indexed then the input file must be in * * sequence by the field that will be used to provide the key * * for the output file. This is a sequential load process. * * * * If the key field is not in sequence then refer to SYSMASK2 * * to provide for a random add or update of the indexed file. * * * * This program mask will have the ASCII/EBCDIC table inserted * * for use by the /TRANSLATE function of SimoZAPS. * * * * For additional information contact SimoTime Technologies. * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** WORKING-STORAGE SECTION. 01 SIM-TITLE. 05 T1 pic X(11) value '* SIMO801K '. 05 T2 pic X(34) value 'RSEQ, 80-1024 String Concatenation'. 05 T3 pic X(10) value ' v15.10.31'. 05 T4 pic X(24) value ' helpdesk@simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* SIMO801K '. 05 C2 pic X(32) value 'This Data File Convert Member wa'. 05 C3 pic X(32) value 's generated by SimoTime Technolo'. 05 C4 pic X(04) value 'gies'. 01 SYSUT1-STATUS. 05 SYSUT1-STATUS-L pic X. 05 SYSUT1-STATUS-R pic X. 01 SYSUT1-EOF pic X value 'N'. 01 SYSUT1-OPEN-FLAG pic X value 'C'. 01 SYSUT2-STATUS. 05 SYSUT2-STATUS-L pic X. 05 SYSUT2-STATUS-R pic X. 01 SYSUT2-EOF pic X value 'N'. 01 SYSUT2-OPEN-FLAG pic X value 'C'. 01 SYSUT1-LRECL pic 9(5) value 00080. 01 SYSUT2-LRECL pic 9(5) value 01024. 01 SYSUT1-LRECL-MAX pic 9(5) value 00080. ***************************************************************** * The following buffers are used to create a four-byte status * * code that may be displayed. * ***************************************************************** 01 IO-STATUS. 05 IO-STAT1 pic X. 05 IO-STAT2 pic X. 01 IO-STATUS-04. 05 IO-STATUS-0401 pic 9 value 0. 05 IO-STATUS-0403 pic 999 value 0. 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. ***************************************************************** * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine. * ***************************************************************** 01 MESSAGE-BUFFER. 05 MESSAGE-HEADER pic X(11) value '* SIMO801K '. 05 MESSAGE-TEXT. 10 MESSAGE-TEXT-1 pic X(68) value SPACES. 10 MESSAGE-TEXT-2 pic X(188) value SPACES. ***************************************************************** 01 PROGRAM-NAME pic X(8) value 'SIMO801K'. 01 INFO-STATEMENT. 05 INFO-SHORT. 10 INFO-ID pic X(8) value 'Starting'. 10 filler pic X(2) value ', '. 10 filler pic X(34) value 'RSEQ, 80-1024 String Concatenation'. 05 filler pic X(24) value ' http://www.SimoTime.com'. 01 APPL-RESULT pic S9(9) comp. 88 APPL-AOK value 0. 88 APPL-EOF value 16. 01 WRITE-FLAG pic X value 'Y'. 01 SYSUT1-TOTAL. 05 SYSUT1-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for SYSUT1 '. 01 SYSUT2-TOTAL. 05 SYSUT2-ADD pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for SYSUT2 '. ***************************************************************** * User defined working storage... * USERDATA SIMO801K_CRT_WS.inc 01 NEXT-PUT-POSN PIC 9(5) value 1. 01 LAST-GET-SIG-POSN PIC 9(5) value 71. 01 PT-1 PIC 9(5) value 1. ***************************************************************** PROCEDURE DIVISION. move all '*' to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT move INFO-STATEMENT to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT move all '*' to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT perform Z-POST-COPYRIGHT perform SYSUT1-OPEN perform SYSUT2-OPEN perform until SYSUT1-STATUS not = '00' move SPACES to SYSUT1-REC perform SYSUT1-READ if SYSUT1-STATUS = '00' add 1 to SYSUT1-RDR perform BUILD-OUTPUT-RECORD if WRITE-FLAG = 'Y' perform SYSUT2-WRITE if SYSUT2-STATUS = '00' add 1 to SYSUT2-ADD end-if end-if end-if end-perform * USREOJ Processing not specified... move SYSUT1-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT2-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT if APPL-EOF move 'Complete' to INFO-ID else move 'ABENDING' to INFO-ID end-if move INFO-STATEMENT to MESSAGE-TEXT(1:79) perform Z-DISPLAY-MESSAGE-TEXT perform SYSUT2-CLOSE perform SYSUT1-CLOSE GOBACK. ***************************************************************** BUILD-OUTPUT-RECORD. * USEREXEC *INC SIMO801K_CRT_UI.inc ***************************************************************** * EYE CATCHER for SIMO801K if WRITE-FLAG = 'Y' move SPACES to SYSUT2-DATA-01 end-if perform USER-SYSUT1-LSB if SYSUT1-DATA-01(72:1) = SPACE move SYSUT1-DATA-01 to SYSUT2-DATA-01(NEXT-PUT-POSN:LAST-GET-SIG-POSN) move 'Y' to WRITE-FLAG add 1 to ZERO giving NEXT-PUT-POSN else move SYSUT1-DATA-01(1:LAST-GET-SIG-POSN) to SYSUT2-DATA-01(NEXT-PUT-POSN:LAST-GET-SIG-POSN) move 'N' to WRITE-FLAG add LAST-GET-SIG-POSN to NEXT-PUT-POSN exit. ***************************************************************** USER-SYSUT1-LSB. add 1 to ZERO giving PT-1 add 1 to ZERO giving LAST-GET-SIG-POSN perform 71 times if SYSUT1-DATA-01(PT-1:1) not = SPACE add PT-1 to ZERO giving LAST-GET-SIG-POSN end-if add 1 to PT-1 end-perform exit. ***************************************************************** * I/O Routines for the INPUT File... * ***************************************************************** SYSUT1-CLOSE. add 8 to ZERO giving APPL-RESULT. close SYSUT1-FILE if SYSUT1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else add 4 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with SYSUT1 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SYSUT1-READ. read SYSUT1-FILE if SYSUT1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if SYSUT1-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if if APPL-AOK CONTINUE else if APPL-EOF move 'Y' to SYSUT1-EOF else move 'READ Failure with SYSUT1 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if end-if exit. *---------------------------------------------------------------* SYSUT1-OPEN. add 8 to ZERO giving APPL-RESULT. open input SYSUT1-FILE if SYSUT1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to SYSUT1-OPEN-FLAG else add 16 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with SYSUT1 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * I/O Routines for the OUTPUT File... * ***************************************************************** SYSUT2-WRITE. if SYSUT2-OPEN-FLAG = 'C' perform SYSUT2-OPEN end-if write SYSUT2-REC if SYSUT2-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if SYSUT2-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if. if APPL-AOK CONTINUE else move 'WRITE Failure with SYSUT2 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT2-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SYSUT2-OPEN. add 8 to ZERO giving APPL-RESULT. open OUTPUT SYSUT2-FILE if SYSUT2-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to SYSUT2-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with SYSUT2 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT2-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SYSUT2-CLOSE. add 8 to ZERO giving APPL-RESULT. close SYSUT2-FILE if SYSUT2-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'C' to SYSUT2-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with SYSUT2 ' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SYSUT2-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * The following Z-ROUTINES provide administrative functions * * for this program. * ***************************************************************** * ABEND the program, post a message to the console and issue * * a STOP RUN. * ***************************************************************** Z-ABEND-PROGRAM. if MESSAGE-TEXT not = SPACES perform Z-DISPLAY-MESSAGE-TEXT end-if move 'PROGRAM-IS-ABENDING...' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT add 12 to ZERO giving RETURN-CODE STOP RUN. * exit. ***************************************************************** * Display CONSOLE messages... * ***************************************************************** Z-DISPLAY-MESSAGE-TEXT. if MESSAGE-TEXT-2 = SPACES display MESSAGE-BUFFER(1:79) else display MESSAGE-BUFFER end-if move all SPACES to MESSAGE-TEXT exit. ***************************************************************** * Display the file status bytes. This routine will display as * * four digits. If the full two byte file status is numeric it * * will display as 00nn. If the 1st byte is a numeric nine (9) * * the second byte will be treated as a binary number and will * * display as 9nnn. * ***************************************************************** Z-DISPLAY-IO-STATUS. 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 move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT else move '0000' to IO-STATUS-04 move IO-STATUS to IO-STATUS-04(3:2) move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT end-if exit. ***************************************************************** Z-POST-COPYRIGHT. display SIM-TITLE display SIM-COPYRIGHT exit. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2015-10-28 Generation Time: 23:58:40:48 * *****************************************************************
The SIMO801K program will concatenate text strings from multiple 80-byte records into a single record with a 1024 byte record length. This document may be used 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 How to do Case Conversion using COBOL. The example shows a simple conversion between upper and lower case plus capitalization and editing of specific words within a text string. The mainline program will call the SIMOCASE module that is available from SimoTime as part of the SIMOMODS package.
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 Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.
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 GnuCOBOL Technologies available from SourceForge. SourceForge is an Open Source community resource dedicated to helping open source projects be as successful as possible. GnuCOBOL (formerly OpenCOBOL) is a COBOL compiler with run time support. The compiler (cobc) translates COBOL source to executable using intermediate C, designated C compiler and linker. This link will require 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 |
Record Concatenation, 80-byte to 1024-byte |
Copyright © 1987-2024 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |